110 likes | 293 Views
Chapter 13. Object-oriented design for multiple classes. Objectives. To expand an object-oriented solution to cater for multiple classes To introduce interface and GUI objects. 13.1. Object-oriented design for multiple classes. Object-oriented design for multiple classes.
E N D
Chapter 13 Object-oriented design for multiple classes
Objectives • To expand an object-oriented solution to cater for multiple classes • To introduce interface and GUI objects
13.1 Object-oriented design for multiple classes
Object-oriented design for multiple classes • Advantages in using inheritance: • Saves time because the Parent class contains attributes and method that already exist • Reduce errors because the Parent class method have already been tested and used
13.2 Interface and GUI objects
Interface and GUI objects • Many popular programming languages provide a graphical user interface (GUI), which enables the programmer to select the elements of the program’s user interface from a pre-existing range of option • Interface design is a subset of a program design, as it concentrates on one aspect of the program’s performance and implementation
Interface and GUI objects • The interface are developed from predesigned classes available in the programming language • The use interface option may include windows, buttons, menus, boxes to hold text, drop down list and many more
Summary • Most object-oriented programs need more than one class. • Classes can be related to each other through association, by aggregation or composition or by inheritance. • Polymorphism allows several operations to have the same name, but they achieve their purposes by different methods.
Summary • Using operation overriding, a child class may substitute the parent class version of an operation with its own specific version. • With operation overloading, several operations of the same name may have different numbers of parameters and different algorithms.
Summary • Interface design for visual programming languages uses object-oriented design principles. • Interface objects have operations and attributes. • The choice of interface design can reduce the complexity of both an algorithm and the resulting program.