Designing applications Software Engineering from a Code Perspective.

Slides:



Advertisements
Similar presentations
Comp1004: Object Oriented Design II Designing Applications Based on BlueJ Chapter 13.
Advertisements

COMP 121 Week 7: Object-Oriented Design and Efficiency of Algorithms.
The software process A software process is a set of activities and associated results which lead to the production of a software product. This may involve.
Framework is l Reusable Code, often domain specific (GUI, Net, Web, etc) l expressed as l a set of classes and l the way objects in those classes collaborate.
A case study Whole-application development The case study A taxi company is considering expansion. –It operates taxis and shuttles. Will expansion.
OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1/18 Use Case Analysis – continued Control Classes.
Introduction To System Analysis and Design
1 Software Testing and Quality Assurance Lecture 12 - The Testing Perspective (Chapter 2, A Practical Guide to Testing Object-Oriented Software)
Objects First With Java A Practical Introduction Using BlueJ Designing object-oriented programs How to write code in a way that is easily understandable,
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 5: Restaurant.
Software Testing and Quality Assurance
Chapter 8 Object Design Reuse and Patterns. Finding Objects The hardest problems in object-oriented system development are: –Identifying objects –Decomposing.
Design Patterns academy.zariba.com 1. Lecture Content 1.What are Design Patterns? 2.Creational 3.Structural 4.Behavioral 5.Architectural 6.Design Patterns.
Object Oriented Analysis and Design Using the UML
SABAL SHRESTHA SHERIF HALAWA SHAMA KHADPEKAR JIANWEI LAI SI TRAN GROUP A Tri-Airport Shuttle System.
The chapter will address the following questions:
Introduction To System Analysis and design
OO Analysis and Design CMPS OOA/OOD Cursory explanation of OOP emphasizes ▫ Syntax  classes, inheritance, message passing, virtual, static Most.
Design Patterns.
University of Palestine software engineering department Testing of Software Systems Fundamentals of testing instructor: Tasneem Darwish.
Design patterns. What is a design pattern? Christopher Alexander: «The pattern describes a problem which again and again occurs in the work, as well as.
Whole-application development
Understand Application Lifecycle Management
©Ian Sommerville 2000, Mejia-Alvarez 2009 Slide 1 Software Processes l Coherent sets of activities for specifying, designing, implementing and testing.
Designing applications Main concepts to be covered Discovering classes CRC cards Designing interfaces Patterns Objects First with Java - A Practical.
Big Java Chapter 12. Software Process - Waterfall Analysis Design Implementation Testing Deployment Does not work well when rigidly applied! established.
Chapter 1 Object-Oriented Analysis and Design. Disclaimer Slides come from a variety of sources: –Craig Larman-developed slides; author of this classic.
Capability Maturity Models Software Engineering Institute (supported by DoD) The problems of software development are mainly caused by poor process management.
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
Objects First With Java A Practical Introduction Using BlueJ Designing applications 1.0.
Introduction To System Analysis and Design
CSC 211 Introduction to Design Patterns. Intro to the course Syllabus About the textbook – Read the introduction and Chapter 1 Good attendance is the.
Creational Patterns CSE301 University of Sunderland Harry R Erwin, PhD.
CSC 213 – Large Scale Programming. Today’s Goal  Improve design skills to make usable designs  Noun extraction & UML class diagram reviewed  Connections.
Review: Cohesion and Coupling, Mutable, Inheritance Screen Layouts Software methodologies – Extreme Programming Object-Oriented Design – CRC Cards - UML.
Slide 1 Structural Modeling Chapter 7. Slide 2 Key Ideas A structural or conceptual model describes the structure of the data that supports the business.
Approaching a Problem Where do we start? How do we proceed?
CS3773 Software Engineering Lecture 04 UML Class Diagram.
Chapter 1 Object-Oriented Analysis and Design. Disclaimer Slides come from a variety of sources: –Craig Larman-developed slides; author of this classic.
1 What is OO Design? OO Design is a process of invention, where developers create the abstractions necessary to meet the system’s requirements OO Design.
Design Principle & Patterns by A.Surasit Samaisut Copyrights : All Rights Reserved.
Design Model Lecture p6 T120B pavasario sem.
Design Patterns -- Omkar. Introduction  When do we use design patterns  Uses of design patterns  Classification of design patterns  Creational design.
Designing applications Main concepts to be covered Discovering classes CRC cards Designing interfaces Patterns Objects First with Java - A Practical.
SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Objectives Lecture 13 Creational Design Pattern SWE 316: Software Design and Architecture.
PROC-1 1. Software Development Process. PROC-2 A Process Software Development Process User’s Requirements Software System Unified Process: Component Based.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Chapter 6 CASE Tools Software Engineering Chapter 6-- CASE TOOLS
Software Architecture Evaluation Methodologies Presented By: Anthony Register.
Sadegh Aliakbary. Copyright ©2014 JAVACUP.IRJAVACUP.IR All rights reserved. Redistribution of JAVACUP contents is not prohibited if JAVACUP.
Chapter 17 – Object- Oriented Design. Chapter Goals To learn about the software life cycle To learn about the software life cycle To learn how to discover.
Software Design Patterns Curtsy: Fahad Hassan (TxLabs)
Designing Classes CS239 – Jan 26, Key points from yesterday’s lab  Enumerated types are abstract data types that define a set of values.  They.
Internet and Intranet Protocols and Applications Lecture 5a: HTTP Client-Server Design and Implementation February 15, 2005 Arthur Goldberg Computer Science.
Design Reuse Earlier we have covered the re-usable Architectural Styles as design patterns for High-Level Design. At mid-level and low-level, design patterns.
Requirements Engineering Requirements Engineering in Agile Methods Lecture-28.
Topic 4 - Database Design Unit 1 – Database Analysis and Design Advanced Higher Information Systems St Kentigern’s Academy.
CMSC 345 Fall 2000 OO Design. Characteristics of OOD Objects are abstractions of real-world or system entities and manage themselves Objects are independent.
Software Development Process CS 360 Lecture 3. Software Process The software process is a structured set of activities required to develop a software.
High Level Design Use Case Textual Analysis SE-2030 Dr. Mark L. Hornick 1.
Designing applications Main concepts to be covered Discovering classes CRC cards Designing interfaces Patterns © 2017 Pearson Education, Inc. Hoboken,
A case study Whole-application development The case study A taxi company is considering expansion. –It operates taxis and shuttles. Will expansion.
Software Development Life Cycle. The Software Life Cycle  Encompasses all activities from initial analysis until end of work  Formal process for software.
Lecture 3 Prescriptive Process Models
MPCS – Advanced java Programming
Introduction to Design Patterns
Advanced Programming Behnam Hatami Fall 2017.
Slides by Steve Armstrong LeTourneau University Longview, TX
Chapter 8, Design Patterns Introduction
Presentation transcript:

Designing applications Software Engineering from a Code Perspective

13/01/2004Lecture 11: Designing Applications2 Main concepts to be covered Discovering classes CRC cards Designing interfaces Patterns

13/01/2004Lecture 11: Designing Applications3 Analysis and design A large and complex area. The verb/noun method is suitable for relatively small problems. CRC cards support the design process.

13/01/2004Lecture 11: Designing Applications4 The verb/noun method The nouns in a description refer to ‘things’. –A source of classes and objects. The verbs refer to actions. –A source of interactions between objects. –Actions are behavior, and hence methods.

13/01/2004Lecture 11: Designing Applications5 A problem description The cinema booking system should store seat bookings for multiple theatres. Each theatre has seats arranged in rows. Customers can reserve seats and are given a row number and seat number. They may request bookings of several adjoining seats. Each booking is for a particular show (i.e., the screening of a given movie at a certain time). Shows are at an assigned date and time, and scheduled in a theatre where they are screened. The system stores the customers’ telephone number.

13/01/2004Lecture 11: Designing Applications6 Nouns and verbs Cinema booking system Stores (seat bookings) Stores (telephone number) Seat booking Theatre Has (seats) Seat Row Customer Reserves (seats) Is given (row number, seat number) Requests (seat booking) Row number Seat numberShow Is scheduled (in theatre) Movie DateTime Telephone number

13/01/2004Lecture 11: Designing Applications7 Using CRC cards First described by Kent Beck and Ward Cunningham. Each index cards records: –A class name. –The class’s responsibilities. –The class’s collaborators.

13/01/2004Lecture 11: Designing Applications8 A CRC card Class name Collaborators Responsibilities

13/01/2004Lecture 11: Designing Applications9 A partial example CinemaBookingSystem Collaborators Can find shows by Show title and day. Stores collection of Collection shows. Retrieves and displays show details....

13/01/2004Lecture 11: Designing Applications10 Scenarios An activity that the system has to carry out or support. –Sometimes known as use cases. Used to discover and record object interactions (collaborations). Can be performed as a group activity.

13/01/2004Lecture 11: Designing Applications11 Scenarios as analysis Scenarios serve to check the problem description is clear and complete. Sufficient time should be taken over the analysis. The analysis will lead into design. –Spotting errors or omissions here will save considerable wasted effort later.

13/01/2004Lecture 11: Designing Applications12 Class design Scenario analysis helps to clarify application structure. –Each card maps to a class. –Collaborations reveal class cooperation/object interaction. Responsibilities reveal public methods. –And sometimes fields; e.g. “Stores collection...”

13/01/2004Lecture 11: Designing Applications13 Designing class interfaces Replay the scenarios in terms of method calls, parameters and return values. Note down the resulting signatures. Create outline classes with public-method stubs. Careful design is a key to successful implementation.

13/01/2004Lecture 11: Designing Applications14 Documentation Write class comments. Write method comments. Describe the overall purpose of each. Documenting now ensures that: –The focus is on what rather than how. –That it doesn’t get forgotten!

13/01/2004Lecture 11: Designing Applications15 Cooperation Team-working is likely to be the norm not the exception. Documentation is essential for team working. Clean O-O design, with loosely-coupled components, also supports cooperation.

13/01/2004Lecture 11: Designing Applications16 Prototyping Supports early investigation of a system. –Early problem identification. Incomplete components can be simulated. –E.g. always returning a fixed result. –Avoid random behavior which is difficult to reproduce.

13/01/2004Lecture 11: Designing Applications17 Software growth Waterfall model. –Analysis –Design –Implementation –Unit testing –Integration testing –Delivery No provision for iteration.

13/01/2004Lecture 11: Designing Applications18 Iterative development Use early prototyping. Frequent client interaction. Iteration over: –Analysis –Design –Prototype –Client feedback A growth model is the most realistic.

13/01/2004Lecture 11: Designing Applications19 Using design patterns Inter-class relationships are important, and can be complex. Some relationship recur in different applications. Design patterns help clarify relationships, and promote reuse.

13/01/2004Lecture 11: Designing Applications20 Pattern structure A pattern name. The problem addressed by it. How it provides a solution: –Structures, participants, collaborations. Its consequences. –Results, trade-offs.

13/01/2004Lecture 11: Designing Applications21 Decorator Augments the functionality of an object. Decorator object wraps another object. –The Decorator has a similar interface. –Calls are relayed to the wrapped object... –... but the Decorator can interpolate additional actions. Example: java.io.BufferedReader –Wraps and augments an unbuffered Reader object.

13/01/2004Lecture 11: Designing Applications22 Singleton Ensures only a single instance of a class exists. –All clients use the same object. Constructor is private to prevent external instantiation. Single instance obtained via a static getInstance method. Example: Canvas in shapes project.

13/01/2004Lecture 11: Designing Applications23 Factory method A creational pattern. Clients require an object of a particular interface type or superclass type. A factory method is free to return an implementing-class object or subclass object. Exact type returned depends on context. Example: iterator methods of the Collection classes.

13/01/2004Lecture 11: Designing Applications24 Observer Supports separation of internal model from a view of that model. Observer defines a one-to-many relationship between objects. The object-observed notifies all Observers of any state change. Example SimulatorView in the foxes- and-rabbits project.

13/01/2004Lecture 11: Designing Applications25 Observers

13/01/2004Lecture 11: Designing Applications26 Review Class collaborations and object interactions must be identified. –CRC analysis supports this. An iterative approach to design, analysis and implementation can be beneficial. –Regard software systems as entities that will grow and evolve over time.

13/01/2004Lecture 11: Designing Applications27 Review Work in a way that facilitates collaboration with others. Design flexible, extendible class structures. –Being aware of existing design patterns will help you to do this. Continue to learn from your own and others’ experiences.

A case study Whole-application development 1.0

13/01/2004Lecture 11: Designing Applications29 The case study A taxi company is considering expansion. –It operates taxis and shuttles. Will expansion be profitable? How many vehicles will they need?

13/01/2004Lecture 11: Designing Applications30 The problem description The company operates both individual taxis and shuttles. The taxis are used to transport an individual (or small group) from one location to another. The shuttles are used to pick up individuals from different locations and transport them to their several destinations. When the company receives a call from an individual, hotel, entertainment venue, or tourist organization, it tries to schedule a vehicle to pick up the fare. If it has no free vehicles, it does not operate any form of queuing system. When a vehicle arrives at a pick-up location, the driver notifies the company. Similarly, when a passenger is dropped off at their destination, the driver notifies the company.

13/01/2004Lecture 11: Designing Applications31 Amendments Purpose of the modeling suggests additions: –Record details of lost fares. –Record details of how each vehicle passes its time. These issues will help assess potential profitability.

13/01/2004Lecture 11: Designing Applications32 Discovering classes Singular nouns: company, taxi, shuttle, individual, location, destination, hotel, entertainment venue, tourist organization, vehicle, fare, pickup location, driver, passenger. Identify synonyms. Eliminate superfluous detail.

13/01/2004Lecture 11: Designing Applications33 Simplified nouns and verbs Company Operates taxis. Receives calls. Schedules a vehicle. Taxi Transports a passenger. Shuttle Transports one or more passengers. Passenger Location Vehicle Pick up individual. Arrives at pickup location. Notifies company of arrival. Notifies company of drop-off. Passenger source Calls the company.

13/01/2004Lecture 11: Designing Applications34 Scenarios Follow a pickup through from request to drop off with CRC cards. PassengerSource Collaborators Create a passenger. Passenger Request a taxi. TaxiCompany Generate pickup and Location destination.

13/01/2004Lecture 11: Designing Applications35 Designing class interfaces public class PassengerSource { /** * Have the source generate a new passenger and * request a pickup from the company. true If the request succeeds, * false otherwise. */ public boolean requestPickup(); /** * Create a new passenger. The created passenger. */ private Passenger createPassenger(); }

13/01/2004Lecture 11: Designing Applications36 Collaborators Received through a constructor: new PassengerSource(taxiCompany) Received through a method: taxiCompany.requestPickup(passenger) Constructed within the object. –Taxi company’s vehicle collection. –Some such objects may be passed as collaborators to other objects, as above.

13/01/2004Lecture 11: Designing Applications37 Outline implementation Once the interfaces are complete, the outline implementation can start. The outline implementation tests the adequacy of the interfaces. –Expect to have to correct the design. Lay down some basic tests that will be repeated as development continues.

13/01/2004Lecture 11: Designing Applications38 Iterative development Take relatively small steps towards the completion of the overall application. Mark the end of each step with a period of testing. –Regression test. –Fix errors early. –Revisit earlier design decisions, if necessary. –Treat errors-found as successes.

13/01/2004Lecture 11: Designing Applications39 Review Robust software requires thoughtful processes to be followed with integrity. –Analyze carefully. –Specify clearly. –Design thoroughly. –Implement and test incrementally. –Review, revise and learn. Nobody’s perfect!