Win a copy of Head First Android this week in the Android forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Why should I use design patterns ?

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why is J2EE so tied with design patterns ?
Thank you. Masters.
 
Ranch Hand
Posts: 8944
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://java.sun.com/blueprints/patterns/
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Why is J2EE so tied with design patterns?


J2EE is not "tied" with design patterns. Applying known design patterns just happens to be a best practice in the field of software engineering.
Sun has made noise about using design patterns with Java/J2EE for a long time while the Microsoft camp was relatively silent. Nevertheless, the Microsoft camp has been (hopefully) using design patterns as well.
 
Pradeep bhatt
Ranch Hand
Posts: 8944
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sun has made noise about using design patterns with Java/J2EE for a long time while the Microsoft camp was relatively silent.


There was a joke at www.theserverside.com where Microsoft says "J2EE needs design patterns because J2EE is bad".
 
Leonildo Campos
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hummm. I understood.
Design pattern is for world wide languages. Not for you-must-buy-my-license languages.
 
Pradeep bhatt
Ranch Hand
Posts: 8944
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Leonildo Campos:
Hummm. I understood.
Design pattern is for world wide languages. Not for you-must-buy-my-license languages.


The book GoF talks about general design patterns. Most of the J2EE design patterns are based on Gof like Session Facade.
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Leonildo Campos:
Why is J2EE so tied with design patterns?


I don't aggree that J2EE is tied with Design Patterns... but I do concede that Design Patterns are considered very important by many in the J2EE community (and in other communties as well). I think part of the reason for this is the scope and complexity of J2EE. There are many ways to accomplish the same task and more than enough rope to hang yourself with. For this reason, people in the J2EE community have come together and defined a set of best practices in terms of Design Patterns.
It always scares me to meet a "J2EE Architect" that doesn't have any knowledge the Design Patterns (in particular GoF and Core J2EE Patterns), he is doomed to make the same mistakes as those before him. J2EE is a tricky river to navigate; Design Patterns serve as our guide.
 
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
even if you dont use Design Patterns directly,you will find that you may be using them unknowingly.For eg keeping the database connection in a separate class file etc.
 
Pradeep bhatt
Ranch Hand
Posts: 8944
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Vedhas Pitkar:
Hi,
For eg keeping the database connection in a separate class file etc.



Can you tell me the name of the pattern?
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you referring to DAO?
 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Design patterns are the effective way of attacking problems. Design patterns evolved by the experience of the architects. Re-inventing the wheel is NOT the game redesigning is....Thus patterns provide an efficient way to solve a problem.
Cheers,
Gaya3
 
Leonildo Campos
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
Is the MVC2 a good design pattern for non-internet applications ? Why ?
 
Pradeep bhatt
Ranch Hand
Posts: 8944
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
MVC can be applied to any application that has user interface. The MVC pattern has its root in Smalltalk application. MVC acheives loose coupling among various components of an application.
Read more about MVC here
http://java.sun.com/blueprints/patterns/MVC-detailed.html

Originally posted by Leonildo Campos:
Hi all,
Is the MVC2 a good design pattern for non-internet applications ? Why ?

 
Vedhas Pitkar
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Lasse Koskela:
Are you referring to DAO?


Well,somewhat.Am I wrong,Pradeep,Lasse ?Keeping the database related stuff in one class file or related package,at least we are using it.
[ August 27, 2003: Message edited by: Vedhas Pitkar ]
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the MVC2 (or "Model 2") architecture was designed especially for J2EE applications so in that way it won't fit into non-internet applications. You could ofcourse use the architecture by "porting" the concepts into a Swing application, for example, but I don't know whether it would work in that environment.
 
Leonildo Campos
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you
Lasse Koskela and Pradeep Bhat
Do you know the best design pattern for wireless applications in PDAs ?
 
Chris Mathews
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Lasse Koskela:
I think the MVC2 (or "Model 2") architecture was designed especially for J2EE applications so in that way it won't fit into non-internet applications. You could ofcourse use the architecture by "porting" the concepts into a Swing application, for example, but I don't know whether it would work in that environment.


Actually, MVC has been around since the 70s and Smalltalk. It is very applicable to rich clients, actually it orignated in rich clients.
MVC2 (terrible name), as Lasse pointed out, was previously referred to as Model 2 by Sun. It is basically a MVC architecture which uses a Servlet as the Controller, Java classes or EJBs as the Model, and JSP or some other templating engine as the View. Struts and WebWork are two widely available examples of MVC2.
For more information on general MVC concerns (and other architectural patterns), I suggest: Patterns of Enterprise Application Architecture.
For more information on MVC in the context of J2EE, I suggest this week's promo book: Core J2EE Patterns: Best Practices and Design Strategies.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic