Modeling[Task] Model "Superman". [Facts] * Superman is one of superhero. * Superheros fight against evil. * Hence, Superman fights against evil. In order to model "Superman", we will go through the basic three steps:
1. Understand all the factsIn order to understand the facts, you could first list all things described in the task description. Since this simple task only states "model superman", we will get more facts from the provided list.
From these facts, it seems that there are two simple themes:
2. Decide on a concept/viewpointFrom the fact that both superman and superheros fight against evils, "fighting against evil" is the common behaviour of superman and superhero. Furthermore, you would realize that the concept of superhero is a generalized concept, and "superman" is an example (instance) of superhero. Looks like one of important essences is: Superman is an instance of Superhero 3. ModelWe use the result ("Superman is an instance of Superhero") for deriving a model. First, we will try to model "superhero"
We can derive the following class (lefthand-side) and instance diagram (righthand-side). AlternativesAnother typical modelling of Superman with respect to Superhero would be to treat Superman as a specialized version of Superhero and to model Superman as a subclass of Superhero like: However, if this model is derived from the concept that Superman fights against evil in a different manner compared to other superheros, so it's better to have its own uniquefight(). You should think about which model would be better. |