CS 160 and CMPE/SE 131 Software Engineering February 25 Class Meeting Department of Computer Science Department of Computer Engineering San José State.

Slides:



Advertisements
Similar presentations
Use Case Modeling SJTU. Unified Modeling Language (UML) l Standardized notation for object-oriented development l Needs to be used with an analysis and.
Advertisements

OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1/18 Use Case Analysis – continued Control Classes.
Systems Analysis and Design in a Changing World, Fourth Edition
UML – Class Diagrams.
Liang,Introduction to Java Programming,revised by Dai-kaiyu 1 Chapter 10 Object-Oriented Modeling.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 8 Slide 1 System models.
1 Lecture 2: Elaboration Tasks and Domain Modeling.
Modified from Sommerville’s originalsSoftware Engineering, 7th edition. Chapter 8 Slide 1 System models.
Copyright W. Howden1 Lecture 2: Elaboration Tasks and Domain Modeling.
CS 153: Concepts of Compiler Design August 25 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
Use Case Analysis – continued
Use Case Modeling. Use case diagram For each use case we develop  Object class diagram (with attributes only)  System sequence diagram (analysis) 
Why Analysis Process Refer to earlier chapters Models what the system will do makes it easier for understanding no environment considered (hence, system.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 12 Object-Oriented.
Chapter 4 System Models A description of the various models that can be used to specify software systems.
System models Abstract descriptions of systems whose requirements are being analysed Abstract descriptions of systems whose requirements are being analysed.
CS 151: Object-Oriented Design September 3 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron Mak
CS 160: Software Engineering October 8 Class Meeting
CS 160: Software Engineering September 10 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
1 CMPT 275 Software Engineering Requirements Analysis Phase Requirements Analysis Activity (Identifying Objects, Scenarios) Janice Regan,
Unified Modeling Language, Version 2.0
UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
©Ian Sommerville 1995/2000 (Modified by Spiros Mancoridis 1999) Software Engineering, 6th edition. Chapter 7 Slide 1 System models l Abstract descriptions.
SWE © Solomon Seifu ELABORATION. SWE © Solomon Seifu Lesson 10 Use Case Design.
Chapter 7 System models.
System models l Abstract descriptions of systems whose requirements are being analysed.
Pertemuan 19 PEMODELAN SISTEM Matakuliah: D0174/ Pemodelan Sistem dan Simulasi Tahun: Tahun 2009.
Modified by Juan M. Gomez Software Engineering, 6th edition. Chapter 7 Slide 1 Chapter 7 System Models.
Systems Analysis and Design in a Changing World, 3rd Edition
Sommerville 2004,Mejia-Alvarez 2009Software Engineering, 7th edition. Chapter 8 Slide 1 System models.
CS 153: Concepts of Compiler Design August 26 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
1 System Analysis and Design Using UML INSTRUCTOR: Jesmin Akhter Lecturer, IIT, JU.
Design Jon Walker. More UML ● What is UML again?
CS 151: Object-Oriented Design September 5 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron Mak
Example: object diagram for Scheduler, v What is wrong with this diagram? Seems like a lot of similarity between Task and UnplannedTask Can use.
Slide 1 Systems Analysis and Design With UML 2.0 An Object-Oriented Approach, Second Edition Chapter 2: Introduction to Object-Oriented Systems Analysis.
Lecture 18: Object-Oriented Design
CS 151: Object-Oriented Design October 15 Class Meeting Department of Computer Science San Jose State University Fall 2013 Instructor: Ron Mak
Systems Analysis and Design in a Changing World, Fourth Edition
Architecture View Models A model is a complete, simplified description of a system from a particular perspective or viewpoint. There is no single view.
Slide 1 Systems Analysis and Design With UML 2.0 An Object-Oriented Approach, Second Edition Chapter 2: Introduction to Object-Oriented Systems Analysis.
DESIGN OF SOFTWARE ARCHITECTURE
1 Unified Modeling Language, Version 2.0 Chapter 2.
Chapter 5 System Modeling. What is System modeling? System modeling is the process of developing abstract models of a system, with each model presenting.
Analysis Yaodong Bi. Introduction to Analysis Purposes of Analysis – Resolve issues related to interference, concurrency, and conflicts among use cases.
UML - Development Process 1 Software Development Process Using UML.
OOD OO Design. OOD-2 OO Development Requirements Use case analysis OO Analysis –Models from the domain and application OO Design –Mapping of model.
OO DomainModeling With UML Class Diagrams and CRC Cards Chapter 6 Princess Nourah bint Abdulrahman University College of Computer and Information Sciences.
CS 160 and CMPE/SE 131 Software Engineering February 18 Class Meeting Department of Computer Science Department of Computer Engineering San José State.
7 Systems Analysis – ITEC 3155 The Object Oriented Approach – Use Cases.
Basic Characteristics of Object-Oriented Systems
CS 160 and CMPE/SE 131 Software Engineering March 8 Class Meeting Department of Computer Science Department of Computer Engineering San José State University.
Chapter 5 – System Modeling Lecture 1 1Chapter 5 System modeling.
CMPE 135: Object-Oriented Analysis and Design August 31 Class Meeting
UML Diagrams: Class Diagrams The Static Analysis Model
CMPE 280 Web UI Design and Development August 29 Class Meeting
CS 153: Concepts of Compiler Design August 29 Class Meeting
Systems Analysis and Design With UML 2
Chapter 11 Object-Oriented Design
Systems Analysis and Design With UML 2
OO Domain Modeling With UML Class Diagrams and CRC Cards
CMPE 152: Compiler Design August 23 Class Meeting
Software Engineering System Modeling Chapter 5 (Part 1) Dr.Doaa Sami
CMPE 152: Compiler Design January 29 Class Meeting
CMPE/SE 131 Software Engineering February 16 Class Meeting
Design Yaodong Bi.
CMPE 135: Object-Oriented Analysis and Design March 14 Class Meeting
Software Development Process Using UML Recap
CMPE/SE 131 Software Engineering March 7 Class Meeting
CMPE/SE 131 Software Engineering February 22 Class Meeting
Presentation transcript:

CS 160 and CMPE/SE 131 Software Engineering February 25 Class Meeting Department of Computer Science Department of Computer Engineering San José State University Spring 2016 Instructor: Ron Mak

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 2 Analysis  Identifying the three types of objects of a MVC application architecture is part of analysis.

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 3 MVC Implementation: Loose Coupling  Keep the implementations of the three objects types separate.  Each type of objects does not depend on how the other types are implemented.  Your application is more robust (resilient to change).

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 4 Analysis Goal  Build an analysis model of the application that you’re developing that is correct, complete, consistent, and unambiguous.  Model building is a highly iterative and incremental activity.  The model describes the application domain.  Developers work with clients to update the functional specification as they discover new requirements. Don’t confuse the uses of the word model in Model-View-Controller and analysis model.

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 5 Analysis Model Submodels 1. Functional model Use cases UML use case diagrams and descriptions 2. Object model Derive objects from the use cases Precursor for system design UML class and object diagrams 3. Dynamic model Behavior of the system UML sequence diagrams and statecharts

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 6 MVC Model Objects  Represent persistent information maintained by your application. AKA entity objects  Examine the participating objects in your use case descriptions.  Map parts of speech (nouns, ‘doing’ verbs, ‘having’ verbs, ‘being’ verbs, adjectives, etc.) to model components (classes, objects, operations, attributes, relationships, etc.)

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 7 MVC Model Objects, cont’d Color, size, positionAttributeAdjective Must be, shall beConstraintsModal verb Has a, consists of, includesAggregation‘Having’ verb Is a kind of, is one of eitherInheritance‘Being’ verb Creates, submits, selectsOperation‘Doing’ verb PolicemanClassCommon noun AliceObjectProper noun ExampleModel ComponentPart of Speech

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 8 MVC View Objects  System interface with the actors. View objects represent user interface components. Continue to use user-level terms.  In each use case, each actor interacts with at least one view object.  A view object collects information from the actor in a form that the model and controller objects can use.

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 9 MVC Controller Objects  Coordinate the model and view objects. Often have no physical counterpart in the real world. Closely related to a use case. Collect information from view objects for dispatch to model objects. This is how user-entered data can update the model.  Represent application control flows.

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 10 Example: Bank ATM System Log in customer Display balance Shut down ATM Start up ATM Log out customer Withdraw cash Operator Customer Bank

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 11 Example: Bank ATM System, cont’d  Model objects operator customer bank account cash  View objects display options (withdraw cash, deposit check, etc.) messages  Controller objects Start up controller (“Start up ATM” use case) User verification controller (“Log in customer” use case) Withdrawal controller (“Withdraw cash” use case) Log in customer Display balance Shut down ATM Start up ATM Log out customer Withdraw cash Operator Customer Bank

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 12 Example Dynamic Model: ATM Cash Withdrawal Customer “Withdraw cash”KeypadBank Account Display select notify display confirmation enter amount notify verify accept notify display bank ads notify dispense cash TIMETIME UML Sequence Diagram

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 13 Dynamic Model: UML Sequence Diagram  A UML sequence diagram represents how the behavior of a use case is distributed among the participating objects.

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 14 Dynamic Model: UML Sequence Diagram, cont’d  Columns of the diagram represent the objects.  Horizontal arrows from one column to another represent messages or stimuli sent from one object to another (method invocations).  Receiving a message by an object triggers the object to activate an operation.  Vertical rectangles represent the duration of an operation’s activation.  Time proceeds from top to bottom.

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 15 Dynamic Model: UML Statechart Diagram  A UML statechart diagram represents the behavior of the system from the perspective of a single object.

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 16 Dynamic Model: UML Statechart Diagram, cont’d  Developers and clients may identify new behaviors (and new requirements).  Create statechart diagrams only for objects with extended lifetimes and state-dependent behavior always for controller objects sometimes for model objects almost never for view objects

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 17 Example: Customer Withdraws Cash from ATM Logged in Card accepted Reading bank ads Has cash swipe bank card enter PIN enter withdrawal amountget cash leave UML Statechart Diagram Customer’s Perspective

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 18 Object Model Associations  An association is a relationship between two or more classes.

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 19 Object Model Associations, cont’d  Draw a line between two classes in a UML class diagram to show a relationship. Clarify the object model by making relationships explicit. Discover constraints associated with relationships. An association can have a name. You can show roles and multiplicities at each end.  Do not overdo showing associations. Team member Use case writes authorartifact 1 *

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 20 Aggregations and Compositions  An aggregation is an “ownership” or “has a” association. Although there is a strong association between the object and its owner, the object can exist on its own. An object can change owners or have several owners.  A composition is a “made up of” association. The constituent objects generally would not exist alone. This is the strongest association. PageBook aggregationcomposition Student Shelf

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 21 Generalization  Generalization is a special association that consolidates common attributes or behavior among classes.  Subclasses inherit attributes and behavior from their superclasses. Person InstructorStudent subclasses superclass

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 22 Attributes  An attribute is a property of an object. An association with another object is not an attribute.  Attributes are the least stable part of an object model. Attributes often change or are discovered late. At the beginning, it’s not necessary for attributes to describe fine details. Student gender : {male, female} id : String year : integer Methods will go hereAttributesClass name

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 23 System Design  System design is the transformation of your analysis model into a system design model.  This is the design of your entire web application.

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 24 System Design Goal  A model that includes a subsystem decomposition and descriptions of chosen development strategies: hardware/software strategy persistent data management strategy global control flow access control policy boundary conditions handling

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 25 System Design (cont’d)  The system design model is a key part of your Design Specification document. √ √ √ √ YOU ARE HERE!

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 26 Example: Designing a Compiler A compiler for a programming language is a complex program!

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 27 Compiler Requirements  Functional It must translate a source program written in a high-level programming language. It must interpret the source program by executing it. It must compile the source program into machine code.  Nonfunctional Both the interpreter and the compiled code shall run on any Java platform. The translator framework shall support translating multiple programming languages.

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 28 Software Architecture  Software architecture is a description of system decomposition global control flow boundary condition handling inter-subsystem communication protocols

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 29 Partitioning  Partition a system into subsystems.  Partitioning is way to decompose a system in order to deal with complexity.  Each subsystem is responsible for a different set of services.

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 30 Translator Partitions front endintermediate tierback end  Front end parsing and scanning services  Intermediate tier symbol table and parse tree services  Back end execution (interpreter) services and code generation (compiler) services UML package diagrams

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 31 Coupling  Coupling refers to the number of associations (dependencies) between two subsystems. front endintermediate tierback end

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 32 Coupling, cont’d  Goal: Loose coupling.  Loosely-coupled subsystems are relatively independent of each other.  Another way to deal with change. Changes to one subsystem have little impact on the other subsystems. front endintermediate tierback end

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 33 front endintermediate tierback end Translator Framework Classes Processor Code Generator Executor Parser Scanner Token Symbol Table Parse Tree  Build the framework classes first. These classes will hold your application together.  Building them first will ensure that your architecture is sound and that the major components will work together. Rails scaffolding.

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 34 front endintermediate tierback end Translator Framework Classes, cont’d Processor Code Generator Executor Parser Scanner Token Symbol Table Parse Tree  As soon as possible, establish the initial thread of control through the framework classes.  The initial implementations are simple skeletons that don’t do much.  From then on, you will always build on code that already works.

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 35 Cohesion  Cohesion is the number of associations (dependencies) within a subsystem. front endintermediate tierback end Processor Code Generator Executor Parser Scanner Token Symbol Table Parse Tree

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 36 Cohesion, cont’d  Goal: High cohesion  A subsystem with high cohesion contains objects that are related to each other and perform similar tasks.  A subsystem with low cohesion contains unrelated objects. front endintermediate tierback end Processor Code Generator Executor Parser Scanner Token Symbol Table Parse Tree

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 37 Services  A service is a set of related operations that share a common purpose.  A subsystem is characterized by the services it provides to the other subsystems.  The provided services form the subsystem interface.

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 38 Services, cont’d  Later, during object design, the subsystem interface is the basis for the application programmer interface (API).  The Façade Design Pattern can encapsulate a subsystem with a simple, unified interface.

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 39 Translator Front End Services front end Parser Scanner Token FrontEnd readSourceLine() : String generateParseTree() : Node handleSyntaxError() Façade

Computer Science Dept. Spring 2016: February 25 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 40 Tradeoff between Coupling and Cohesion  Increase cohesion by decomposing the system into smaller subsystems. (Good)  More subsystems  more interfaces which increases coupling. (Bad)  Use the 7 ± 2 heuristic. No more than 7 ± 2 subsystems at any one level of abstraction. No more than 7 ± 2 services in any one subsystem.