design-patterns

Which design patterns can be applied to the configuration settings problem?

In large and complex software products managing configurable settings becomes a major pain. Two approaches I've seen to the problem are: have each component in the system load its own configuration from config files or registry settings. have a settings loader class that loads all the configurable system settings and have each compon...

Separating Business Rules from Business Processes

Hi, how do I externalize the business rules from the business processes so that I can add rules without touching the business process logic? For example, I have two business processes, say "Add Product" and "Update Product", there are a few common rules that these 2 processes share, and rules can keep getting added later. I intend to w...

CRUD-level locking on objects - design patterns

Hi Do you know any design patterns for implementing a CRUD-level locking on objects, meaning, for one instance of an object, I should be able to specify different access control level for each of the operations (Create, Read, Update, Delete). For example, person A may read and update object Z, but may not delete it. Person B can read, u...

Design pattern : notification system

Hi. I'm working on a website that will use features of social networking (like facebook for example). I would like to implement a notification system which shows stuff like "X added you as a friend", "Y invite you to the party", "Z has taken the lastest quizz"... and i don't know how to do. I wonder what is the best solution : Solut...

C# -Pipeline Style event model

In ASP.NET Web Apps , events are fired in particluar order : for simplicity Load => validation =>postback =>rendering Suppose I want to develop such pipeline -styled event Example : Event 1 [ "Audiance are gathering" ,Guys{ Event 2 and Event 3 Please wait until i signal }] after Event 1 finished it task Event 2 [ { Event 2, ...

Correct way to optimize repeated Rails code

Hello everyone, I have a Rails application with several models-views-controllers which have some similar characteristics, for example 5 different models can be commented on, voted on or tagged, I am also heavily using external plugins. At the moment I introduced comments, votes, tags, etc. only to a single model (and its view and cont...

Report Metadata in a Collection of [Telerik] Reports

I have a rapidly growing set of Telerik reports in my web project. My data providing strategy is that each report has an companying text file containing a SQL query. I handle complex filter criteria, like long 'x is in(y,z,a,b,c....)', or '((x=1) and (x < y))', repeated a hundred times, by doing text substitutions on a text file query ...

What strategies can an ORM use to cache data while minimizing complexity?

If the application asks for a similar result set to one that has recently been requested, how might the ORM keep track of which results are stale and which can be reused from before without using too many resources (memory) or creating too much architectural complexity? ...

Are there any design patterns used in the .NET Framework?

I would like to know: are any GoF design patterns are used in the .NET Framework? BOUNTY: I have seen the MSDN link below in an answer. Are there any post/video or can you can list patterns and most importantly WHERE it is used? ...

What is Model View Presenter ?

Can someone please explain in a way as simple as possible what the Model View Presenter pattern is? What is the difference with Model View Controller ? Which is best or for which purpose ? ...

PHP Web-App Design

Am looking for a guide, or simple to understand method of designing a website. I have a good idea of how to do various things in PHP anyways, basic knowledge of OOP, and functions and what not... But I need some structure, to keep me on track and let me know what I should be doing. Is there any websites, guides, or methods that can...

Tangible benefits of Use Case Modelling

At my current employer we generally adopt the old-school approach of writing a traditional functional requirements specification and then performing a full tech design. If the app is big then we break it into smaller chunks and attack it a chunk at a time but following the same basic pattern. This technique has served me well over the y...

Design Pattern Alternative to Coroutines

Hi, Currently, I have a large number of C# computations (method calls) residing in a queue that will be run sequentially. Each computation will use some high-latency service (network, disk...). I was going to use Mono coroutines to allow the next computation in the computation queue to continue while a previous computation is waiting f...

Which namespace does a factory class belong?

I have a factory class, DocumentLoaderFactory, which simply returns an instance that implements an interface, IDocumentLoader. All implementation resides under the following namespace Skim.Ssms.AddIn.ActiveFileExplorer.Loader But what I am wondering is, which namespace does DocumentLoaderFactory belong? I have placed the factory c...

Does an Anemic Domain Model mean you can't use utility/support classes as "helpers" for your domain model?

According to this definition, Fowler's concept of Anemic Domain Model is: a software domain model where the business logic is implemented outside the domain objects and With this pattern, logic is typically implemented in separate classes which transform the state of the domain objects. Fowler calls such external cl...

Which programming technique helps you most to avoid or resolve bugs before they come into production

I don't mean external tools. I think of architectural patterns, language constructs, habits. I am mostly interested in C++ ...

Architecture for dynamic business rules

I am creating a payroll application in .NET. One of the requirements is that the attendance and deduction rules should be dynamic and flexible to the most extent. The user should be able to define his own rules, where every employee will be bound to an attendance rule. One solution is to compile C# code on the fly where the code to eve...

Java document state pattern?

Hi, I am a new to programming with Java and I would like to know if there is some common practice for managing state of opened document (is current state saved or dirty) , saving document, opening, creating new document and so on. How do you approach this? Right now I have my little Swing application and have actions for opening and cl...

Deciding if I should split a table

I am building a multi language site I have a descriptions table that hold the description of each product and a column that indicate the language. So it contain a row for each language description Now my concern is that I have various different types of products in the system and reading the description of any product will have to go t...

Design Pattern to allow code to be injected at certain points

I am trying to allow developers to extend my code at certain points of execution. My specific example is a database transaction wrapper. The wrapper takes care of many details that we wanted to abstract away from the developer and is used on several projects. Each project however has certain things they would like to do automatically ...