design-patterns

Patterns to get a subset based on certain criteria (In Design)

I'm looking for a pattern for this general case: "I need to get a subset of data based on directly related criteria and indirectly related data." ...

Best place to bring up new window in Model View ViewModel

I have an MVVM application. In one of the ViewModels is the 'FindFilesCommand' which populates an ObservableCollection. I then implement a 'RemoveFilesCommand' in the same ViewModel. This command then brings up a window to get some more user input. Where/what is the best way to do this whilst keeping with the MVVM paradigm? Someho...

Looking for a creational design pattern

I'm trying to find a design pattern I can use to simplify the construction of some objects. Based on an incoming parameter, an custom class, I'm going to create various inheritors from the System.Windows.Forms.Control class. For instance, if the custom class has one of its members set to 'ChkBox', I want my class to return a System.Win...

Modern C++ Design Generic programming and Design Patterns Applied

I have purchase this book for our group in the company, perhaps, to improve our design skills and ultimately have a better programming practices. As I read it, I find, mostly, a set of nifty tricks that can be used with template, and not sure if it is worthwhile - and not detrimental-to incorporate it into our code thus introducing c...

How do you decide what assemblies to split your project into?

What's the most important consideration when deciding how to partition your application into assemblies? Do some people just create one assembly per unique namespace (or perhaps per root namespace) for convenience? Or one per app-layer (like Presentation, Business/Services, Data)? Or more subtle perhaps, put the entire Model in one assem...

Design pattern for parsing a markup tree into an object model

Hi, I'm stumped, I have a task where I have to take some markup (json format, not that it really matters) and parse it into an object model. We already have a domain model, its just a matter of running through the markup and creating the relevant objects. It's not really suitable for the composite pattern as the objects being created a...

It this an example of the Single Responsibility Principle?

I made the following code example to learn how to use a generics method signature. In order to get a Display() method for both Customer and Employee, I actually began replacing my IPerson interface with an Person abstract class. But then I stopped, remembering a podcast in which Uncle Bob was telling Scott Hanselman about the Single R...

Should I pass the BrainBench Design patterns certification?

I have found Design patterns certification at the Brainbehch. I have heard from people who passed it, that there are many Language-specific patterns questions, mostly from Java and C++. I think that this certification can: force me to improve my skills on Object oriented design and design patterns; improve and structure my knowle...

What is this? Template method or what?

I have a class Request.cs It has an abstract method: public abstract Response CreateResponse(XmlReader reader); and there's also a method: public Response SendRequest(string requestURI) { ... XmlReader reader = XmlReader.Create(responseStream); return CreateResponse(reader); } The CreateResponse method is implemented...

Choosing a Design Pattern

I need to design an application that resembles an internal mailing system. However, this is just a course project. No networking required. The professor is just making us put the discussed data structures to work. However, I have been having trouble deciding how to design the application. Let me explain briefly what I have to do and then...

Fitting a 3rd party web service into your application design

We have a process that runs a few times a day (via a Windows Service) and can also be invoked at anytime by an administrator level user (through a web app). This process gets a data set from a partner through a web service, then we merge this data with our local copy in our own format. Simple enough. My question is how this fits int...

Are there any common Design patterns or common idioms that are important for C++ win32 multithreading programming?

One example could be: RAII - Resource Acquisition is Initialization used with critical sections Any others that are important, popular and you often use? ...

How to handle a massive factory in a cleaner fashion

My development team has run into a design issue. I'm hoping someone can help me clean this part of the architecture up a bit. In my system, I have an enum with 250 members [one member represents a distinct drop down]. In order to populate the drop downs on any given window, that form sends in the enum members that relate to the drop do...

MVP on Asp.Net WebForms

I'm not clear about this.... When having a gridview on the View, is the controller who has to set up the Data source, columns, etc? or I just have to expose the DataBinding stuff, fire it from the controller and let the html/codebehind on the view handle all the rendering and wiring up? To be more precise: on the view should I have p...

What is the difference between MVC and MVVM?

Is there a difference between the standard "Model View Controller" pattern and Microsoft's Model/View/ViewModel pattern? ...

What is the difference between the template and the strategy pattern?

Can someone please explain to me what is the difference between the template pattern and the strategy pattern is? As far as I can tell they are 99% the same - the only difference being that the template pattern has an abstract class as the base class whereas the strategy class uses an interface that is implemnted by each concrete strateg...

Rehash: Accounting Software Design Patterns

Back in October, Kristopher Johnson asked about Accounting Software Design Patterns He received several answers, but they were all basically the same, pointing to Martin Fowlers Accounting Patterns. I don't really find Fowlers patterns all that useful. They seem overly complex for a more simplistic accounting system, so I'm rehashing ...

How to change this design to avoid a downcast?

Let's say I have a collection of objects that all inherit from a base class. Something like... abstract public class Animal { } public class Dog :Animal { } class Monkey : Animal { } Now, we need to feed these animals, but they are not allowed to know how to feed themselves. If they could, the...

Network Communication Design Patterns

I've come to realize that several questions I asked in the past, such as this really boil down to a more fundamental question. Are there any well known design patterns for network communications and by virtue of it's nature, protocol construction/parsing? A google search has not revealed much. Note that i'm not looking for solutions f...

.NET Sample Project Design Patterns Fowler

Are there sample ASP.NET projects around using the patterns discussed in the book by Martin Fowler (Patterns of Enterprise Application Architecture)? I have downloaded the Northwind starters kit and Dinner Now, which are very good. Are there others that use things like Unit of Work, Repository, ... thx, Lieven Cardoen ...