Presentation is loading. Please wait.

Presentation is loading. Please wait.

Discovering Classes.

Similar presentations


Presentation on theme: "Discovering Classes."— Presentation transcript:

1 Discovering Classes

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
Subject Verb Object Response User Views Address List Addresses are listed by the system Filters Address list is filtered based on pattern Adds Address Address is added to the system Updates Address is updated on the system Deletes Address is deleted from the system System Validates Address 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 Is it correct?

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?
Subject Verb Object Response Consultant Inputs Card Data accepted by the system System Checks Identifying duplicates Updates New 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 clsUser UserNo:Int32 UserName:string Find(UserNo)
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

17 Composition (Has relationship)
Can an order line exist without an order? No – so we indicate a strong relationship Order Order Line Has 1 0..* Attributes Operations Order Order Line Has 1 0..* Attributes Operations

18 Aggregation (Uses relationship)
Can an address exist without a customer? Yes - so we express this with a clear diamond Customer Address Uses 1 1..* Attributes Operations Customer Address Uses 1 1..* 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 Assuming every table ends up with two classes, write down some candidate classes for your system. What are their names? What are their attributes? What are their operations? What associations might exist between them?


Download ppt "Discovering Classes."

Similar presentations


Ads by Google