7

What open source Java code would you suggest for me to study?

EDIT: I'm interested in the design, simplicity(?), their programming style, logic.

EDIT2: The first thing that came to my mind is JUnit source code. I started looking into it and I was impressed by how 'Money' is designed/represented. Similarly are there any suggestible open-source projects.

Walter
  • 16,136
  • 8
  • 59
  • 95

5 Answers5

4

I suggest you pickup a good design book instead. Professional code usually does not explain important details such as "this is a factory pattern.". It also often contains loosely implemented patterns (if any) and custom requirements.

Design patterns are just far too complex to just figure it out on your own. It took the Gang of Four years to lay out the fundamentals. So its better to learn to do it correctly then see what others are doing.

Head first design patterns is a solid Java dp book.

Design and simplicity do not necessarily go hand in hand. Good design is heavily focused on proven use cases for a particular pattern. Not that the pattern is simple per-se, but that it works. Simplicity is as much an art as a science. It also requires a good understanding of the business requirements, framework and the customer. Keeping it simple takes years of practice. Even then time limits and reality plays a huge role in what's possible. Remember the triangle.

P.Brian.Mackey
  • 11,121
  • 8
  • 53
  • 88
0

I would suggest you this tutorial - http://www.macs.hw.ac.uk/guidebook/?name=Using%20The%20GUI&page=1. It would be difficult to study the source code without explanations.

bancer
  • 361
0

If your already with a software development company you may be in a better position to accomplish this due to being able to ask for help from various mentors within the organization, but don't be afraid of jumping in to source code regardless of career choice if you want to study it.

Studying with a mentor is ideal but not always possible, one way of looking for a mentor if you don't work for a development organization is through OpenHatch.org. If you get stuck and something doesnt make sense, ask for help or clarification from the original developer or from the FOSS community at large.

For a list of some projects you can freely study, you could check out github and search for "language: java" to find all projects in Java. https://github.com/languages/Java

Jeff Welling
  • 1,279
0

Look at Spring Framework's code. It is neatly designed and well documented.

To improve your design skills, step into eclipse plug-in development.This is the best place to learn design patterns and put into practice.

Adisesha
  • 101
  • 2
0

One great project to study if you really want to dive into code is JHotDraw. It's an open source graphics framework written in Java as a demonstration of how design patterns can be used in practice. A member of the GOF (Erich Gamma) is one of the authors of the framework. The main page is at http://www.jhotdraw.org/ (includes links to the source code).

Deckard
  • 3,427