This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes OO, Patterns, UML and Refactoring and the fly likes which design pattren is best : Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "which design pattren is best :" Watch "which design pattren is best :" New topic
Author

which design pattren is best :

samdeep aarzoo
Ranch Hand

Joined: Jun 09, 2005
Posts: 160
hi

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
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
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
samdeep aarzoo
Ranch Hand

Joined: Jun 09, 2005
Posts: 160
how can we widely categorized the different type of situation
to make a design pattern
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
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?


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
sever oon
Ranch Hand

Joined: Feb 08, 2004
Posts: 268
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?
Thomas Taeger
Ranch Hand

Joined: Dec 16, 2002
Posts: 307
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.


www.classic-and-class.com - www.evalulearn.com
Interfaces are the glue of OO.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Well, there *are* some guidelines that can help you to choose between patterns. I'd highly recommend reading Fowler's "Refactoring" book.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: which design pattren is best :
 
Similar Threads
Pattern Question
Design Pattern Question
Must we use MVC ?
Difference b/w FrontController & MVC
MVC pattern turoail??