design-patterns

LINQ2SQL or Entity Framework or Enterprise Library??

with LINQ2SQL, Entity Framework in the market, does it make sense to use Enterprise Library data access application block to design Data Access Layer(DAL)? thanks. ...

What is the difference between Factory and Strategy patters?

Can any one explain the difference between factory and strategy pattrens? for me both are looking same other than an extra factory class(which create an object of product In factory pattrens) ...

Where should I create ListViewItem list when using the MVP pattern?

Hi all, I have a small application that I have written that uses the MVP pattern as follows: I created an interface called IView I implemented this interface in the Form Passed in an instance of the form as type IView into the constructor of the presenter The form contains a ListView component. The items that populates the ListView ...

Use of Service Agents while calling web Service

Can any one explain the use of service agent while calling web service? how it fit in project architecture? ...

What's the best way to get rid of nested ifs in code while checking for conditions?

I'm developing a BlackBerry app in Java and I have an Options class where all user settings are stored. The problem is I need to check some conditions in order to know how to react. As I keep adding more features, more GUI options are shown to the user, more settings are stored in the Options class and more conditions need to be checked ...

Using enums as status returned status indicators in C#

Just wondering what the general consensus was about returning enums from methods indicating the status. The notion of returning codes (ints) is pretty innate in oldschool systems programming (C) but I am wondering if the methodology for indicating the status has changed. thanks Edit: I am aware that enums are basically int values. I'm...

Actual usage of design pattern in open source software?

Does anybody know if some kind of study has been made to find out which design patterns are used in open source software? That would be interesting because it would provide a source of real-life examples of patterns implementation and it would give an idea about which patterns are the most frequently used. ...

Patterns for analysis, design or architechture

After spending many years of analysis, design and programming in different domains and architectures, you have maybe come across a "pattern" or good practice that haven't been published as a pattern (analysis, design or architecture). Although you have done it many times before, it has no name. Interested in patterns from the SO-commun...

Is the Repository Pattern the same as the Asp.net Provider Model?

Since Asp.net 2.0, there is the Provider Model. On the implementation detail, a provider is class derived from ProviderBase which is an abstract class rather than an interface, but anyway the Provider Model is there so that we can have different implementation to swap in the out by just editing the web.config. For example if you create...

Is Monostate the good cousin of the evil Singleton?

Singleton is definitely one of the most misused and abused patterns out there. Many of us have been infected with Singletonitis at one point or another. Curiously, its close cousin Monostate is less famous and less used. What is your opinion of Monostate? Good or just as evil? Is it a better alternative to using Singleton? Would you a...

W/o function pointers, what's a recommended way to implement Callback in Java - other than interfaces?

I have a couple of classes that want to pass each other some information and be called back later, using that information (Callback pattern). Within my application, this mechanism serves two purposes: scheduled / delayed execution asynchronous execution involving messaging My objects basically say to each other "when you're finished...

What is a better design?

I have a scenario at hand which has some design discussion going on. To break it down in simple words, think about a hierarchy as such Company -----> Customer ------> Orders (ignore the details of how the orders have products etc) if I was to expose an API to work with this, what would be a better design. a) Dim comp As New Company co...

How does FileSystemWatcher work on another computers directory?

Something intrigues me and I don't find any resource on this. How can FileSystemWatcher know when a file on a computer "A" is created/removed/changed/renamed ? I thought that this worked with polling, (the observer polls the server to check update), but after verifying the network activity with Wireshark I saw that polling was not use...

Books on Design Patterns and/or Algorithms?

Duplicate of: http://stackoverflow.com/questions/161288/what-would-be-the-best-book-to-read-in-order-to-really-grok-oop/161504 http://stackoverflow.com/questions/574001/what-books-do-you-suggest-for-understanding-object-oriented-programming-design-de/574619 http://stackoverflow.com/questions/455627/head-first-style-data-structures-alg...

Draft version of database table

I have a database with a report table. This table represents report data, and has constraints. Now the application is used by firemen, and they might have to run off and put out some fires. So in the middle of filling out data for this table, they might have to run off. What we do is when the session run out we save the data to a draft t...

What is the name of this factory type pattern and how do I represent it in UML?

Example: I have several types, e.g. Wheel, Brake, Engine, Clutch, AutoBox, ManualBox, ElectricWindow, RearParkingSensor, HeatedSeats. These will all inherit a ICarPart marker interface (could be an attribute (java annotation), but doesn't matter at this stage). I then write my Car class that can represent all car types, e.g. class Ca...

Design patterns used in Gmail's JavaScript?

Can anyone tell me what design patterns (if any) were used when building Gmail? I understand the concept behind it - queue up some requests, increment the bar when each completes, init the display when all are down - but I'm specifically interested whether there's a specific design pattern I can use to mimic the features. ...

Material on Software design and architecture

I am trying to compile a good library [within a company] on software design and architecture. I have looked at few posts on Stack Overflow, assuming this sort of question is very popular, however the best I found was Best books to learn about design, and it talks about graphic design, which is NOT particularly helpful to me. We are de...

Store pointers to member function in the map.

I'd like to map string to an instance member functions, and store each mapping in the map. What is the clean way of doing something like that? class MyClass { //........ virtual double GetX(); virtual double GetSomethingElse(); virtual double GetT(); virtual double GetRR(); //........ }; class Processor { private:...

Repository Pattern question - is it acceptable to use a repo inside of a different repository?

So I have a repository for basically each entity but my model has a relational division where entities aren't directly related in the model. So what I need to do is query off of that indirect relationship and return a collection of entities. Is it appropriate to initialize and invoke queries on a different repository from the one you are...