Download presentation
Presentation is loading. Please wait.
Published byBelinda Barton Modified over 9 years ago
2
Product V Process
3
Planning Tool for Classes
4
Relationship Between Layers Presentation (Use cases)Middle (Classes)Data (Entities)
5
A Single Class Class name Attributes (Properties) Operations (Methods)
6
Translated to Class File in Visual Studio
7
Attributes Become Properties
8
Operations Become Methods
9
Starting from the Event Table SubjectVerbObjectResponse UserViewsAddress List Addresses are listed by the system UserFiltersAddress List Address list is filtered based on pattern UserAddsAddressAddress is added to the system UserUpdatesAddressAddress is updated on the system UserDeletesAddressAddress is deleted from the system SystemValidatesAddressAddress data is accepted or error is displayed
10
Starting from the Scenario At the end of each year students have purchased a number of books that are surplus to requirements by the end of the year / course. In order to recycle the books and possibly make a little money a system is required allowing students to sell their books on to students following them on lower years. The application will be web based allowing students to access sales and account details at home. Students will sign up to the site providing contact details. Once authenticated on the system a student will be able to add books that they no longer require. Initially books will be viewable only to the student themselves. To sell on a book the student must take the book to the book shop on the ground floor of Gateway house. The book will be handed to the system administrator (Brenda) who will place the book into stock, provide a receipt for the student and then flag the book on the system as “in stock”. Now that the book is in stock it is visible to other students on the system who may reserve the book for collection. Once reserved the purchasing student must visit the book shop and pay for the book. They will be issued with the book along with a receipt or they have the option of cancelling the transaction if the book was not what they expected (wrong edition of poor condition). As soon as the transaction is completed the seller of the book is notified. They need to visit the bookshop to claim the money paid by the buyer. Identify the nouns
11
Authentication System What attributes / operations might this class have?
12
What About?…. Is it correct? clsAuthenticationSystem Attempts:Int32 CheckLogin(UserName:string,Password:string):Boolean
13
Adding a few more Classes clsAuthenticationSystem Attempts:Int32 CheckLogin(UserName:string, Password:string):Boolean clsUser UserNo:Int32 UserName:string Find(UserNo) Validate(UserDetails) clsDataConnection Count:Int32 DataTable:DataTable AddParameter (ParamName:string, ParamValue:object):void Execute (SProcName:string):Int32
14
How do we find Associations? SubjectVerbObjectResponse ConsultantInputsCardData accepted by the system SystemChecksCardIdentifying duplicates ConsultantUpdatesCardNew data input Clues may be found looking at subjects and Object
15
Multiplicity how many of one class may be used by another class
16
Adding Multiplicity clsAuthenticationSystem Attempts:Int32 CheckLogin(UserName:string, Password:string):Boolean clsUser UserNo:Int32 UserName:string Find(UserNo) Validate(UserDetails) clsDataConnection Count:Int32 DataTable:DataTable AddParameter (ParamName:string, ParamValue:object):void Execute (SProcName:string):Int32 1 1 1 1
17
Composition (Has relationship) Can an order line exist without an order? No – so we indicate a strong relationship OrderOrder Line Has10..* Attributes Operations Attributes Operations OrderOrder Line Has10..* Attributes Operations Attributes Operations
18
Aggregation (Uses relationship) Can an address exist without a customer? Yes - so we express this with a clear diamond CustomerAddress Uses11..* Attributes Operations Attributes Operations CustomerAddress Uses11..* Attributes Operations Attributes Operations
19
Collection Classes 1 Collection class allows you to manage many instances of the item class A good starting point is to consider 1 table needs 2 classes to control it
20
Classes you must Identify In your diagram you WILL have Collection classes + associated item class (1:M) Aggregations Composition If the above are absent on your diagram you have probably missed something!
21
Exercise Again using the extended list of features as your guide along with your event tables identify some candidate classes in the scenario. What are their names? What are their attributes? What are their operations? What associations might exist between them?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.