DOC PREVIEW
Toronto CSC 340 - Class Design

This preview shows page 1-2-3-4 out of 13 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

© 2003 Jaelson Castro and John MylopoulosCSC340Information Systems Analysis and DesignClass Design -- 1XIX. Class DesignXIX. Class DesignWhat is Class Design?Types of Design ClassesClass Specifications and InterfacesComponents, Sub-Systems and PackagesCohesion and CouplingDesigning AssociationsIntegrity ConstraintsReferential, Dependency and Domain Integrity© 2003 Jaelson Castro and John MylopoulosCSC340Information Systems Analysis and DesignClass Design -- 2Class DesignClass Design Within the context of architectural design, class design: Produces full definitions of classes, associations, algorithmsand interfaces of operations; Adds classes that will be useful during implementation; Defines object interactions and object lifetimes in terms ofinteraction and state diagrams; Optimises data structures and algorithms.© 2003 Jaelson Castro and John MylopoulosCSC340Information Systems Analysis and DesignClass Design -- 3Input/Output for Class DesignInput/Output for Class Design The input is assumed to consist of: Use cases that describe the functional requirements for thenew system; also sequence and state/activity diagrams thatdescribe these use cases in more detail; Class diagrams that describe the kinds of things theinformation system will be managing information about. The outputs of class design are: Class packages which describe the overall softwarearchitecture of the new system; Supporting sequence, state/activity diagrams that giveadditional details about the design.© 2003 Jaelson Castro and John MylopoulosCSC340Information Systems Analysis and DesignClass Design -- 4Types of Design ClassesTypes of Design Classes Most classes defined during requirements analysis representobjects about which information will be stored in the systemdatabase. During design, we distinguish four types of classes:Persistent database classes (D), correspond to applicationclasses and describe what will be stored persistently in thesystem database;Entity classes (E) represent in-memory, run-time datastructures for persistent database classes;Boundary classes (B) specify interface functions;Control classes (C) specify business logic functions.© 2003 Jaelson Castro and John MylopoulosCSC340Information Systems Analysis and DesignClass Design -- 5Class SpecificationsClass Specifications Attribute signaturename: `:´ type-expression `=´ initial-value `{property-string}´ Operation signature Operation name: `(´ parameter-list ´)´ `:´ return-type-expression Object Visibility + Public -- The feature is directly accessible by any class; - Private -- The feature may only be used by the class thatincludes it; # Protected -- The feature maybe used by either the class thatincludes it or by a subclass of that class;© 2003 Jaelson Castro and John MylopoulosCSC340Information Systems Analysis and DesignClass Design -- 6AnAnExampleExampleDatabaseDatabaseClassClass<<database>>© 2003 Jaelson Castro and John MylopoulosCSC340Information Systems Analysis and DesignClass Design -- 7AnAnExampleExampleEntityEntityClassClass <<entity>> Customername:Stringaddr: StringlistOfAccts:Listcreate()Notes: Customer objects are created by accessing theCustomerDB and BankAccounts part of the database to build asingle Customer object which collects all account informationabout a customer.© 2003 Jaelson Castro and John MylopoulosCSC340Information Systems Analysis and DesignClass Design -- 8AnAnExampleExampleControlControlClassClass <<control>>TransferAmounttransfer(acc1, acc2, amount)AnAnExampleExampleBoundaryBoundaryClassClassLook at examples of view andcontrol classes from the previoussection.© 2003 Jaelson Castro and John MylopoulosCSC340Information Systems Analysis and DesignClass Design -- 9Class InterfacesClass Interfaces An interfaceinterface is a group of externally visible (public) operations. An interface is like a class, but contains no internal structure,has no attributes, no associations and no implementation of itsoperations. The realizes realizes relationship indicates that the target classsupports at least the operations listed in the interface© 2003 Jaelson Castro and John MylopoulosCSC340Information Systems Analysis and DesignClass Design -- 10ClassClassInterfacesInterfaces© 2003 Jaelson Castro and John MylopoulosCSC340Information Systems Analysis and DesignClass Design -- 11Class DesignClass Design So, a class design consists of a set of packages which containclasses and other packages, and which represent components orsub-systems. The grouping of classes into packages may be done fromseveral different points of view: By architectural tier -- Boundary, Control, Entity, Database; By functional relationship -- MVC; By authorship -- who designed what; …© 2003 Jaelson Castro and John MylopoulosCSC340Information Systems Analysis and DesignClass Design -- 12Cohesion and CouplingCohesion and CouplingCriteria for good sub-system/package design:Coupling measures the degree of interconnectedness betweendesign components/sub-systems/packages. The degree of coupling is reflected by the number of links aclass has, and by the degree of interaction the class has withother classes. Low coupling is preferrable in a design for many good reasons,e.g., easier to understand and modify the design.Cohesion, on the other hand, measures the degree to which anelement (subsystem, module, or class) contributes to a singlepurpose. Of course, we want a highly cohesive design.© 2003 Jaelson Castro and John MylopoulosCSC340Information Systems Analysis and DesignClass Design -- 13 Interaction coupling Measures the number of message types anobject sends to other objects and thenumber of parameters passed with thesemessage types; Should be kept to a minimum in order toreduce the possibility of changes ripplingthrough object interfaces; Inheritance coupling Degree to which a subclass actually needsthe features (attributes or operations) itinherits; A subclass with unnecessary attributes oroperations is more complex than it needs tobe and instances of the subclassunnecessarily use up more memory.Minimizing CouplingMinimizing Coupling© 2003 Jaelson Castro and John MylopoulosCSC340Information Systems Analysis and DesignClass Design -- 14 Operation cohesion Measure the degree to which anoperation focuses on a singlefunctional requirement. Good design produces


View Full Document

Toronto CSC 340 - Class Design

Documents in this Course
Scoping

Scoping

10 pages

Load more
Download Class Design
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Class Design and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Class Design 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?