-2

Consider struts + spring + jpa for these technology one decide that he need a service locator design pattern, sessionfacade and so on....

my question is where can i find or figure out the best design pattern that are used to develop projects?

like any forum where developer sharing there experience on how they faced problem while integrating some technologies and what design pattern they used to solve those issues

Rohan S Raju
  • 426
  • 3
  • 7
  • 20

3 Answers3

6

A short quote from Head First - Design Patterns:

Design patterns don't go directly into your code, they first go into your BRAIN. Once you've loaded your brain with a good working knowledge of patterns, you can start to apply them to your new designs, and rework your old code when you find it's degrading into an inflexible mess of jungle spaghetti code.

First look at the project, think of a top-level design that fits the real world requirements. Then (with your brain loaded with patterns) you'll see the patterns inside the design and will know which patterns to use.

Please, don't build your design around beautiful patterns. With one exception: The technology, you've mentioned, comes with some best practice patterns. You should know them and use them (most of them are build in the frameworks anyway and you can't avoid using them). For those you should know and use them, because others expect those patterns when the see a design based on spring, JPA, J2EE, ...

Andreas Dolk
  • 113,398
  • 19
  • 180
  • 268
  • (+1) this is the only valid gereral answer - even if there is a second point needs to be taken in accout: "How is it done by the other people which ueses this framworks" -- And that is what the question is about (in my opionion) – Ralph Jan 21 '11 at 12:10
  • @Ralph yes my question was ment like that "How is it done by the other people which uses this framworks" – Rohan S Raju Jan 21 '11 at 12:36
1

Applying design patterns is a question of personal experience, and to some extent style and preference too. It just takes practice to learn it, there are no fast lanes to the knowledge, sorry :-) Of course, books and stories from others are a good source of information - but only that. You need to learn how and when to apply all that information. The best learning experiences are one's own mistakes, so don't fear of making mistakes.

If you want to collect war stories though, you may want to ask this on programmers.stackexchange.com.

Péter Török
  • 114,404
  • 31
  • 268
  • 329
0

Patters for integration these technologies are well defined in tutorials and manuals. There is really no much space for big changes. Have a look at following links to get an understanding:

http://static.springsource.org/spring/docs/3.0.x/reference/orm.html

http://static.springsource.org/spring/docs/3.0.x/reference/web-integration.html#struts

As soon as you have done all integration using described techniques, you may play with it a little bit to make it more suitable specifically for your purposes.

These technologies their self are pushing to to use some set of patterns. Have a look at these questions for more details:

What design patterns are used in Spring framework?

Which pattern does Hibernate follow?

And as already mentioned, applying design patterns is a matter of experience and brain ;) It will just come sooner or later.

Community
  • 1
  • 1
Stas
  • 1,707
  • 15
  • 25