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

Slides:



Advertisements
Similar presentations
BUSINESS DRIVEN TECHNOLOGY Plug-In T4 Designing Database Applications.
Advertisements

Database Systems: Design, Implementation, and Management Tenth Edition
Introduction to Databases
Introduction to Database Management  Department of Computer Science Northern Illinois University January 2001.
Object-Oriented Analysis and Design
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
File Systems and Databases
3-1 Chapter 3 Data and Knowledge Management
1 Lecture 2: Elaboration Tasks and Domain Modeling.
The University of Akron Dept of Business Technology Computer Information Systems Database Management Approaches 2440: 180 Database Concepts Instructor:
APPENDIX C DESIGNING DATABASES
Chapter One Overview of Database Objectives: -Introduction -DBMS architecture -Definitions -Data models -DB lifecycle.
LECTURE 2 DATABASE SYSTEM CONCEPTS AND ARCHITECTURE.
DeSiamorewww.desiamore.com/ifm1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
CSE314 Database Systems Data Modeling Using the Entity- Relationship (ER) Model Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson Ed Slide Set.
 Introduction Introduction  Purpose of Database SystemsPurpose of Database Systems  Levels of Abstraction Levels of Abstraction  Instances and Schemas.
Systems Analysis and Design in a Changing World, Fifth Edition
1 CMPT 275 High Level Design Phase Architecture. Janice Regan, Objectives of Design  The design phase takes the results of the requirements analysis.
An Introduction to Software Architecture
CS 160: Software Engineering October 8 Class Meeting
Chapter 1 Overview of Database Concepts Oracle 10g: SQL
CST203-2 Database Management Systems Lecture 2. One Tier Architecture Eg: In this scenario, a workgroup database is stored in a shared location on a single.
1 Introduction to Database Systems. 2 Database and Database System / A database is a shared collection of logically related data designed to meet the.
Copyright (c) 2014 Pearson Education, Inc. Introduction to Databases.
Concepts and Terminology Introduction to Database.
CS 160: Software Engineering September 10 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
Lecture 2 An Overview of Relational Database IST 318 – DB Admin.
Database Management System Prepared by Dr. Ahmed El-Ragal Reviewed & Presented By Mr. Mahmoud Rafeek Alfarra College Of Science & Technology Khan younis.
CMPE 226 Database Systems September 16 Class Meeting Department of Computer Engineering San Jose State University Fall 2015 Instructor: Ron Mak
5 Systems Analysis and Design in a Changing World, Fourth Edition.
CS 174: Web Programming September 21 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
I Information Systems Technology Ross Malaga 4 "Part I Understanding Information Systems Technology" Copyright © 2005 Prentice Hall, Inc. 4-1 DATABASE.
Lab 04.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 Domain Classes.
Modified by Juan M. Gomez Software Engineering, 6th edition. Chapter 7 Slide 1 Chapter 7 System Models.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
Sommerville 2004,Mejia-Alvarez 2009Software Engineering, 7th edition. Chapter 8 Slide 1 System models.
7-1 © Prentice Hall, 2007 Chapter 7: Conceptual Data Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Unit 3 Conceptual Data Modeling. Key Concepts Conceptual data modeling process Classes and objects Attributes Identifiers, candidate keys, and primary.
Lecture # 3 & 4 Chapter # 2 Database System Concepts and Architecture Muhammad Emran Database Systems 1.
Lesson Overview 3.1 Components of the DBMS 3.1 Components of the DBMS 3.2 Components of The Database Application 3.2 Components of The Database Application.
IS 325 Notes for Wednesday August 28, Data is the Core of the Enterprise.
INFO1408 Database Design Concepts Week 15: Introduction to Database Management Systems.
DeSiamorePowered by DeSiaMore1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
5 Systems Analysis and Design in a Changing World, Fifth Edition.
Msigwaemhttp//:msigwaem.ueuo.com/1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
CS 151: Object-Oriented Design September 5 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron Mak
ITEC 3220A Using and Designing Database Systems Instructor: Prof Z. Yang Course Website: 3220a.htm
Object Oriented Analysis and Design Class and Object Diagrams.
Object storage and object interoperability
Copyright (c) 2014 Pearson Education, Inc. Introduction to DBMS.
Entity Relationship Diagram (ERD). Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship.
CMPE 226 Database Systems February 16 Class Meeting Department of Computer Engineering San Jose State University Spring 2016 Instructor: Ron Mak
CS 160 and CMPE/SE 131 Software Engineering February 25 Class Meeting Department of Computer Science Department of Computer Engineering San José State.
CS 160 and CMPE/SE 131 Software Engineering March 10 Class Meeting Department of Computer Science Department of Computer Engineering San José State University.
CS 160 and CMPE/SE 131 Software Engineering March 15 Class Meeting Department of Computer Science Department of Computer Engineering San José State University.
Rationale Databases are an integral part of an organization. Aspiring Database Developers should be able to efficiently design and implement databases.
5 Systems Analysis and Design in a Changing World, Fourth Edition.
Business System Development
CMPE 226 Database Systems February 21 Class Meeting
CS 174: Server-Side Web Programming February 12 Class Meeting
CMPE 152: Compiler Design August 23 Class Meeting
An Introduction to Software Architecture
ITEC 3220A Using and Designing Database Systems
Database Design Hacettepe University
CMPE/SE 131 Software Engineering March 9 Class Meeting
CMPE 152: Compiler Design January 29 Class Meeting
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 March 8 Class Meeting Department of Computer Science Department of Computer Engineering San José State University Spring 2016 Instructor: Ron Mak

Computer Science Dept. Spring 2016: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak Free IDE for Ruby and Rails  RubyMine 2

Computer Science Dept. Spring 2016: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 3 System Design  The system design model is a key part of your Design Specification document. √ √ √ √ YOU ARE HERE!

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

Computer Science Dept. Spring 2016: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 5 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: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 6 Use Case Diagram: Bank ATM System  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: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 7 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: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 8 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: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 9 Object Model Associations  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: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 10 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: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 11 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: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 12 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: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 13 Cohesion  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: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 14 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.

Computer Science Dept. Spring 2016: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 15 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: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 16 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: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 17 Translator Front End Services front end Parser Scanner Token FrontEnd readSourceLine() : String generateParseTree() : Node handleSyntaxError() Façade

Computer Science Dept. Spring 2016: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 18 Layering  A layer is a group of subsystems that provide related services.  Yet another dimension along which to slice your application to deal with complexity.

Computer Science Dept. Spring 2016: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 19 Layering, cont’d  A hierarchical decomposition of a system creates an ordered set of layers.  Subsystems in one layer may use services in a lower layer.  Closed architecture: Each layer can access only the layer immediately below it.  Open architecture: Each layer can also access layers at deeper levels. Do not confuse “open architecture” with “open source”.

Computer Science Dept. Spring 2016: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 20 XMLC++Java Translator Front End Layering Is this an open or closed architecture? front end Parser StmtParser ExprParser CppParserJavaParserXmlParser Parser layerStatement layerExpression layer

Computer Science Dept. Spring 2016: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 21 Model-View-Controller

Computer Science Dept. Spring 2016: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 22 Data Independence  Goal: Loose coupling between applications and the data repository. Manage complexity. Manage change.  Applications should not need to know: Where the data is stored (location of the repository) How it is stored (file formats and organizations, etc.) Access mechanisms

Computer Science Dept. Spring 2016: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 23 Back-End Data Repository Issues  Redundancy and inconsistency Multiple copies of data (good for backup) Different versions that don’t match (bad) Consistent updates and deletions  Access How to access data Timeliness  Disparity Data stored in multiple and scattered locations Data stored in different formats and media

Computer Science Dept. Spring 2016: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 24 Back-End Data Repository Issues, cont’d  Concurrency Handle multiple clients accessing and updating the data simultaneously.  Security Prevent unauthorized accesses and updates.  Integrity Data values must meet constraints.  Example: Minimum and maximum value ranges Data values must agree with each other.  Example: Medical records for a male patient should not include pregnancy data.

Computer Science Dept. Spring 2016: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak Database System Architecture  Database system: A computer-based system that enables efficient interaction between users and information stored in a database. 25 Database Systems by Jukić, Vrbsky, & Nestorov Pearson 2014 ISBN

Computer Science Dept. Spring 2016: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak Steps to Develop a Database  It’s an iterative process! 26 Database Systems by Jukić, Vrbsky, & Nestorov Pearson 2014 ISBN

Computer Science Dept. Spring 2016: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak Database Requirements  First and most critical step: Collect, define, and visualize requirements.  What data will the database hold and how?  What will be the capabilities and functionalities of the database?  Use the requirements to model and implement the database and to create the front-end applications. 27

Computer Science Dept. Spring 2016: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 28 Data Modeling  A data model is a diagram that shows what data an application works with and how the data is used. Model data that will be persisted (written to and read from a data repository). In the Model-View-Controller architecture, generally only the model objects are persisted.  For databases, objects are called entities. Model entities and their relationships to each other. Similar to classes and their relationships.

Computer Science Dept. Spring 2016: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak Conceptual Database Model  Visualize the requirements.  Use a conceptual data modeling technique. Example: Entity-relationship (ER) modeling  Implementation independent: No dependencies on the logic of a particular database management system (DBMS). Example DBMS: Oracle, MySQL, etc.  Blueprint for the logical model. 29

Computer Science Dept. Spring 2016: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak Logical Database Model  Create the relational database model as the logical model.  It’s usually straightforward to map an ER model to a relational model. 30

Computer Science Dept. Spring 2016: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak Physical Database Model  The physical model is the actual database implementation.  Use relational DBMS (RDBMS) software.  Structured Query Language (SQL) commands to create, delete, modify, and query database structures. 31

Computer Science Dept. Spring 2016: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak Conceptual DB Model: Entities and Attributes  Entity Represents a real-world concept.  Examples: customer, product, store, event, etc. Data that the database stores.  Attribute Characteristic of an entity that the database stores.  Examples (for a customer): name, address, id, etc. A unique attribute of an entity has a value that is different for each entity instance. 32

Computer Science Dept. Spring 2016: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 33 Conceptual Data Model Example  Student, teacher, class, and contact info entities and their attributes. Student  id  first name  last name  contact info Teacher  id  first name  last name  contact info Class  class code  subject name  classroom number  which teacher Contact info  id  address

Computer Science Dept. Spring 2016: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 34 Conceptual Data Model Example, cont’d  Sample queries (derived from use cases) What teachers does this student have? What classes does this teacher teach? Who is the teacher of this class? Which students are in this class? Which students are in each of the classes taught by this teacher?

Computer Science Dept. Spring 2016: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak Entities and Attributes, cont’d  In an ER diagram (ERD), show an entity with a rectangle and its attributes with ovals. Underline the unique attribute. 35

Computer Science Dept. Spring 2016: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak Relationships  Each entity in an ER diagram must be related to at least one other entity.  Show a relationship with a diamond and connect the diamond to the entities that are part of the relationship. 36 Database Systems by Jukić, Vrbsky, & Nestorov Pearson 2014 ISBN

Computer Science Dept. Spring 2016: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak Relationship Cardinality  Show cardinality (how many instances of an entity) with symbols at the end of the relationship lines. Maximum symbol closest to the entity. Minimum symbol further away. Zero, one, many 37 Database Systems by Jukić, Vrbsky, & Nestorov Pearson 2014 ISBN

Computer Science Dept. Spring 2016: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak Relationship Cardinality, cont’d  Read each relationship in both directions in this order: rectangle diamond cardinality rectangle 38 Database Systems by Jukić, Vrbsky, & Nestorov Pearson 2014 ISBN

Computer Science Dept. Spring 2016: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak Free Design Drawing Tool for Database Design  ERDPlus: 39

Computer Science Dept. Spring 2016: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak An Example ER Diagram 40 Database Systems by Jukić, Vrbsky, & Nestorov Pearson 2014 ISBN

Computer Science Dept. Spring 2016: March 8 CS 160 and CMPE/SE 131: Software Engineering © R. Mak Another Example ER Diagram 41 Database Systems by Jukić, Vrbsky, & Nestorov Pearson 2014 ISBN