File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes OO, Patterns, UML and Refactoring and the fly likes Learning OOP and UML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Learning OOP and UML" Watch "Learning OOP and UML" New topic
Author

Learning OOP and UML

Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
I have 4+ years of experience in Java. But I never got a change work where system are designed using purely OOP concept and represented using UML.

I want to start �learning� OOP way of designing and UML way of representing the design.

How do I start? What are your recommendations for book?


My blood is tested +ve for Java.
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2906
On the top of the recommended list around here is:
Agile Software Development, Principles, Patterns and Practices (amazon US).

You may find it a bit short in the UML Department (something that Agile Principles, Patterns, and Practices in C# (amazon US) supposedly addresses), so it might be a good idea to get UML Distilled: A Brief Guide to the Standard Object Modeling Language, 3rd Edition (amazon US) too.

Some people also like Design Patterns Explained: A New Perspective on Object-Oriented Design, 2nd Edition (amazon US) or Head First OOA&D (amazon US).

Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative Development (3rd Edition) (home; amazon US) is more focused on UML and process.

Whatever you choose you should probably add these two to the list:
Refactoring: Improving the Design of Existing Code (home; amazon US)
Working Effectively with Legacy Code (sample; amazon US)

Now if you are talking about designing a Domain Object Model then you have to turn to Domain Driven Design � Tackling Complexity in the Heart of Software (home; amazon US) which I would consider a more advanced book which keeps the discussion on a higher level (You can get a primer in exchange for your eMail address at Domain Driven Design Quickly). Applying Domain Driven Design and Patterns (amazon US) is more accessible but then you have to put up with .NET as the sample platform.
[ May 02, 2007: Message edited by: Peer Reynders ]

"Don't succumb to the false authority of a tool or model. There is no substitute for thinking."
Andy Hunt, Pragmatic Thinking & Learning: Refactor Your Wetware p.41
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
What Peer said!


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
Thanks Peer Reynders for valuable input.
Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401
Do any of these UML books cover Event based programming?

I write a lot of JavaScript and want to diagram things like bubbling, subscribing, unsubscribing, notifications, callbacks, both client side and remote (AJAX type).

People do Observer different in javascript. the callback is not an object that has notify(), but instead a function reference. I need to figure out how to UML that.


comp.lang.javascript FAQ: http://jibbering.com/faq/
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2906
If you are talking about this kind of construct...

... then that isn't the observer pattern. Within the observer pattern the subject is capable of registering and notifying multiple observers - not just one. See: Observer Design Pattern Using JavaScript.

The above construct actually leans heavily on the command pattern. That function is actually a function object which is pretty close to a command object - the function object simply has the freedom to call its execute method whatever it wants to. The semantics dictate that the function object can only have one method - that is the function object's execute method. So rather than having a generic object implementing an explicit interface that has an execute method, in JavaScript function objects automatically satisfy an implicit interface by "identifying" the method. Conventions within the language then allow for event (properties) to reference (function) objects that "implement" that implicit interface � i.e. when you are fired, invoke my execute method.
Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401
That's not what I'm talking about.

A good library will let you do something like:


Head First book has a lot of errors, at first glance. It struggles to explain what seems to me to be simple concepts. Not bad, but I lose confidence when I see careless errors in the example code.

Checking out the UML Distilled book. It is very small. Fowler is great. I'm optimistic.

Could not find "Agile Software Development, Principles, Patterns and Practices" at Borders! They shipped it back due to poor sales. I guess the type of books people want is along the lines of "Be an [insert buzzword here, e.g. AJAX] master in 24 hours"
[ May 07, 2007: Message edited by: Garrett Smith ]
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2906

Great - however this is still exploiting the "implicit interface" exposed by a function object. So while there is no explicit observer interface with an explicit notify operation, the principal operation on a function object still serves the same purpose. If pressed you could simply declare an EventHandler marker interface (i.e. no operations) in your model. To communicate the intent of using a function object as an EventHandler simply have it realize the EventHandler interface. Then your subscribe operation can accept an EventHandler parameter. In sequence and collaboration diagrams you simply call the function object's principal operation.
(Personally I would probably still put a notify or some such operation on the EventHandler interface � then create an �Event Handler� stereotype with the declaration that �Event Handler� classes map the notify to their principal operation).

Though you really have to ask yourself whether you want to model to that level of detail (Agile Modeling Practices).

Apparently there is WAE-UML (Web Application Extension-UML) which is described in:
Building Web Applications with UML, 2nd Edition (amazon US)
Modeling Web Application Design with UML (White Paper)
Not sure how useful it would be (it's potentially dated).

I can't remember the last time I purchased a book in a brick-and-mortar store. As I mentioned before, there is an updated version (July 2006) available if you don't mind C# and .NET: Agile Principles, Patterns, and Practices in C# (amazon US)
[ May 08, 2007: Message edited by: Peer Reynders ]
Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401
Buying in the store is cool because its easy to return. Just keep the book clean.
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2046
Peer,

Thats a nice list of books.

I understand that OO design skills is gained by experience. Which books among them has more on examples, or those that will involve the reader?
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2906
My guess is that Agile Software Development, Principles, Patterns and Practices (amazon US) is a favorite because is has a good balance. Enough code examples to have you working along but not so much that you will be missing the forest for the trees. UML is only used to model the "interesting bits" and where the code clutter might get in the way of clarity. Also the primary focus is on Object-Oriented Design principles; Patterns come in second - emerging from the OO design principles if you will.


Larman's Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative Development (3rd Edition) (home; amazon US) has more focus on the "communication of design" - so there is less code and a lot more UML than in Martin's book. The "examples" originate mostly from the case study of the development of a point of sale (POS) product.


More advanced books like Domain Driven Design � Tackling Complexity in the Heart of Software (home; amazon US) require you to operate on a somewhat more abstract (visual***?) level - so you are going to see fewer code examples and more diagrams. However once you have solid OO foundation it is a worthwhile read. It's where I first encountered the Specification Pattern (PDF) (and you thought you needed a rules engine); it introduces many other worthwhile concepts like aggregates (cluster of associated objects treated as a unit for data changes), domain object repositories, anti-corruption layers, etc. Having Patterns of Enterprise Application Architecture (amazon US; EAA Catalog) by your side is probably necessary as the are a lot of cross-references to it.

***At this point you are sketching your initial designs in your head with barebones UML rather than lines of pseudo code.
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2046
Thanks for sharing.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Learning OOP and UML
 
Similar Threads
beginner
ooad,uml,oose,OMT
Rating of Java Books
Java Architect or Developer
UML book query