can anybody tell me which object oriented design pattern should we use. which design pattren is best : i know that much about design pattern about MVC : model view controller here controller is servlet: model is java bean : view is jsp i recently read first two chapter of famous book design pattern by grady booch: FOR any design which core framework we have to keep in consideration
A design pattern is a known-to-work solution for a rather specific design problem. There is no *best* design pattern, just differently appropriate design patterns for different situations.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Joined: Jun 09, 2005
how can we widely categorized the different type of situation to make a design pattern
Originally posted by sandeep mittal: how can we widely categorized the different type of situation to make a design pattern
Patterns are not made nor invented. Patterns are observed. I'm afraid that you're trying to force a design pattern where a pattern doesn't exist. Could you perhaps tell us more about the motivation and rationale for what you want to accomplish?
You seem to be confusing a "component object model" with a "design pattern". MVC is a component object model. It takes one logical object and splits it up into three physical objects (model, view, and controller). The point is to separate out three different kinds of logic into three physically distinct places. EJB is another instance of a component object model...the point of this one is to split up remote API from location/creation logic from the remotely performed business logic. You can think of a component object model as being a way of "projecting" a single object onto a set of orthogonal axes...breaking it down into parts that can operate independently from one another.
A design pattern is NOT a component object model. A design pattern is a collaboration of different objects intended to solve a particular kind of problem. As such, the "best" design pattern depends on the problem you're trying to solve. The book by the Gang of Four called Design Patterns details these problems and their associated patterns at length--you might want to poke through it for ideas.
Your question is sort of like asking, which is better, a hammer or a screwdriver? It depends...are you trying to put in a nail or a screw?
Originally posted by sandeep mittal: how can we widely categorize the different type of situation to make a design pattern
If your question is in which situation to _use_ (not make) which design pattern, then I totally agree with you that a) this question can hardly be learned "in a Sun course 500" but instead b) first has to be self-studied, maybe following Sun's very good book "J2EE Design Patterns" and then b) for real-life problems comparing similar patterns again and again.
In the same book you find one page that might be most helpfull for your first categorazation: the diagram showing the J2EE patterns relationships, devided into three groups: first group for Presentation Tier, second for Business Tier and third group for Integration (Data Access) Tier. Each group / tier has its own design patterns. Exercise it for some hours, but based on a real (or imagined concrete) problem.
Sadly there is no decision table showing which patterns to use when, neigther in the book nor on the job. Thomas.