design-patterns

Asp.net DAL and BLL preferred design pattern approach

I am developing a couple of small ASP.NET application and would like to know what pattern. approach do you use in your projects. My projects involve databases, using Data access and Business logic layers. The data-access approach that I was using so far is the following(I read in some book and liked it): For DAL layer: Creating an...

What's a good approach for allowing users to define their own custom types?

Say you’re designing an application that, by requirement, allows a user the flexibility of creating custom types (for managing his data, whatever it may be). One way of handling this is to define a schema which allows us to use metadata for defining these types. This often means the resulting db schema will have some way of storing key...

How do you identify a design pattern when reading source code?

Is there way to better identify design pattern in source codes, esp. if you are not familiar with all of the patterns? What's the best way to identify them? ...

Is a generic model an antipattern?

Now I have something that I have not seen it before: the database is really generic. For example: instead of a concrete type we have a generic one: device, and it relates to a custom properties table. Unfortunatelly, the model over its entities represents those tables, so the model does not talk about the business at all. At the end p...

Any suggestion for doing an arbitrary operation using given arguments of arbitrary types?

Basically i just want to do an arbitrary operation using given arguments of arbitrary types. Argument type base class is Var, and Operation is base class of the operation that will executed for given arguments. I have Evaluator class, that hold a collection of operators which mapped using opId. Evaluator will do operation based on opId...

How to write a desktop application properly?

I am a web and mobile application developer and I prefer to use MVC frameworks for development. I have just started to a desktop application (in C#). Application development is not a problem. I had written various desktop application before but they were for personal use or for small companies. Is there a good open source project that I...

What's the name of this java design pattern?

Hi guys, Say I have a GUI Java project of something that simulates an ATM machine, and i have classes such as : - RegisterWindow - LoginWindow - MainAccountOptionsWindow etc, where all the classes are focused around the panels/windows rather than normal OO design. Someone told me that this is a specific design pattern, maybe somet...

JAXB together with Builder Pattern. Is that possible?

Hi. I was wondering if anybody knows how I can use JAXB together with the Builder Pattern? The builder pattern wants you to set the constructor as private, and JAXB says "1 counts of IllegalAnnotationExceptions myClass does not have a no-arg default constructor" Is there somehow I can tell JAXB that I don't want no-arg default constru...

Iterating over a list of types

I find myself doing this sort of thing from time to time, and I wonder if it's a design smell, or if there's a better design pattern I can use. There's a process with a number of steps that is known at compile time, but is likely to change down the road. I capture the commonality in an abstract Step class, write a StepLister that return...

Cleanest RESTful design for purely "action" calls?

Hello all, I am sticking my toe in the RESTful waters and I just can't find a "satisfactory" solution to how to handle truely "action" oriented calls on a RESTful service? My quandry can be broken down into two parts. 1) Transactional calls: I understand the idea of having an ActionTransactor that you get a resource too with a post...

What is the most underused or underappreciated design pattern?

I have been reading a lot on design patterns lately and some of them can make our lives much easier and some of them seem to just complicate things (at least to me they do). I am curious to know what design patterns everyone sees as underunsed or underappreciated. Some patterns are simple and many people do not even realize they are usin...

Application Engineering and Number of Users

Apart from performance concerns, should web-based applications be built differently according to the number of (concurrent) users? If so, what are the main differences for (say) 4, 40, 400 and 4000 users? I'm particularly interested in how logging, error handling, design patterns etc. would be be used according to the number of concurre...

Real world examples of Factory Method pattern

I just read Factory Method. I understand that it provides a way to delegate the instantiation to sub-classes. But I couldn't understand the possible uses in a real-world scenario. Can anyone give one typical example showing how Factory method pattern can be used so that I can relate to what I have read. A problem statement for which fa...

Class structure for an inventory control system

As an exercise in good OO methods and design, I want to know what is a good way to model inventory control in a company. The problem description is a. A company can have different types of items, like documents (both electronic and physical), computers etc which may further have their own sub types. b. The items can be kept in a...

Simplified Singleton pattern in Java

The default way to implement singleton patter is: class MyClass { private static MyClass instance; public static MyClass getInstance() { if (instance == null) { instance = new MyClass(); } return instance; } } In an old project, I've tried to simplify the things writing: class MyClass { private static final ...

Strategy Design pattern with IOC containers - Ninject specifically.

I have a class which is going to need to use the strategy design pattern. At run time I am required to switch different algorithms in and out to see the effects on the performance of the application. The class in question currently takes four parameters in the constructor, each representing an algorithm. How using Ninject (or a general...

Is tagging is the best user friendly way to categorize a subject?

Is tagging is the best user friendly way to categorize a subject? An example would be the tags mechanism used in this Q/A site /* forum */. (StackOverflow.com). How you would Implement categories in a best user friendly way? Or hierarchical categories are the best user friendly way to present available categories? Is there any online s...

Is it a good idea to use CodeIgniters Active Record library to manipulate MySQL databases or should I just use SQL?

I'm starting to get to grips with CodeIgniter and came across it's support for the Active Record pattern. I like the fact that it generates the SQL code for you so essentially you can retrieve, update and insert data in to a database without tying your application to a specific database engine. It makes simple queries very simple but ...

Most Important and frequently used design patterns

Hi I am currently reading head first design patterns book. I feel that the best way to learn design patters is to apply them. So, I wanted to know the most frequently used design patterns, so that I can experiment with them and apply them in the example programs I write. Which are the most important and useful design patterns you use ...

Recommended Web Service Architecture Books/Sites?

I'm in the position where I may be creating a new web service from scratch - without much pre-existing infrastructure to have to contend with. What resources are there that talk about the architectural aspects of deploying a web service? [Clarification: I'm not talking about an Enterprise SOA orientation here - rather setting up one fam...