3

I am looking for OpenSource Java Projects to study and understand how certain design patterns are applied in real world.

To that goal, Which are the best opensource projects to study applications of software design patterns?

phoenix24
  • 2,072
  • 2
  • 20
  • 24
  • Just pick a project you're interested in. – Mat Feb 07 '12 at 07:54
  • I've looked at a bunch of them, that I use at work. But was looking if there's general recommendation for a few. – phoenix24 Feb 07 '12 at 07:58
  • Most, if not all, applications implement design patterns. Some developers are not aware of that they are using patterns, others are. You should instead ask for a real world implementation of a pattern that you are interested in. Or even better: Describe a problem and ask how you can solve it better. – jgauffin Feb 07 '12 at 08:00
  • Please re-check the [FAQ] then. Recommendations are subjective, lead to list-of-stuff answers. Not a good fit here. – Mat Feb 07 '12 at 08:09

3 Answers3

4

To study design patterns I would recommend going first with the book Head First Design Patterns and try to build simple examples yourself. Once you do that you will start recognizing patters everywhere you look :). Once you know what they look like you can pick up any popular open source project and you will find ton of examples there.

Actually you don't even have to look much as there are many examples of design patterns in jdk you are using already: Examples of GoF Design Patterns in Java's core libraries

Community
  • 1
  • 1
Kris
  • 5,714
  • 2
  • 27
  • 47
3

In Spring Framework:

  • Factory pattern + Proxy pattern: org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean and friends
  • Observer pattern: org.springframework.context.ApplicationListener for example
  • Template method pattern: org.springframework.jdbc.core.JdbcTemplate (not sure)
  • Chain of responsibility: Spring Security filter chain impl. (http://static.springsource.org/spring-security/site/docs/3.0.x/reference/security-filter-chain.html) or EE's javax.servlet.Filter

I think Spring sources are clean, well commented and quite easy to read. Of course the whole framework is very complex but worth studying. Especially if you work with Spring on a daily basis.. :-)

jabal
  • 11,987
  • 12
  • 51
  • 99
0

I would look at Spring there are many examples of patterns and surely the best/worst example is the (infamous?) class AbstractSingletonProxyFactoryBean

blank
  • 17,852
  • 20
  • 105
  • 159