Page 146 -
P. 146

5.3   Structural models  129




                               Object-oriented requirements analysis

                        In object-oriented requirements analysis, you model real-world entities using object classes. You may create
                        different types of object model, showing how object classes are related to each other, how objects are
                        aggregated to form other objects, how objects interact with other objects, and so on. These each present
                        unique information about the system that is being specified.

                                            http://www.SoftwareEngineering-9.com/Web/OORA/


                                 5.3 Structural models



                                       Structural models of software display the organization of a system in terms of the
                                       components that make up that system and their relationships. Structural models may
                                       be static models, which show the structure of the system design or dynamic models,
                                       which show the organization of the system when it is executing. These are not the
                                       same things—the dynamic organization of a system as a set of interacting threads
                                       may be very different from a static model of the system components.
                                         You create structural models of a system when you are discussing and designing
                                       the system architecture. Architectural design is a particularly important topic in soft-
                                       ware engineering and UML component, package, and deployment diagrams may all
                                       be used when presenting architectural models. I cover different aspects of software
                                       architecture and architectural modeling in Chapters 6, 18, and 19. In this section, I
                                       focus on the use of class diagrams for modeling the static structure of the object
                                       classes in a software system.



                                5.3.1 Class diagrams
                                       Class diagrams are used when developing an object-oriented system model to show
                                       the classes in a system and the associations between these classes. Loosely, an object
                                       class can be thought of as a general definition of one kind of system object. An asso-
                                       ciation is a link between classes that indicates that there is a relationship between
                                       these classes. Consequently, each class may have to have some knowledge of its
                                       associated class.
                                         When you are developing models during the early stages of the software engi-
                                       neering process, objects represent something in the real world, such as a patient, a
                                       prescription, a doctor, etc. As an implementation is developed, you usually need to
                                       define additional implementation objects that are used to provide the required sys-
                                       tem functionality. Here, I focus on the modeling of real-world objects as part of the
                                       requirements or early software design processes.
                                         Class diagrams in the UML can be expressed at different levels of detail. When you
                                       are developing a model, the first stage is usually to look at the world, identify the
                                       essential objects, and represent these as classes. The simplest way of writing these is to
                                       write the class name in a box. You can also simply note the existence of an association
   141   142   143   144   145   146   147   148   149   150   151