Systems analysis and design methods 7th whitten and benley chapter 16

40 157 0
Systems analysis and design methods 7th whitten and benley chapter 16

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Object-Oriented Design Introduction  The chapter will address the following questions:      What is the difference between entity, interface, and control objects? What is the basic concept object responsibility and how it is related to message sending between object types? What is the important of considering object reuse during systems design? What are three activities involved in completing object design? How you construct an Ideal Object Model Diagram, CRC Card, and Object Interaction Diagram? Object-Oriented Design An Introduction to Object-Oriented DesignDesign Objects     The objects that represented actual data within the business domain in which the user was interested in storing were called Entity Objects Objects which represent a means through which the user will interface with the system are called Interface Objects Objects that hold application or business rule logic are called Control Objects A system’s functionality is distributed across all three types of objects  This practice makes the maintenance, enhancement, and abstraction of objects simpler and easier to manage Object-Oriented Design An Introduction to Object-Oriented DesignDesign Objects  The three object types correlate well with the client-server model  The client is responsible for the application logic (control objects) and presentation method (interface objects)  The server is responsible for the repository (entity objects) Object-Oriented Design An Introduction to Object-Oriented DesignDesign Objects  Interface Objects:  It is through interface objects that the users communicate with the system  The responsibility of the interface object is two fold: In te rfa ce  • It translates the user’s input into information that the system can understand and use to process the business event O bje ct • It takes data pertaining to a business event and translates the data for appropriate presentation to the user Each actor or user needs its own interface object to communicate with the system • In some cases the user may need multiple interface objects Object-Oriented Design An Introduction to Object-Oriented DesignDesign Objects  En ti ty Entity Objects:  Entity objects usually correspond to items in real life and contain information known as attributes which describe the different instances of the entity  They also encapsulate those behaviors that maintains its information or attributes O bj e ct  An entity object is said to be persistent meaning the object typically outlives the execution of a use case (or program) • An entity object exists between use case executions because the information about that entity object is typically stored in a database (allowing for later retrieval and manipulation) Object-Oriented Design An Introduction to Object-Oriented DesignDesign Objects  Control Objects:  Control objects contain behavior that does not naturally reside in either the interface or entity objects • Such behavior is related to the management of the interactions of objects to support the functionality of the use case Controller objects serve as the “traffic cop” containing the application logic orct business rules of the event for managing or directing the C o n tro l O bje interaction between the objects  Controller objects allow the scenario to be more robust and simplifies the task of maintaining that process once it is implemented  As a general rule of thumb, within a use case, a control object should be associated with one and only one actor  Object-Oriented Design An Introduction to Object-Oriented Design  Object Responsibilities   In object-oriented design it is important to recognize an object has responsibility  An object responsibility is the obligation that an object has to provide a service when requested and thus collaborating with other objects to satisfy the request if required Object responsibility is closely related to the concept of objects being able to send and/or respond to messages Object-Oriented Design An Introduction to Object-Oriented Design  Object Reusability   The number one driving force for developing systems using object oriented technology is the ability to reuse objects Study performed by EDS using two different technologies (one traditional, one OO) to develop the same system  The results were impressive as indicated in the following table: PL/1 19 calendar months 152 person months 265,000 lines of code Smalltalk 3.5 calendar months 10.4 person months 22,000 lines of codes  In order to maximize the ability to reuse objects, objects have to be correctly designed within a good generalization/specialization hierarchy  The goal is to make objects general enough to be easily used in other applications Object-Oriented Design An Introduction to Object-Oriented Design  Object Reusability   Many companies achieve their highest level of reuse by exploiting object frameworks  An object framework is a set of related, interacting objects that provide a well-defined set of services for a accomplishing a task By using object frameworks, developers can concentrate on developing the logic that is new or unique to the application, thus reducing the overall time required to build the entire system Object-Oriented Design The Process of Object Design  Object oriented design includes the following activities:    Refining the use case model to reflect the implementation environment Modeling object interactions and behavior that support the use case scenario Updating the object model to reflect the implementation environment 10 Object-Oriented Design ALTERNATE COURSE: 3a 3b 5a 5b 6a 6b 6c If the MEMBER NUMBER is invalid, the system displays a window with the error message “Member Number Not on File” The promotion order specialist can then re-enter the number or cancel the transaction If the club member indicates an address or telephone number change on the promotion order, the promotion order specialist selects the option to update the club member’s personal information The personal information window is activated for update The promotion order specialist updates the required fields and saves the changes If the club member is not ordering product at this time, the promotion order specialist clicks the button “Order Declined” The system modifies the ORDER STATUS field to have a status of “closed” and modifies the ORDERED PRODUCT STATUS field (for the selection of the month) to have a status of “rejected” The changes are saved and then the system prompts the user to process a new order or cancel the transaction If the club member is not ordering the selection of the month, the promotion order specialist clicks the button “Selection of the Month Declined” The system modifies the ORDERED PRODUCT STATUS field (for the selection of the month) to have a status of “rejected” The cursor is then advanced to the next line If no additional products are being ordered, proceed to step of the normal course If the PRODUCT NUMBER or QUANTITY ORDERED is not valid, the system hi-lights the fields indicating those fields have invalid entries The promotion order specialist either corrects the entries or advances to the next line In a later step an error report will be generated for any invalid entries If the club members status is not acceptable, invoke abstract use case Send Order Rejection Notice The system modifies the ORDER STATUS field to have a status of “on hold pending payment” The changes are saved and the system prompts the user to process a new order or cancel the transaction If the QUANTITY ORDERED is greater than the QUANTITY AVAILBLE, the NUMBER TO BE PICKED will be set to the QUANTITY AVAILBLE The system will reduce the QUANTITY AVAILABLE to zero(if it is not already) and update QUANTITY BACKORDERED to be equal to the QUANTITY ORDERED minus the NUMBER TO BE PICKED If there are invalid product numbers or quantity ordered entries, invoke abstract use case Generate Order Error Report PRE-CONDITION: Use case Send Club Promotion has been processed Use case User Logs In has been processed POST-CONDITION: Promotion order has been recorded and the Picking Ticket has been routed to the Warehouse ASSUMPTIONS: 26 Object-Oriented Design The Process of Object Design  Modeling Object Interactions and Behaviors that Support the Use Case Scenario  Step - Identify Object Behaviors and Responsibilities  Once the behaviors have been identified, we must determine if the behaviors are manual or will they be automated  If they are to be automated, they must be associated with the appropriate object type that will have the responsibility of carrying out that behavior 27 Object-Oriented Design Behavior Process promotion order Send promotion order Select system option Display window Enter member number Verify member number Report member information Report member order information Check order for changes Check order for products being ordered Position cursor Check order for selection of the month Check quantity ordered Enter quantity ordered Calculate extended cost Enter product number Report product information Update ordered product status Commit order Verify member status Process picking ticket Route picking ticket to warehouse Print picking ticket Prompt User Cancel transaction Automated/Manual Manual/Automated Manual Manual Automated Manual Automated Automated Automated Object Type Control Interface Entity Entity Entity Manual Manual Manual/Automated Manual Interface Manual Manual Automated Manual Automated Automated Manual Automated Automated Automated Entity Control Interface Automated Automated Automated Interface Interface Control 28 Entity Entity Entity Object-Oriented Design Behavior Process promotion order Process picking ticket Cancel transaction Verify member number Report member information Report member order information Calculate extended cost Report product information Update ordered product status Verify member status Display window Position cursor Route picking ticket to warehouse Print picking ticket Prompt User Object Type Control Control Control Entity Entity Entity Entity Entity Entity Entity Interface Interface Interface Interface Interface 29 Object-Oriented Design The Process of Object Design  Modeling Object Interactions and Behaviors that Support the Use Case Scenario  Step - Identify Object Behaviors and Responsibilities  Our third task is aimed toward identifying all behaviors that can be associated with an object type, and to identify collaborations amongst those objects • A popular tool for documenting the behaviors and collaborations for an object is the Class Responsibility Collaboration (CRC) Card • A CRC card contains all use case behaviors and responsibilities that have been associated with a specific object type 30 Object-Oriented Design Object Name: Member Order Sub Object: Super Object Behaviors and Responsibilities Report order information Calculate sub-total cost Calculate sales tax Update order status Create ordered Product Delete ordered Product Collaborators Member Ordered Product 31 Object-Oriented Design The Process of Object Design  Modeling Object Interactions and Behaviors that Support the Use Case Scenario  Step - Identify Object Behaviors and Responsibilities  Analysis of the use case scenarios may not reveal all behaviors for any given object type  By examining the object model, you may find additional behaviors (not mentioned in the use case scenarios) that need to be assigned to an object type • Analyze the relationships between any two objects – How are those relationships created or deleted? – Which object should be assigned that responsibility? – As a general rule, the object that controls the relationship should be responsible for creating or deleting the relationship 32 Object-Oriented Design The Process of Object Design  Modeling Object Interactions and Behaviors that Support the Use Case Scenario  Step - Identify Object Behaviors and Responsibilities  There are four “implicit” behaviors that can be associated with any object class Those include the ability to: • • • • create new instances, change its data or attributes, delete instances, and display information about the object class 33 Object-Oriented Design The Process of Object Design  Modeling Object Interactions and Behaviors that Support the Use Case Scenario  Step - Identify Object Behaviors and Responsibilities  While examining the use cases to identify and associate behaviors with object types, we also focus on identifying the collaboration or cooperation that is necessary between object types • If an object needs another object’s attribute to accomplish a behavior, the collaborating object needs to have a behavior or method to provide that attribute  Identifying the collaboration of object types is necessary to ensure that all use case objects work in harmony to complete the processing required for the business event 34 Object-Oriented Design The Process of Object Design  Modeling Object Interactions and Behaviors that Support the Use Case Scenario  Step - Identify Object Behaviors and Responsibilities  The last task is verify the results from the previous tasks • This consists of conducting walkthroughs with the appropriate users • One verification approach that is commonly used is role playing – In role playing, the use case scenarios are acted out by the participants – The participants may assume the role of an actor or an object type that collaborate to process a hypothetical business event – Message sending is simulated by using an item such as a ball that is passed (or sometimes thrown) between the participants 35 Object-Oriented Design The Process of Object Design  Modeling Object Interactions and Behaviors that Support the Use Case Scenario  Step - Model Detailed Object Interactions for a Use Case  In this step a detailed model will be constructed of how the objects will interact with each other to provide the functionality specified in each design use case • This model is called an interaction diagram – Interaction diagrams show us in great detail how the objects interact with each other over time 36 Object-Oriented Design System Border Customer selects “process promotion order” option Do until no more member orders Customer enters member number Main Window Start Order Processing Window Order Processer Member Member Order Member Ordered Product Product Start order process Request member number New member number Validate member number If member number valid isMember Get current promtion order header reportOrder Do until no more ordered products Get ordered product information Get product information Display order reportProduct Display order Else Display error message Clear Message reportOrderedProduct Display error message Clear Endif 37 Object-Oriented Design The Process of Object Design  Updating the Object Model to Reflect the Implementation Environment  In this activity the object model is refined to include the behaviors or implementation methods it needs to possess  Each behavior or method is given a unique name • Normally these names reflect the programming language used to develop the system 38 Object-Oriented Design MEMBER MEMBER ORDER Member Number Member Name Member Status Member Street Address Member P.O Box Number Member City Member State Member Zip Cpde Member Daytime Phone Number Date Of Last Order Member Balance Due Member Bonus Balance placed Order Number Order Creation Date Order Automatic Fill Date Order Sub-total Cost Order Sales Tax Order Status reportOrder setStatus CalculateSalesTax calculateSubtotal isMember reportMember reportStatus persistent persistent sells 1+ PRODUCT MEMBER ORDERED PRODUCT Product Number Quantity Available Product Name Suggested Unit Price Quantity Ordered Quantity Shipped Quantity Backordered Purchased Unit Price Extended Cost Credits Earned Ordered Product Status sold as reportProduct calculateQuantityAvailable setStatus calculateQuantityBackordered calculateExtendedCost reportOrderedProduct persistent persistent 39 Object-Oriented Design Summary    Introduction An Introduction to Object-Oriented Design The Process of Object Design 40 ... Object-Oriented Design The Process of Object Design  Modeling Object Interactions and Behaviors that Support the Use Case Scenario  Step - Identify Object Attributes:  During both analysis and design, ... accurate and current 17 Object-Oriented Design The Process of Object Design  Modeling Object Interactions and Behaviors that Support the Use Case Scenario   In this activity we want to identify and. .. makes the maintenance, enhancement, and abstraction of objects simpler and easier to manage Object-Oriented Design An Introduction to Object-Oriented Design  Design Objects  The three object

Ngày đăng: 10/01/2018, 16:09

Từ khóa liên quan

Mục lục

  • Introduction

  • An Introduction to Object-Oriented Design

  • Slide 3

  • Slide 4

  • Slide 5

  • Slide 6

  • Slide 7

  • Slide 8

  • Slide 9

  • The Process of Object Design

  • Slide 11

  • Slide 12

  • Slide 13

  • Slide 14

  • Slide 15

  • Slide 16

  • Slide 17

  • Slide 18

  • Slide 19

  • Slide 20

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan