OO domain models for several industries

I am about to start to publish OO domain models of some industries. The first model that publish is within healthcare and could be named as Heal Centre. The model will cover a group of doctors have reception. The model dynamic starts from a patient need for a doctor’s reception and it end at diagnosis, a treatment plan and possible recopies for medical treatment.

When I publish this kind of model, then it will contain the following parts:

  1. class diagram of the domain
  2. one to some collaboration diagrams describing the most essential business logic.
  3. PowerPoint animation presentation for each collaboration diagram to easy the reading of those.
  4. The abstraction level of this model is high and for instance the attributes in the classes is only a small portion of the required when implementing of any application that uses this domain.
  5. During a possible implementation the abstract analysis model should incrementally expanded to include all the necessary attributes. In most cases very few new classes are needed in this phase.

In this post I am not yet publishing the Heat Care (or any other real) model. Here I only give the form of the publication and the reasoning behind it.

I will publish here a very small toy (or tutorial) model called a BookShop to give you an example of everything that I described above.

The business that we look at here is a small bookshop in a centre of a city. The following is deliberately highly abstract model to emphasize the difference between the reality and the model. In the shop the books on the selves actually represent a publication than a copy. So our models don’t have these copies as objects in the model at all.

This way one can think that the copies represent a catalog. This way it is rather easy to sift from a real shop to internet shop. The model has first event called walk. This is the even where a person enters the shop and stars to walk around. During the walk the person pick up interesting book. This set of books are the candidates for purchase.

I use Peter Coad’s color coding. This will make it a lot easier to read. The colors are: Entity-classes green; Role-classes yellow; Description-classes blue and Event-classes pink.

Here is a collaboration diagram on what I described above.

If you have a need for a model on a specific domain then send me a proposal and let’s see can I do it for you.

http://personal.inet.fi/cool/jukkatamminen/OOstaf/webKauppAnim.ppt

http://personal.inet.fi/cool/jukkatamminen/OOstaf/BookShopUML.uml

Advertisements

6 Responses

  1. Very nice initiative and a good complement for the free library of data models (http://databaseanswers.org/data_models/index.htm) that only provides the static view of the modeled domains.

    What I’m not so sure about is your choice of using Coad’s color schema for the models. As discussed here: http://modeling-languages.com/blog/content/coloring-models
    I think it is more useful to use colors to quickly identify different subsystems (or “packages”) in the domain.

    • Hi

      About the usage of colors.

      I have developed more that 100 domain models during that last ten year. Some of the (perhaps 4 – 6 ) have be quite large containing 50 – 100 classes in one diagram. I like my Coad colouring and I find I extremely helpful. This depends partly on the purpose and the phase where the model is.

      My intention is to increase the conceptual cognitive navigation through the model. Especially the importance of moment-event classes can be highlighted

      My domain models are always part of 3-tier architecture and these models describes the whole business model. The subsystem layer depends on the choice of subsystems. This comes later in time. I think that the domain (also the implementation) should not be aware of the application usage of them at all. So the dependency is completely one directional only from application into the domain.

      By the way class diagram without behaviour (methods & collaboration) is just a disguised ER (entity-relation) model not an object model at all!

      Thank for your comments. I appreciate them!

      • My choice of the word “subsystem” was not the most appropriate one, I was not referring to technical subsystems but to “subdomains”. A large domain can be partition in different subdomains, each one grouping a set of entities strongly semantically related.

        To me it is useful to use colors to identify these different subdomains (with the additional benefit than these it is also easy to see the entities that connect two different subdomains)

      • Well said, it’s a sort of hexagonal architecture. I’m reading Analysis Patterns by Fowler, which is cited in the original DDD book, but I’m not sure he includes in the model also services, unfortunately.

  2. I am looking at modeling as representation of the business system / proess without considering how to program.

    With that background, it is understandable that Person and Book are modeled as objects but Walk and Purchase are activities or operations performed by some LIVE entity or object. Is it not simpler to model them as operations of relevant object (say the Person here)?. Is “buy” the same as “purchase”? What is the difference? Is it not simpler to represent operations of operations as arguments / parameters of messages?

    It is imaginative to add Operations to Book but it is passive and is not capable of action. How are operations added to it? It is OK to do it but what Operation can be added for what purpose?

    • Here are several points. The first thing is about objects. Fundamental to object- orientation is that the domain contains only objects nothing else ( just like material in universe consist of atoms). Every object is an agent and it behaves! In the OO abstraction there is no room for anything that you call passive. The fundamental thing is that the only way that you can get any information from an object system is to send a message to some of its members. In this way if you want to know how many pages there are in a book, the only way to get this information is to send an object called a book a message “how many pages you have?” and the book answers so in the abstract world the book is NOT passive but is able to act. You can thing of this that an “old” book (that has bound from paper pages) is not in realty able to “answer” but if you don’t bind yourself to that “implementation of book” but consider a “Kindle book” the it is quite obvious that this electronic book can easily answer this question. Of course one need some amount imagination here, but it a part of human behavior to be able to think abstract things. I take and other example from mathematics. There is no such thing as real numbers or natural number or a geometric triangle -all that is just our imagination but still we have developed quite extensive mathematics around these concepts.

      Jim Rumbaugh wrote a column in JOOP somewhere late 90’s. It was named Objectified Events. The business events are important elements within the structural web of objects. We can manage with out them and in this case these event “are move to methods in entity or role object”. If we want to preserve something about the event it self or we need association to that even then we must objectify this even. For example in an airline company, where a flight event is extremely central thing, so if one wants to associate passenger to participate a flight we need the fligth-event-object to bee able to express this aspect in the class diagram!

      An other example about the purchase (or what ever you want to call that) is the time ( date & time) and the price or discount. These are the attributes of the purchase object! I would like to you where you would place these attribute if there where no purchase object and where would you place a method of getDiscountProsentage() ?

      In this analysis it is decided that buy() is the activity that a walk-object can. When walk perform this it starts with creating a new purchase object and sets it attributes and then it changes its own state to “over”. So to answer your question are purchase and buy the same is that they definitively are not, they are fundamentally different: one is an action in one class and and the other is a class!

      Jukka Tamminen

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: