1 / 21

COMP6325 Advanced Web Technologies

COMP6325 Advanced Web Technologies. Dr. Paul Walcott The University of the West Indies Session 1 – An Introduction to Object Oriented Analysis and Design Summer 2008. Objectives. Define an object Explain in your own words the three pillars of object oriented programming

Download Presentation

COMP6325 Advanced Web Technologies

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. COMP6325 Advanced Web Technologies Dr. Paul Walcott The University of the West Indies Session 1 – An Introduction to Object Oriented Analysis and Design Summer 2008

  2. Objectives • Define an object • Explain in your own words the three pillars of object oriented programming • Analyse the requirements of a system and document them using use cases • Design a system using design patterns • Construct UML diagrams for a system

  3. The Motivation

  4. The Early Days(Sintes 2002) • In the early days of programming, programming languages that were used included: • Machine language • Instructions represented as binary numbers • Assembly language • Mnemonics used (e.g. LDA #65, which loads the value 65 into a CPU register)

  5. The Early Days Cont’d • These earlier languages were error prone • In addition, gathering and documenting requirements has been a challenge • Earlier methods included the use of “shall” statements

  6. The Early Days Cont’d • A new breed of languages based on procedures were developed, e.g. Fortran • A procedure is “a portion of code within a larger program, which performs a specific task and is relatively independent of the remaining code “ http://en.wikipedia.org/wiki/Procedure_%28programming%29 • Problems with this approach included: • data and procedures were separated • Limits code reuse

  7. The Early Days Cont’d • In order to help to mitigate the problems with procedural languages, modular programming was introduced • Programs are decomposed into modules which encapsulate data and procedures • An interface allows external programs to access the internal data of the module • The values or meanings of this internal data (variables) define the state of the module

  8. Object Oriented Programming(Sintes 2002) • Object oriented programming (OOP) simply adds inheritance and polymorphism to modular programming • In OOP the problem space is sub-divided into objects • Entities with characteristics and behaviours • High level objects then interact by sending messages between each other

  9. OOP Cont’d An Example • A simple queue can be represented by an object • This queue will have characteristics and behaviour • Is the queue empty? This is a characteristic • “Push an item onto the queue” is a behaviour

  10. An object is an instance of a class

  11. OOP Cont’d • “A class defines all the characteristics common to a type of object (Sintes 2002)” • A class is used to instantiate an object • Attributes are characteristics • Behaviour are actions objects perform when passed a message (a method is called)

  12. OOP Cont’d Activity • What are some of the characteristics and behaviours of a vehicle?

  13. OOP Cont’d • Classes have: • Constructors – which initialises an object when it is instantiated • Accessors – give access to internal data • Mutators – change the state of an object

  14. OOP Cont’d • The three pillars of OOP are: • Encapsulation • Inheritance • Polymorphism

  15. OOP Cont’d Encapsulation • Uses modules to: • Hide implementation details • Allow programmers to view software as a black box • Publish an interface that lists the services provided by the black box • Encapsulation allows the implementation to be changed without affecting the interface

  16. OOP Cont’d Inheritance • Allows a class to be based on another class • The new class inherits attributes, behaviours and implementation • New attributes and behaviours may be added • OR, attributes and behaviours may be overridden • The “Is-a” test – is the inherited class of the same type – tells us whether to use inheritance • If you can not inherit use composition – simply create an instance of the class inside the new class

  17. OOP Cont’d Polymorphism • This means the state of having many forms • A single name can express different behaviours • For example using the same method name, many different behaviours are exhibited

  18. Unified Modeling Language(Fowler 2004) • Unified modeling language (UML) is a graphical design notation: • Used to communicate and enhance understanding of (OO) systems • Provides a high level of abstraction • Is an open standard • Controlled by the Object Management Group (OMG)

  19. Unified Modeling Language Cont’d • UML has a number of diagram types: • Activity diagram – procedural and parallel behaviour • Class diagram – Class features, relationships • Sequence diagram – Interaction between objects • Use case – user interactions with the system

  20. Use Cases • Use cases allow users to documents the requirements of a system • For an excellent treatment of use cases see Sendal & Strohmeier (2001)

  21. References Fowler, M., “UML Distilled: A brief guide to the standard object modeling language”, Third Edition, 2004 Sendall, S. & Strohmeier, “Requirements Analysis with Use Cases”, Swiss Federal Institute of Technology in Lausanne, 2001. Available online at http://lgl.epfl.ch/research/use_cases/RE-A2-theory.pdf Sintes, A., “SAMS Teach yourself Object Oriented Programming in 21 days”, Second Edition, SAMS, 2002

More Related