250 likes | 272 Views
Object-Oriented Analysis and Design - CDT309 Period 4, Spring 2008. Introduction. Object-Oriented Analysis and Design. Lecturer: Marcelo Santos Room U3-152 Email: marcelo.santos @ mdh.se Home page for the course: www.idt.mdh.se/kurser/cd5130/jgms/2008lp4. Presentation.
E N D
Object-Oriented Analysis and Design - CDT309Period 4, Spring 2008 Introduction Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH
Object-Oriented Analysis and Design Lecturer: Marcelo Santos Room U3-152 Email: marcelo.santos @ mdh.se Home page for the course: www.idt.mdh.se/kurser/cd5130/jgms/2008lp4 Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH
Presentation • Students present themselves: • Name? • Where from? • Have taken software engineering course? • Have taken object oriented course? Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH
Object-Oriented Analysis and Design - CDT309 • 7.5 credits (5 weeks workload) • Goal: broad introduction to the field of object oriented analysis and design, using UML and design patterns • Prerequisites: experience in an OO language, basic concepts of UML • Grade: Pass or Not Pass Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH
Contents • Lectures • Laborations (U2-029): individual work, but group study encouraged • Project (implementation and report): group work • Written exam (June 4 or August 7) Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH
Fundamental aspect of OO Design • We will study patterns that help with the fundamental aspect of OO design: assigning responsibilities to objects Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH
Project • A programming project showing the use of OO Analysis, OO Design, UML and patterns • Part of of this assignment is understanding and selecting a suibable type of project • Object-oriented language of your choice Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH
Project • The project can be done in teams of at most 4 students • Deliverables: a working program and a report (describing the project) • Send by email the project proposal and names in the team Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH
Why use objects, analysis, design, patterns, prototypes, … Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH
An example: a coffee machine • You are requested to do an implementation of the GUI menu for a coffee machine • Return value: the option chosen by the user Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH
An easy way Hack a similar code example from internet Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH
Java example • Run modified hacked Java example in NetBins Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH
Adding more options • There are 4 types of coffee where the user can add something more… • Soy, sugar, whipped milk, cinnamon, coffee without caffeine, strong coffee, etc.. • Each set of options have different prices • Easy solution: one class for each combination of options Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH
Problems • Predicting the future: in the design, you should predict the future: what if the client wants to add more options or change the price? • Maintenance: how easy will it be to do a change or find and fix a bug? • Reusability: can you reuse the system for a juice vending machine? Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH
Problem working product From problem to code Now that you decided to learn good software practices, what lies between an idea and a working product? Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH
From problem to code • Analysis: define the problem to be solved • Design: identify classes and their behaviour and relationships • Implementation: implement and test classes and combine them into a working program Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH
Problem working product Programming and software quality • Analysis and design • How to solve the problem • What to include in the program • And is easy to • Communicate • Review • Implement • Evolve and modify (maintenance) Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH
Analysis and design • Analysis: investigation of the problem and requirements. • How will the system be used? • What are the functionalities? • Design: conceptual solution that fulfills the requirements Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH
Object-Oriented Analysis and Design • OO analysis: finding and describing (in the problem domain) the objects and the concepts • OO design: how can we fulfill the requirements with collaborating software objects Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH
Tools • UML (Unified Modelling Language): universily accepted visual language for software design • Software design patterns: allows us to reuse ideas Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH
Some issues • Knowing how to program in a oo language is not enough to build a system • Distribution of responsibilities to objects • Frequently used UML notation • Common design patterns Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH
Principles in OODA • Responsibilities of classes • Collaboration between objects • Allocation of tasks to classes Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH
Design Patterns • We can make good or bad designs in the object model • A large amount of experience has been gained. • Some properties that can make a design successful or not are now better understood. • We have a little guidance for trying to come up with a model for a particular application. • Design patterns attempts to meet this need identifying common modeling problems and providing verified solutions for them. Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH
Steps • Use cases: how the application is going to be used • Domain model: shows the concepts and objects • Interaction diagrams: sequence of collaborations and responsibilities of objects (dynamic view) • Class diagrams: static view of the idealized system Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH