Bài giảng Systems Analysis and Design - Chapter 18: Object-Oriented Systems Analysis and Design Using UML

The analyst will initially use the UML toolset to break down the system requirements into a use case model and an object model. The use case model describes the use cases and actors. The object model describes the objects and object associations, and the responsibilities, collaborators, and attributes of the objects. “Putting a project on paper before coding will wind up costing less in the long run. It’s much cheaper to erase a diagram than it is to change coding.”

ppt75 trang | Chia sẻ: vutrong32 | Lượt xem: 1063 | Lượt tải: 0download
Bạn đang xem nội dung tài liệu Bài giảng Systems Analysis and Design - Chapter 18: Object-Oriented Systems Analysis and Design Using UML, để tải tài liệu về máy bạn click vào nút DOWNLOAD ở trên
Object-Oriented Systems Analysis and Design Using UMLSystems Analysis and Design, 7eKendall & Kendall18© 2008 Pearson Prentice HallLearning ObjectivesUnderstand what object-oriented systems analysis and design is and appreciate its usefulnessComprehend the concepts of unified modeling language (UML), the standard approach for modeling a system in the object-oriented worldApply the steps used in UML to break down the system into a use case model and then a class modelDiagram systems with the UML toolset so they can be described and properly designedDocument and communicate the newly modeled object-oriented system to users and other analysts2Object-Oriented Analysis and DesignWorks well in situations where complicated systems are undergoing continuous maintenance, adaptation, and designObjects, classes and reusableThe Unified Modeling Language (UML) is an industry standard for modeling object-oriented systems3Object-Oriented Analysis and Design (Continued)ReusabilityRecycling of program parts should reduce the costs of development in computer-based systemsMaintaining systemsMaking a change in one object has a minimal impact on other objects4Major TopicsObject-oriented conceptsCRC Cards and object thinkUnified Modeling LanguageUse case and other UML diagramsPackagesUsing UML5Object-Oriented ConceptsObjectsClassesInheritance6ObjectsPersons, places, or things that are relevant to the system being analyzedMay be customers, items, orders and so onMay be GUI displays or text areas on a display7ClassesDefines the set of shared attributes and behaviors found in each object in the classShould have a name that differentiates it from all other classesInstantiate is when an object is created from a classAn attributes describes some property that is possessed by all objects of the classA method is an action that can be requested from any object of the class8Figure 18.1 An example of a UML class. A class is depicted as a rectangle consisting of the class name, attributes, and methods9InheritanceWhen a derived class inherits all the attributes and behaviors of the base classReduces programming labor by using common objects easilyA feature only found in object-oriented systems10Figure 18.2 A class diagram showing inheritance. Car and truck are specific examples of vehicles and inherit the characteristics of the more general class vehicle11CRC Cards and Object ThinkCRCClass ResponsibilitiesCollaborators CRC cards are used to represent the responsibilities of classes and the interaction between the classes12Figure 18.3 Four CRC cards for course offerings show how analysts fill in the details for classes, responsibilities, and collaborators, as well as for object think statements and property names13Interacting during a CRC SessionIdentify all the classes you canCreating scenarios Identify and refine responsibilities14The Unified Modeling Language (UML) Concepts and DiagramsThingsRelationshipsDiagrams15ThingsStructural things are Classes, interfaces, use cases, and other elements that provide a way to create models They allow the user to describe relationshipsBehavioral things Describe how things workInteractions and state machinesGroup thingsUsed to define boundariesAnnotational thingsCan add notes to the diagrams16RelationshipsStructural relationships Tie things together in structural diagramsBehavioral relationshipUsed in behavioral diagrams17Structural RelationshipsDependenciesAggregationsAssociationsGeneralizations18Behavioral RelationshipsCommunicatesIncludesExtendsGeneralizes19DiagramsStructural diagramsUsed to describe the relation between classesBehavior diagramsUsed to describe the interaction between people (actors) and a use case (how the actors use the system)20Structural DiagramsClass diagramsObject diagramsComponent diagramsDeployment diagrams21Behavioral DiagramsUse case diagramsSequence diagramsCollaboration diagramsStatechart diagramsActivity diagrams22Figure 18.4 An overall view of UML and its components: Things, Relationships, and Diagrams23Commonly Used UML DiagramsUse case diagramDescribing how the system is usedThe starting point for UML modelingUse case scenarioA verbal articulation of exceptions to the main behavior described by the primary use caseActivity diagramIllustrates the overall flow of activities24Commonly Used UML Diagrams (Continued)Sequence diagramsShow the sequence of activities and class relationshipsClass diagramsShow classes and relationshipsStatechart diagramsShow the state transitions25Figure 18.5 An overview of UML diagrams showing how each diagram leads to the development of other UML diagrams26Use Case ModelingDescribes what the system does, without describing how the system does itBased on the interactions and relationships of individual use casesUse case describesActorEventUse case27Figure 18.6 A use case example of student enrollment28Figure 18.7 A use case scenario is divided into three sections: identification and initiation, steps performed, and conditions, assumptions, and questions29Activity DiagramsShow the sequence of activities in a process, including sequential and parallel activities, and decisions that are madeSymbols Rectangle with rounded endsArrowDiamondLong, flat rectangleFilled-in circleBlack circle surrounded by a white circleSwimlanes30Figure 18.8 Specialized symbols are used to draw an activity diagram31Creating Activity DiagramsCreated by asking what happens first, what happens second, and so onMust determine what activities are done in sequence or in parallelThe sequence of activities can be determined from physical data flow diagramsCan be created by examining all the scenarios for a use case32SwimlanesUseful to show how the data must be transmitted or convertedHelp to divide up the tasks in a teamMakes the activity diagram one that people want to use to communicate with others33Figure 18.9 This activity diagram shows three swimlanes: Client Web Page, Web Server, and Mainframe34Sequence DiagramsIllustrate a succession of interactions between classes or object instances over timeOften used to show the processing described in use case scenariosUsed to show the overall pattern of the activities or interactions in a use case35Figure 18.10 Specialized symbols used to draw a Sequence Diagram36Figure 18.11 A sequence diagram for student admission. Sequence diagrams emphasize the time ordering of messages37Communication DiagramsDescribes the interactions of two or more things in the system that perform a behavior that is more than any one of the things can do aloneShows the same information as a sequence diagram, but may be more difficult to readEmphasizes the organization of objectsMade up of objects, communication links, and the messages that can be passed along those links38Figure 18.12 A Communication Diagram for student admission. Communication diagrams show the same information that is depicted in a sequence diagram but emphasize the organization of objects rather than the time ordering39Class DiagramsShow the static features of the system and do not represent any particular processingShows the nature of the relationships between classesShows data storage requirements as well as processing requirements40Class Diagrams (Continued)ClassesAttributesPrivatePublicProtectedMethodsStandardCustom41Figure 18.13 A class diagram for course offerings. The filled-in diamonds show aggregation and the empty diamond shows a whole-part relationship42Method OverloadingIncluding the same method (or operation) several times in a classThe same method may be defined more than once in a given class, as long as the parameters sent as part of the message are different43Types of ClassesEntity classesInterface classesAbstract classesControl classes44Entity ClassesRepresent real-world itemsThe entities represented on an entity-relationship diagram45Interface or Boundary ClassesProvide a means for users to work with the systemHuman interfaces may be a display, window, Web form, dialogue box, touch-tone telephone, or other way for users to interact with the systemSystem interfaces involve sending data to or receiving data from other46Abstract ClassesLinked to concrete classes in a generalization/specialization relationshipCannot be directly instantiated47Control ClassesUsed to control the flow of activitiesMany small control classes can be used to achieve classes that are reusable48Defining Messages and MethodsEach message may be defined using a notation similar to that described for the data dictionaryThe methods may have logic defined using structured English, a decision table, or a decision tree49Figure 18.15 A Sequence Diagram for using two Web pages: one for student information, one for course information50RelationshipsThe connections between classesAssociationsWhole/part 51Figure 18.18 An example of an associative class in which a particular section defines the relationship between a student and a course52AssociationsThe simplest type of relationshipAssociation classes are those that are used to break up a many-to-many association between classesAn object in a class may have a relationship to other objects in the same class, called a reflexive association53Whole/Part RelationshipsWhen one class represents the whole object, and other classes represent partsCategoriesAggregationCollectionComposition54AggregationA “has a” relationshipProvides a means of showing that the whole object is composed of the sum of its parts55CollectionConsists of a whole and its membersMembers may change, but the whole retains its identityA weak association56CompositionThe whole has a responsibility for the parts, and is a stronger relationshipIf the whole is deleted, all parts are deleted57Figure 18.19 An example of whole-part and aggregation relationships58Generalization/Specialization DiagramsGeneralizationInheritancePolymorphismAbstract classesMessages59GeneralizationDescribes a relationship between a general kind of thing and a more specific kind of thingDescribed as an “is a” relationshipUsed for modeling class inheritance and specializationGeneral class is a parent, base, or superclassSpecialized class is a child, derived, or subclass60InheritanceHelps to foster reuseHelps to maintain existing program code61PolymorphismThe capability of an object-oriented program to have several versions of the same method with the same name within a superclass/subclass relationshipThe subclass method overrides the superclass methodWhen attributes or methods are defined more than once, the most specific one is used62Abstract ClassesAbstract classes are general classesNo direct objects or class instances, and is only used in conjunction with specialized classesUsually have attributes and may have a few methods63Figure 18.20 A gen/spec diagram is a refined form of a class diagram64Finding ClassesDuring interviewing or JAD sessionsDuring facilitated team sessionsDuring brainstorming sessionsAnalyzing documents and memosExamining use cases, looking for nouns65Determining Class MethodsStandard methodsExamine a CRUD matrix66MessagesUsed to send information by an object in one class to an object in another class Acts as a command, telling the receiving class to do somethingConsists of the name of the method in the receiving class, as well as the attributes that are passed with the method nameMay be thought of as an output or an input67Statechart DiagramsUsed to examine the different states that an object may haveCreated for a single classObjects are created, go through changes, and are deleted or removedObjectsStatesEventsSignals or asynchronous messagesSynchronousTemporal events68Statechart Diagrams (Continued)Created whenA class has a complex life cycleAn instance of a class may update its attributes in a number of ways through the life cycleA class has an operational life cycleTwo classes depend on each otherThe object’s current behavior depends on what happened previously69Figure 18.22 A Statechart diagram showing how a student progresses from a potential student to a graduated student70PackagesContainers for other UML thingsShow system partitioningCan be component packagesCan be physical subsystemsUse a folder symbolMay have relationships71Figure 18.23 Use cases can be grouped into packages72Putting UML to Work The steps used in UML are:Define the use case modelContinue UML diagramming to model the system during the systems analysis phaseDevelop the class diagramsDraw statechart diagramsBegin systems design by refining the UML diagramsDocument your system design in detail73Summary Object-Oriented systemsObjectsClassesInheritanceCRC cards UML and use case modelingComponents of UMLThingsRelationshipsDiagrams74Summary (Continued)UML diagramsUse case diagramsActivity diagramsSequence diagramsCommunication diagramsClass diagramsStatechart diagramsUsing UML75

Các file đính kèm theo tài liệu này:

  • pptsystems_analysis_and_design_chapter_18_8135.ppt