design-patterns

Is there a widely used library of patterns & interfaces for .NET 3.5?

I'd like to avoid coding my own version of IFactory, ILog, IRepository and other common interfaces & implementations in my projects but find that commonly used libraries containing these tend to be focused on a particular concrete subsystem (one ORM, one IoC container, one logger). I've come across a some that seem more abstract (NCommon...

Where do I read about the "Value Pattern" and other typical "low level" design patterns?

The Gang of Four, Uncle Bob, Extreme Programming and Alt.net are great for high level enterprise level programming methodologies. However, I find they refer to these "primitive" design patterns for which I need a learning source. Where would I read about these primitive software engineering concepts? For example, a "Value Pattern" wou...

How can I keep up with new technologies?

Duplicate: Learning implementing design patterns for newbies I have been a developer for years and have my way of developing and have always kept up with the latest techologies. I want to start using a design pattern in the hope it will improve my development speed but I need to find one to apply and I need to find a full open so...

Template Method and Strategy design patterns

This is probably a newbie question since I'm new to design patterns but I was looking at the Template Method and Strategy DP's and they seem very similar. I can read the definitions, examine the UML's and check out code examples but to me it seem like the Strategy pattern is just using the Template Method pattern but you just happen to ...

Validation with State Pattern for Multi-Page Forms in ASP.NET

I'm trying to implement the state pattern for a multi-page registration form. The data on each page will be accumulated and stored in a session object. Should validation (including service layer calls to the DB) occur on the page level or inside each state class? In other words, should the concrete implementation of IState be concerned...

Singleton example

Gang of four uses a load balancer example to demonstrate the singleton pattern. I'm just wondering why a singleton needs to be used in that example? Are there any other real examples that specifically demonstrate using a singleton pattern? I just want to know more specific reasons why I would want to prevent the creation of more than o...

Does GRASP Creator really decouples?

I'm learning GRASP pattern at school and I have a question about the Creator pattern. Let's say you have three class, Computer, UserRespository and User. One of the rules of the GRASP Creator pattern tells you to assign the responsibility of creating an object to the class containing those object. By following this guideline, UserRepos...

How do I use the command pattern to reduce the complexity of a menu?

Say I have 4 buttons and I want each one to do a different thing. I don't want a big switch statement where I do a different thing based on which button was pushed, nor do I want a separate method for each button click. Is command pattern a good way to solve this? ...

Design patterns for managing results of large operations

We frequently have objects that perform multi-part operations/tasks. An example would be refreshing internal state of a list of objects based on a query of the file system and reading data from the found files. These things are also often long running, and tend to be performed in background threads (we do a lot of Swing work, but I thi...

Design Patterns

Possible Duplicate: How do you know when to use design patterns? How can I understand/take decision about "When to use what Design Pattern"? What are the factors to observe while taking decisions about using an appropriate design pattern in an appropriate place? ...

What is Proxy Class in C++

I wanted to know What is Proxy Class in C++, why it is created and where it is useful. Thank a lot in advance. ...

Is an anonymous function a good way to implement the command pattern?

I'm quite new to this pattern... ...

I have some questions about MVVM pattern

Hello, My name is Jesús from Spain, I'm a .NET developer and I just discovered this great web few days ago. I have some questions about MVVM pattern and I will be glad if you can answer they. I started WPF 3 months ago and I learned the MVP pattern. MVP is so good because you can structure the app so well. I started seeing the mvvm pa...

PHP - Should my function code be split into another source file?

I just found myself copying and pasting the same code twice. Right now I have one function that I want to share between two source files. It will pass the same variables from both source files. If I don't want to "repeat myself" would this be the best course of action? If both files have other functions that are separate should these...

Is there a design pattern that addresses how to manage multiple similar objects?

I have multiple objects that inherit from a base class and am trying to decide how the user should edit them. There are many common fields and a few fields that only apply to each sub class. Is there a design pattern to address this? I was thinking I could have one web page for each one or I could have a single web page and show/hide th...

Zend_Form and OOP design patterns

What is right way when using Zend_Form to create concrete application forms 1) Using "extends" and derived class class MyForm extends Zend_Form { public function __construct() { $el = $this->createElement('text', 'el'); $this->addElement($el); // ... } } 2) Or using delegation/proxy pattern class MyForm { private $_form;...

Design Patterns - Factory vs Abstract Factory

What is the basic difference between Factory and Abstract Factory Patterns? ...

How Do I Find Out If An Object Is Locked? c#

Hi there, I have a lock in my code.I have two threads running at the same time. How can I tell if a thread is locking that object? private readonly object _lockObject = new Object(); // Both methods running public void Method1() { if(certainCriteria) { lock(_lockObject) { //doWork; } } } ...

Design Patterns for Interfacing with Relational Databases?

Does anyone know of any design patterns for interfacing with relational databases? For instance, is it better to have SQL inline in your methods, or instantiate a SQL object where you pass data in and it builds the SQL statements? Do you have a static method to return the connection string and each method just gets that string and conn...

What is your understanding of the Repository Pattern?

I'm in the process of catching up on technical documentation for a project I completed some months ago, and one I'm coming close to finishing. I used repositories to abstract out the data access layer in both and was writing a short summary of the pattern on our wiki at work. It was whilst writing this summary that I realised I took a ...