PPT03_Problem_Domain_Classes

PPT03_Problem_Domain_Classes - Developing Problem Domain...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Developing Problem Domain Classes Naming Conventions Class names begin with a capital letter Customer, Boat Attribute names begin with lowercase letters, with subsequent words capitalized address, phoneNumber Method names begin with lowercase letters, with subsequent words capitalized, and usually contain a verb describing what the method does setAddress, getPhoneNumber Developing a PD Class Definition Class Definition Structure Class definition The Java code written to represent a class Class header Line of code that identifies the class and some of its characteristics Keywords: public Indicates class has public availability class Indicates this line of code is a class header Class Definition public class classname // Header { // Attribute Definitions // Method Definitions } Developing a PD Class Definition Identifying Attributes Characteristics of an object Descriptive Attributes Attributes that describe intrisic facts about an object Naming Attributes Attributes that identify a particular object Control Attributes Attributes that are necessary for the application and are used in the services provided by the attribute Coupling Attributes Attributes that create the relationships between two different types of objects Defining Attributes Define attributes by declaring variables for each one Specify accessibility of a variable: public Allows any class to access the variable directly private Prohibits direct access Requires accessor methods for access by other classes Accessible only from within class where it is defined protected Page 1 of 6
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Allows both subclasses and classes defined within the same package to have direct access Attributes are generally private. Identifying Services Processes that the object must perform for other objects Identify the verbs in the process description of the application Methods are the set of detailed operations to perform a service Types of services provided Simple services (60%-80%) Create – instantiates a new object Connect – connects an object to another Access – gets or sets attributes Disconnect – disconnects two objects Delete – Deletes an object Complex Services Calculate – calculations on attributes Monitor – Monitoring events to respond to Query – Calculates without modifying an attribute Writing Methods Object interaction via client-server model
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/15/2010 for the course CSIS 345 taught by Professor Dwightstrong during the Spring '10 term at Pittsburg State Uiversity.

Page1 / 6

PPT03_Problem_Domain_Classes - Developing Problem Domain...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online