• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Learning OOP and UML

 
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What Peer said!
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Peer Reynders for valuable input.
 
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Buying in the store is cool because its easy to return. Just keep the book clean.
 
Ranch Hand
Posts: 2108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for sharing.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic