Copyright ?2012 Pearson Education, Inc.
Chapter 7
Object-Oriented Design
Java Software Solutions
Foundations of Program Design
Seventh Edition
John Lewis William Loftus
Object-Oriented Design
?Now we can extend our discussion of the design of classes and objects ?Chapter 7 focuses on:
–software development activities
–determining the classes and objects that are needed for a program –the relationships that can exist among classes –the static modifier –writing interfaces
–the design of enumerated type classes –method design and method overloading –
GUI design and layout managers
Copyright ?2012 Pearson Education, Inc.
Outline
Software Development Activities Identifying Classes and Objects Static Variables and Methods Class Relationships Interfaces
Enumerated Types Revisited Method Design Testing
GUI Design and Layout
Copyright ?2012 Pearson Education, Inc.
Program Development
?The creation of software involves four basic activities:
–establishing the requirements –creating a design –implementing the code –testing the implementation
?These activities are not strictly linear –they overlap and interact
Copyright ?2012 Pearson Education, Inc.
Requirements
?Software requirements specify the tasks that a program must accomplish
–what to do, not how to do it
?Often an initial set of requirements is provided, but they should be critiqued and expanded
?It is difficult to establish detailed, unambiguous, and complete requirements
?Careful attention to the requirements can save significant time and expense in the overall project
Copyright ?2012 Pearson Education, Inc.
Design
? A software design specifies how a program will accomplish its requirements
? A software design specifies how the solution can be broken down into manageable pieces and what each piece will do
?An object-oriented design determines which
classes and objects are needed, and specifies how they will interact
?Low level design details include how individual methods will accomplish their tasks
Copyright ?2012 Pearson Education, Inc.