• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

which design pattren is best :

 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
samdeep aarzoo
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how can we widely categorized the different type of situation
to make a design pattern
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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?
 
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, there *are* some guidelines that can help you to choose between patterns. I'd highly recommend reading Fowler's "Refactoring" book.
 
Let's get him boys! We'll make him read this tiny ad!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic