6/8/07

My recipe for OOAD with UML


How do you go from requirements to coding?
Everybody has different alternatives. Working on my SCEA assignment, I'm using OOAD with UML.
I choose to have an intermediate point: I'm not formally doing the OOA first (only in my head) and the OOD doesn't have much detail.
Ingredients:
  • Enough Use cases
  • A Busines domain model (small)
  • Some Aditional requirements
  • Pen and paper (could be relpaced with a whiteboard)
  • A working brain (hard to find, I usually manage without it ;-) )
  • Plenty of coffee
  • A beer

Read the use cases and requirements, stir that in your head for a while Get a piece of paper and draw the "map of the world" (existing components, outside systems, etc) to give your brain something to think about.
Create a very basic class diagram based on the domain model
Select one of most the complex use case and create a sequence diagram for it:
  • Put the actors involved
  • Choose the interface/style required to interact with them (web, Thick client, Messaging, etc.)
  • Use the identified objects from the class diagram to fulfill the requirements from the use case
  • Each object will have their responsibilities in the use case context.
  • You will need to add more objects and/or split existing ones to better distribute those responsibilities
  • Drink a cup of coffee
  • Write your assumptions
Once you fulfilled the requirements of the use case, let the sequence diagram cool for a while.
Dump all the classes you identified in the class diagram and mix them with the existing ones.
Think how you can better organize it (if smells like refactoring, you’re good, but don’t expect any “code smell” we’re far from the code). Once you’re satisfied with the result, go back to the sequence diagram and adjust it so it conforms to the new class structure. If your class diagram grows too big (maybe # of classes >7+-2) organize it in layers: put one layer of services classes, one layer of domain classes, one layer of application classes, etc.
Once the class diagram is ready, group those classes in components of the component diagram (you can add lollipop notation for the interfaces, is a nice touch)
Rinse and repeat for the other use cases.
When you’re done, you can serve the components inside deployment units in a big deployment diagram.
Now you can take a break and drink the beer!

DISCLAIMER: as with most recipes, the real process is completely different

5 comments:

Niranjan Deshpande said...

Man...great...! You have matured in the software industry...

Unknown said...

Not sure if maturing in the software industry is a good thing but I don't believe I've matured ;-)
Let me know how it goes if you ever try the "recipe"

BTW, Welcome to my blog, Niranjan

Devender said...

Looks yummy. I will try this recipe. Thanks.

capuccino said...

Hi Grabriel! I have passed on the SCEA 5.0 Beta first part. Now I have received my assignment, but I am little loose. Do I need to extend the domain model the way I think is better? I mean, can I change the relationship between the classes, add more classes...

Could you help me?

Thanks,

Leonardo Marcelino
leonardo.marcelino@gmail.com

Unknown said...

Congratulations for passing the first part and good luck on the second part!
My first thought is: as long as you explain why you think your model is better, go ahead.
For any project, the business domain model is a starting point, it will get refined as you learn more about the domain and the best way to map it in your system. For sure you will need to add more classes. A domain model should be easily used to fulfill the functional requirements without significant changes. I can think a major "driving force" for departing from a domain model comes from the non-functional requirements (performance, scalability, etc)