Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

View the above model through the prism of a sequence diagram


In this contrived model the channel object is interacting directly with the business objects (entity objects), sequencing their actions, linking and unlinking them to follow the flow of a use case or story.  This is a crazy approach because the next channel that wants to interact with the business objects would more than likely repeat the same pattern of behaviour, the only difference being the actual channel or means of communicating with the outside world.  On examination you would find that the pattern of behaviour doesn't actually change.

A better way to understand this model is to think of it in terms of UML use cases

...

A use case represents the sequence of interactions between the actor and the system to achieve a business goal.   NEED MORE INFO ON WHAT THIS MEANS

When we translate UML models to code, it is good practice to create a class for each use case.  We call these <<controllers>>.  They are essentially objects that coordinate business objects to achieve the business goal.  You might be wondering why is there a Calculate Pay but no Format Time.  Well, the whole purpose of the application is to calculate the correct pay (read  the initial requirements), the problem was that the time entries were in the wrong format, so formatting the time is not a business goal.  

...