views:

108

answers:

3

Hi,

I'm looking for an open source java application (C# application is also ok), to learn & understand good Object Oriented design.

Specifically, I'm looking for interactions with relational database, so that I can understand the finer details between converting an OO design to non-OO structure.

I had a look at some ORM samples. While they teach good OO design, there's too much magic happening, that hides lot of details on database interaction.

DO you have any suggestions?

+1  A: 

Dofactory design pattern shows good example of Object Oriented design : http://dofactory.com/Patterns/Patterns.aspx

tinmaru
+1  A: 

ORM's are just a mapping between database and code objects. If you set up and use one you'll "get a feel" for it, and it won't seem so "magical".

Here's a suggestion - set up a simple project using Hibernate, first with just a single table, then with a relational example (something that requires a join). Hibernate can be configured to log the queries as it runs, so you can see how it's translating.

Another option would be to run similar exercises with a few frameworks, e.g. rails activerecord( which is quite simple to set up).

after that, (maybe a bit advanced) try to write your own, maybe not something full-scale that handles many-to-many configurations, but just something that maps an API request to a generated database query, and creates an object from the output. This will definitely demystify the process.

Steve B.
A: 

See the Collections Framework

With some exceptions to the rule (the Stack implementation e.g.) it shows some real good examples of applied design patterns(Strategy, Iterator, etc.), encapsulation, algorithms, composition, code reuse etc.. Besides, it's a good start to teach yourself generics. Learned more about patterns and algorithms by reading it's sources than with any book.

Helper Method