Lecture Software construction - Lecture 4: Object-oriented design – key concepts

This chapter presents the following content: Examples of class diagrams; navigation, visibility, named associations, and multiplicity in UML; interfaces and implementation, in UML. In this chapter students will be able to: Students will have a strong conceptual foundation for their future uses of the OO features of Java, students will be able to interpret a class diagram, students will be competent at the basic OO design patterns. | Software Construction Lecture 4 Object-Oriented Design – Key Concepts 1 Agenda & Reading 2 Topics: Abstraction and information hiding Inheritance, instantiation, and polymorphism Association, aggregation, and composition Reading The Java Tutorial, on Inheritance Wikipedia, on Class Diagram Learning Objectives 3 Students will have a strong conceptual foundation for their future uses of the OO features of Java Inheritance (is-a) vs composition/aggregation/association (has-a) Polymorphism Students will be able to discuss the OO features of an existing design (as expressed in a Java program or a class diagram) Students will be competent at basic OO design Abstraction 4 An abstraction is a view or representation of an entity that includes only the attributes of significance in a particular context. Abstraction is essential when working with complex systems. Without abstraction, the programmer faces an overwhelming level of detail. Complex Object Idealised Model Ignore Inessential Details | Software Construction Lecture 4 Object-Oriented Design – Key Concepts 1 Agenda & Reading 2 Topics: Abstraction and information hiding Inheritance, instantiation, and polymorphism Association, aggregation, and composition Reading The Java Tutorial, on Inheritance Wikipedia, on Class Diagram Learning Objectives 3 Students will have a strong conceptual foundation for their future uses of the OO features of Java Inheritance (is-a) vs composition/aggregation/association (has-a) Polymorphism Students will be able to discuss the OO features of an existing design (as expressed in a Java program or a class diagram) Students will be competent at basic OO design Abstraction 4 An abstraction is a view or representation of an entity that includes only the attributes of significance in a particular context. Abstraction is essential when working with complex systems. Without abstraction, the programmer faces an overwhelming level of detail. Complex Object Idealised Model Ignore Inessential Details Instance variables: Names : String DateOfBirth : Date Methods: getSurname(): String getFirstname (): String getAge(): Integer setSurname(name: String): void Customer Instance Variables: item: Vector Methods: push(object:Object): void pop(): Object Stack Instance Variables: topLeftCorner: Point Width: Integer Height: Integer Methods: paint(): void Rectangle 4 Information Hiding: two definitions 5 A programming technique, in which the programmer uses language features (such as Interface, protected, private) to restrict access to implementation details. In the extreme case, other programmers are not allowed to “look inside” your model to see its implementation. A design technique, in which the designer defines a model which is simple, useful, and unlikely to change. In the extreme case, other programmers can read your high-level design documents, but not your code. It is usually undesirable for programmers to rely on “undocumented functions” in an implementation. Undocumented functions .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.