1 / 19

Computer Science II

Computer Science II. University of Palestine Faculty of Engineering and Urban planning Software Engineering Department. Lecture 3 of. Mohammad Amin Kuhail M.Sc. (York, UK). Design Principles. Saturday, 22 September 2007. Design Principles. Agenda. Data Structures and Algorithms

Télécharger la présentation

Computer Science II

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computer Science II University of Palestine Faculty of Engineering and Urban planning Software Engineering Department Lecture 3 of Mohammad Amin KuhailM.Sc. (York, UK) Design Principles Saturday, 22 September 2007

  2. Design Principles Agenda • Data Structures and Algorithms • Object oriented design principles. • Object oriented design techniques. • Java examples of object oriented design. • Object oriented design patterns • Assignment • References

  3. Data structures and algorithms Definitions • Data Structures : systematic way of organizing and accessing data. • Algorithm: a step by step procedure for performing some task in a finite amount of time.

  4. Data structures and algorithms High Level Design Goals • Correctness. • Efficiency.

  5. Data structures and algorithms Implementation Goals • Robustness. • Adaptability. • Reusability.

  6. Object Oriented Design Principles 1. Abstraction • Means to distill a complicated system down to its most fundamental parts and describe these parts in a simple, precise language. • Benefits robustness since it leads to understandable and correct implementation.

  7. Object Oriented Design Principles 1. Abstraction • ADT: is a mathematical model of a data structure that specifies the type of data stored, the operations on them, and the types of parameters of the operations. • An ADT specifies what each operation does, but not how it does it. • Examples in Java? Benefits: • Clarity, Robustness.

  8. Object Oriented Design Principles 2. Encapsulation • Different components of a software system should implement an abstraction without revealing the internal details of that implementation. • You just know how to use it Benefits: • Security.

  9. Object Oriented Design Principles 2. Modularity • Modularity refers to an organizing structure in which different components of a software system are divided into separate functional units. Benefits: • Clarity. • Reusability.

  10. Object Oriented Design Techniques 1. Classes and Objects • Class: a specification of the data fields that the object contains, as well as of the operations that the object can execute. • Objects: are simply instances of these classes.

  11. Object Oriented Design Techniques 2. Interfaces and Strong Typing An interface is specified as a class type definition and a collection of methods for this type.

  12. Object Oriented Design Techniques 2. Interfaces and Strong Typing APIs are also common in commercial software products. Typically, a company sells a software package that contains complex methods that another company wants to use in its own software product. An example would be a package of digital image processing methods that are sold to companies making end-user graphics programs. The image processing company writes its classes to implement an interface, which it makes public to its customers. The graphics company then invokes the image processing methods using the signatures and return types defined in the interface

  13. Object Oriented Design Techniques 2. Interfaces and Strong Typing While the image processing company's API is made public (to its customers), its implementation of the API is kept as a closely guarded secret—in fact, it may revise the implementation at a later date as long as it continues to implement the original interface that its customers have relied on.

  14. Object Oriented Design Techniques 3. Inheritance and Polymorphism Benefits of inheritance: • Reduction of redundant code. • Reusability of code Polymorphism: • Inheritance. • Overriding. • Overloading.

  15. Java Examples of Object-Oriented Design 1. Numeric Progression • class Progression • class ArithProgression • class GeomProgression • class FibonacciProgression • Class Tester

  16. Java Examples of Object-Oriented Design 2. Interface example

  17. Java Examples of Object-Oriented Design 2. Interface example

  18. Assignment A1 Due Sat, 29 September 2007 R-1.1, R-1.4 C-1.2, P-1.5

  19. References Design Principles [1] Textbook. [2]http://java.sun.com/docs/books/tutorial/java/IandI/createinterface.html

More Related