DESIGNING OOP SOLUTIONS: A CASE STUDY in Font

Draw ECC200 in Font DESIGNING OOP SOLUTIONS: A CASE STUDY

CHAPTER 4 DESIGNING OOP SOLUTIONS: A CASE STUDY
Encode Data Matrix ECC200 In None
Using Barcode generation for Font Control to generate, create Data Matrix 2d barcode image in Font applications.
www.OnBarcode.com
Code 3/9 Generation In None
Using Barcode generation for Font Control to generate, create Code 3 of 9 image in Font applications.
www.OnBarcode.com
Table 4-3. OSO Class Attributes
Make UPC - 13 In None
Using Barcode encoder for Font Control to generate, create EAN-13 image in Font applications.
www.OnBarcode.com
PDF417 Drawer In None
Using Barcode creation for Font Control to generate, create PDF-417 2d barcode image in Font applications.
www.OnBarcode.com
Class
Barcode Generation In None
Using Barcode creator for Font Control to generate, create Barcode image in Font applications.
www.OnBarcode.com
Making Denso QR Bar Code In None
Using Barcode generation for Font Control to generate, create QR-Code image in Font applications.
www.OnBarcode.com
Employee
UPC Symbol Generator In None
Using Barcode printer for Font Control to generate, create GTIN - 12 image in Font applications.
www.OnBarcode.com
Painting USPS POSTNET Barcode In None
Using Barcode encoder for Font Control to generate, create Postnet 3 of 5 image in Font applications.
www.OnBarcode.com
Attribute
Data Matrix Recognizer In Java
Using Barcode scanner for Java Control to read, scan read, scan image in Java applications.
www.OnBarcode.com
Data Matrix 2d Barcode Recognizer In None
Using Barcode scanner for Software Control to read, scan read, scan image in Software applications.
www.OnBarcode.com
EmployeeID LoginName Password Department FirstName LastName
Generate GS1 - 12 In None
Using Barcode creator for Office Excel Control to generate, create GTIN - 12 image in Excel applications.
www.OnBarcode.com
Making Barcode In Visual Basic .NET
Using Barcode maker for VS .NET Control to generate, create Barcode image in .NET framework applications.
www.OnBarcode.com
Type
Create PDF417 In Java
Using Barcode generator for Android Control to generate, create PDF-417 2d barcode image in Android applications.
www.OnBarcode.com
Printing GS1 128 In Java
Using Barcode maker for Java Control to generate, create EAN / UCC - 14 image in Java applications.
www.OnBarcode.com
Integer String String String String String Integer String String String String String Long Date String String Short Decimal String String String Decimal String
Code39 Printer In Visual Basic .NET
Using Barcode maker for .NET framework Control to generate, create Code 39 image in Visual Studio .NET applications.
www.OnBarcode.com
Denso QR Bar Code Maker In .NET Framework
Using Barcode creator for Reporting Service Control to generate, create Denso QR Bar Code image in Reporting Service applications.
www.OnBarcode.com
DepartmentManager
Barcode Decoder In Visual Basic .NET
Using Barcode Control SDK for Visual Studio .NET Control to generate, create, read, scan barcode image in Visual Studio .NET applications.
www.OnBarcode.com
Data Matrix 2d Barcode Scanner In VB.NET
Using Barcode scanner for VS .NET Control to read, scan read, scan image in Visual Studio .NET applications.
www.OnBarcode.com
EmployeeID LoginName Password Department FirstName LastName
Create Barcode In Java
Using Barcode generator for Android Control to generate, create Barcode image in Android applications.
www.OnBarcode.com
Encode Code 3 Of 9 In Java
Using Barcode creation for BIRT Control to generate, create Code-39 image in Eclipse BIRT applications.
www.OnBarcode.com
Order
OrderNumber OrderDate Status
OrderItem
ProductNumber Quantity UnitPrice
Product
ProductNumber ProductName Description UnitPrice VendorCode
ProductCatalog
None
Figure 4-6 shows the OSO class diagram with the class attributes. I have left out the attributes for the DepartmentManager class. The DepartmentManager class will probably inherit the attributes listed for the Employee class.
CHAPTER 4 DESIGNING OOP SOLUTIONS: A CASE STUDY
Figure 4-6. OSO Purchase Request component class diagram with attributes added
Identifying Class Associations
The next stage in the development process is to model the class associations that will exist in the OSO application. If you study the use cases and SRS, you can gain an understanding of what types of associations you need to incorporate into the class structural design.
Note You may find that you need to further refine the SRS to expose the class associations.
For example, an employee will be associated with an order. By examining the multiplicity of the association, you discover that an employee can have multiple orders, but an order can be associated with only one employee. Figure 4-7 models this association.
Figure 4-7. Depicting the association between the Employee class and the Order class
As you start to identify the class attributes, you will notice that the Employee class and the DepartmentManager class have many of the same attributes. This makes sense, because a manager is also an employee. For the purpose of this application, a manager represents an employee with specialized behavior. This specialization is represented by an inheritance relationship, as shown in Figure 4-8.
CHAPTER 4 DESIGNING OOP SOLUTIONS: A CASE STUDY
Figure 4-8. The DepartmentManager class inheriting from the Employee class
The following statements sum up the associations in the OSO class structure: An Order is an aggregation of OrderItem objects. An Employee can have multiple Order objects. An Order is associated with one Employee. The ProductCatalog is associated with multiple Product objects. A Product is associated with the ProductCatalog. An OrderItem is associated with one Product. A Product may be associated with multiple OrderItem objects. A DepartmentManager is an Employee with specialized behavior. Figure 4-9 shows these various associations (excluding the class attributes for clarity).
Figure 4-9. The OSO Purchase Request component class diagram with associations added
Modeling the Class Behaviors
Now that you have sketched out the preliminary structure of the classes, you are ready to model how these classes will interact and collaborate. The first step in this process is to drill down into the use case descriptions and create a more detailed scenario of how the use case will be carried out. The following scenario describes one possible sequence for carrying out the Login use case.
CHAPTER 4 DESIGNING OOP SOLUTIONS: A CASE STUDY
1. The user is presented with a login dialog box. 2. The user enters a login name and a password. 3. The user submits the information. 4. The name and password are checked and verified. 5. The user is presented with a supply request screen. Although this scenario depicts the most common processing involved with the Login use case, you may need other scenarios to describe anticipated alternate outcomes. The following scenario describes an alternate processing of the Login use case: 1. The user is presented with a login dialog box. 2. The user enters a login name and a password. 3. The user submits the information. 4. The name and password are checked but cannot be verified. 5. The user is informed of the incorrect login information. 6. The user is presented with a login dialog box again. 7. The user either tries again or cancels the login request. At this point, it may help to create a visual representation of the scenarios outlined for the use case. Remember from 3 that activity diagrams are often used to visualize use case processing. Figure 4-10 shows an activity diagram constructed for the Login use case scenarios.
Figure 4-10. An activity diagram depicting the Login use case scenarios
CHAPTER 4 DESIGNING OOP SOLUTIONS: A CASE STUDY
After analyzing the process involved in the use case scenarios, you can now turn your attention to assigning the necessary behaviors to the classes of the system. To help identify the class behaviors and interactions that need to occur, you construct an interaction diagram. As discussed in 3, interaction diagrams can take the form of either a sequence diagram or a collaboration diagram. Sequence diagrams focus on the order of the object interactions taking place, and collaboration diagrams focus on the links occurring between the objects. Figure 4-11 shows a sequence diagram for the Login use case scenarios. The Purchaser(UI) class calls the Login method that has been assigned to the Employee class. The message returns information that will indicate whether the login has been verified.
Copyright © OnBarcode.com . All rights reserved.