An Example. Unified Modelling Language - 2 ITNP090 - Object Oriented Software Design. Class diagram. Class diagram. Dr Andrea Bracciali

Size: px
Start display at page:

Download "An Example. Unified Modelling Language - 2 ITNP090 - Object Oriented Software Design. Class diagram. Class diagram. Dr Andrea Bracciali"

Transcription

1 An Example We are going to look at a small example where we input information and then ask questions about an er and their pet. Requirements are that we will be able to Unified Modelling Language - 2 ITNP090 - Object Oriented Software Design create a d er, give an er a pet with a and age, find the of the pet of a d er. Dr Andrea Bracciali Module Co-ordinator 4B86 abb@cs.stir.ac.uk We will have three classes A class to hold information about the er A class to hold information about the pet A boundary (interface) class through which we communicate with the system. This is not actually part of the real word we are modelling! 1 The classes could have a lot more methods; they can be added later. 2 Class diagram Let us now draw a UML class diagram to show the structure of the model. Class diagram Let us now draw a UML class diagram to show the structure of the model. A class diagram consists of a set of nodes, where each node represents a class. Each node has the three parts: class, attributes, operations. Associations between nodes are represented by lines between nodes. Associations between nodes are represented by lines between nodes. In the class diagram, we use arrows to show the "knows about" relationship: knows about knows about. Indeed, note that the class has a attribute of type. Associations may be labelled with arity, here - is 1:1, i.e., each has a and vice-versa. [!?] 4

2 Class diagram Let us now draw a UML class diagram to show the structure of the model. Associations between nodes are represented by lines between nodes. In the next lectures, we will look at different forms of association. Note that the interactions between a user and our system are represented in as a set of operations. Outline of the classy version public class extends Jframe implements ActionListener { private JButton new, new, get; private JTextField ername, petname, age; private,... main creategui } // End of class public class { In a Java implementation of a GUI, private ; private String ; the operations mk, mk & getname are called within the method mk getname equals... } // End of class 6 Outline of the classy version Class diagram A UML model is programming language independent. public class { private int age; private String ; The same model can be implemented in different objectoriented languages, e.g. Java and C getname... } // End of class We can use UML to: help us understand an existing program, help us design a new system/program. 7 8

3 Tracing the Program Tracing: New Let us discuss how a program corresponding to this model could work. Creating an er: The class serves as an interface with our system. As seen, it can be used to support a Graphical User Interface as user s interface. It will consists of different buttons and text fields for the supported operations. The actual design of the GUI can be decoupled from the design of the system. In our example, the method of is called in response to GUI events, such as pressing a button. This method is in charge of calling other methods, accordingly. mk Suppose that we create an er by typing into the ername text field and press the button new, then will cause a new object to be created. The value of the attribute will be and the value of the attribute will be as the er does not yet have a pet Tracing: New Tracing: New Creating an er: Creating an er: mk create: new () mk reference 11 12

4 Tracing: New Tracing: New Creating an er: Suppose that we now create a new pet by entering, Tigger and into the text fields and press the button new. An event will be generated that will cause to be called. The er s allow us to select the right object, which we previously created. Then, the mk operation of the object is called by. Executing the mk method will cause a new object to be created and to be assigned to the attribute of our object. The attribute of the new object will be Tigger and the age attribute will be. 1 This is not a class diagram (but an informal description of run-time object creation) 14 Tracing: New Tracing: New mk mk age true mk mk reference age Tigger Tigger 15 16

5 Tracing: New Tracing: Getting a Name Analogously, to find out the of a pet, we input the er's to the ername text field and press the get button. mk An event will be generated that will cause to be called, and an analogous chain of methods to be called and results to be ed throughout different objects, until the of the pet associated to the is ed to the user via the GUI (if the provided mismatches that of a suitable message will be ed). age Tigger Exercise: starting from the drafted code and the two previous examples, outline the sequence of the methods that are called as a consequence of this user request. Detail the temporal sequence of the method calls, the objects which the called methods belongs to, and the results ed by each method call Conclusion Object-oriented characteristics The class diagram shows the structure of the object oriented program. We can understand a lot about how the program works by examining its class diagram. We can even execute the class diagram to work out how we expect the program to work. You will see later that there are other UML diagrams that allow us to explicitly model the behaviour of a system, e.g. the expected 'execution' associated to a class diagram. There are several important features that make the Objectoriented approach good at developing large systems. Let us consider: Information hiding Encapsulation Abstraction Weak Coupling 19 20

6 Information hiding Principle: hide details that are not relevant outside a given boundary. Typically, distinguish between a public interface and a hidden implementation: Each class has a public part typically (some of) its methods and their parameters. Any "client" object only needs to see the public part. A client needs to be able to call a method and know what the effect will be. It does not need to know how the method is implemented. A client can therefore ignore implementation details. We can change the internal implementation of a method, but if the method still has the same effect the client need not be aware of the change. Hiding information ensures that a client object cannot become dependent on implementation details. Information hiding is central to the OO approach. 21 Encapsulation Principle: contain homogeneous information within a context, possibly hiding or controlling the access to piece(s) of such information. The client object uses the server object. All the properties (e.g. attributes) of are encapsulated within the class, i.e. all the relevant information is held together in one place and its access is controlled. The attributes and are hidden (they are private). Their values, e.g. the value of :, can only be accessed and modified, by say, via (some of) the public methods offered by (equals, mk, getname). embeds the procedures for accessing its information in the private implementation of its methods.the general rule is that a client object can only access or modify the attributes of a server object through the server object's public methods. 22 Abstraction Weak Coupling Principle: determine which information is relevant and which can be abstracted away. It is at the basis of modelling. As a process, it can be used to define how information has to be encapsulated and hidden. About the class, at a certain level of abstraction, we do not have to concern ourselves about its internal details. We just need to know how to create and manipulate objects by calling methods. We can therefore abstract away from the implementation details. This is vital so that we can understand large programs. We must not get bogged d in detail. Abstraction, encapsulation and information hiding are central to the OO approach. These concepts are quite correlated. 2 Principle: Minimise the dependencies amongst the components of a system. Suppose that you are modifying a large program. You need to change the contents of a class to improve it or correct errors. Ideally all you need to do is concentrate on that one class. You do not need to make changes in other classes as well. That is kn as weak coupling. Differently, for, when many classes directly access the same piece of information, changing the data structure that store such information, may require the reengineering of all those classes. Information hiding, encapsulation and abstraction support weak coupling: as soon as other interacting classes can maintain an abstract view of a given class, which hides and encapsulates information as much as possible, this class can be changed, provided that its original abstract view (interface) is preserved. 24

7 25

CSCU9T4: Managing Information

CSCU9T4: Managing Information CSCU9T4: Managing Information CSCU9T4 Spring 2016 1 The Module Module co-ordinator: Dr Gabriela Ochoa Lectures by: Prof Leslie Smith (l.s.smith@cs.stir.ac.uk) and Dr Nadarajen Veerapen (nve@cs.stir.ac.uk)

More information

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Lecture 14: Design Workflow Department of Computer Engineering Sharif University of Technology 1 UP iterations and workflow Workflows Requirements Analysis Phases Inception Elaboration

More information

UML IB Computer Science. Content developed by Dartford Grammar School Computer Science Department

UML IB Computer Science. Content developed by Dartford Grammar School Computer Science Department UML IB Computer Science Content developed by Dartford Grammar School Computer Science Department HL Topics 1-7, D1-4 1: System design 2: Computer Organisation 3: Networks 4: Computational thinking 5: Abstract

More information

Topic : Object Oriented Design Principles

Topic : Object Oriented Design Principles Topic : Object Oriented Design Principles Software Engineering Faculty of Computing Universiti Teknologi Malaysia Objectives Describe the differences between requirements activities and design activities

More information

About the required reading. Construction: High quality code for programming in the large. What is high quality code?

About the required reading. Construction: High quality code for programming in the large. What is high quality code? About the required reading All the reading described as required is examinable. For example, you should be able to: briefly explain concepts like process requirement, stakeholder, tacit knowledge, conceptual

More information

Object Orientated Analysis and Design. Benjamin Kenwright

Object Orientated Analysis and Design. Benjamin Kenwright Notation Part 2 Object Orientated Analysis and Design Benjamin Kenwright Outline Review What do we mean by Notation and UML? Types of UML View Continue UML Diagram Types Conclusion and Discussion Summary

More information

Produced by. Design Patterns. MSc in Computer Science. Eamonn de Leastar

Produced by. Design Patterns. MSc in Computer Science. Eamonn de Leastar Design Patterns MSc in Computer Science Produced by Eamonn de Leastar (edeleastar@wit.ie)! Department of Computing, Maths & Physics Waterford Institute of Technology http://www.wit.ie http://elearning.wit.ie

More information

Assoc. Prof. Dr. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved.

Assoc. Prof. Dr. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved. Assoc. Prof. Dr. Marenglen Biba Laboratory Session: Exercises on classes Analogy to help you understand classes and their contents. Suppose you want to drive a car and make it go faster by pressing down

More information

CSCD01 Engineering Large Software Systems. Design Patterns. Joe Bettridge. Winter With thanks to Anya Tafliovich

CSCD01 Engineering Large Software Systems. Design Patterns. Joe Bettridge. Winter With thanks to Anya Tafliovich CSCD01 Engineering Large Software Systems Design Patterns Joe Bettridge Winter 2018 With thanks to Anya Tafliovich Design Patterns Design patterns take the problems consistently found in software, and

More information

CS1004: Intro to CS in Java, Spring 2005

CS1004: Intro to CS in Java, Spring 2005 CS1004: Intro to CS in Java, Spring 2005 Lecture #13: Java OO cont d. Janak J Parekh janak@cs.columbia.edu Administrivia Homework due next week Problem #2 revisited Constructors, revisited Remember: a

More information

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Lecturer: Raman Ramsin Lecture 10: Analysis Packages 1 Analysis Workflow: Packages The analysis workflow consists of the following activities: Architectural analysis Analyze a use

More information

Ans 1-j)True, these diagrams show a set of classes, interfaces and collaborations and their relationships.

Ans 1-j)True, these diagrams show a set of classes, interfaces and collaborations and their relationships. Q 1) Attempt all the following questions: (a) Define the term cohesion in the context of object oriented design of systems? (b) Do you need to develop all the views of the system? Justify your answer?

More information

Object Oriented Software Development CIS Today: Object Oriented Analysis

Object Oriented Software Development CIS Today: Object Oriented Analysis Object Oriented Software Development CIS 50-3 Marc Conrad D104 (Park Square Building) Marc.Conrad@luton.ac.uk Today: Object Oriented Analysis The most single important ability in object oriented analysis

More information

Java How to Program, 10/e. Copyright by Pearson Education, Inc. All Rights Reserved.

Java How to Program, 10/e. Copyright by Pearson Education, Inc. All Rights Reserved. Java How to Program, 10/e Education, Inc. All Rights Reserved. Each class you create becomes a new type that can be used to declare variables and create objects. You can declare new classes as needed;

More information

CS111: PROGRAMMING LANGUAGE II. Lecture 1: Introduction to classes

CS111: PROGRAMMING LANGUAGE II. Lecture 1: Introduction to classes CS111: PROGRAMMING LANGUAGE II Lecture 1: Introduction to classes Lecture Contents 2 What is a class? Encapsulation Class basics: Data Methods Objects Defining and using a class In Java 3 Java is an object-oriented

More information

administrivia today UML start design patterns Tuesday, September 28, 2010

administrivia today UML start design patterns Tuesday, September 28, 2010 administrivia Assignment 2? promise to get past assignment 1 back soon exam on monday review slides are posted your responsibility to review covers through last week today UML start design patterns 1 Unified

More information

MechEng SE3 Lecture 7 Domain Modelling

MechEng SE3 Lecture 7 Domain Modelling MechEng SE3 Lecture 7 Domain Modelling Simon Gay (slides by Phil Gray) 17 February 2010 1 This week s supplementary reading Zero Balances and Zero Responsibility Michael Bolton http://www.developsense.com/essays/zero.html

More information

Review sheet for Final Exam (List of objectives for this course)

Review sheet for Final Exam (List of objectives for this course) Review sheet for Final Exam (List of objectives for this course) Please be sure to see other review sheets for this semester Please be sure to review tests from this semester Week 1 Introduction Chapter

More information

Lecture (06) Java Forms

Lecture (06) Java Forms Lecture (06) Java Forms Dr. Ahmed ElShafee 1 Dr. Ahmed ElShafee, Fundamentals of Programming I, Introduction You don t have to output everything to a terminal window in Java. In this lecture, you ll be

More information

Example: Fibonacci Numbers

Example: Fibonacci Numbers Example: Fibonacci Numbers Write a program which determines F n, the (n + 1)-th Fibonacci number. The first 10 Fibonacci numbers are 0, 1, 1, 2, 3, 5, 8, 13, 21, and 34. The sequence of Fibonacci numbers

More information

Lecture 34 SDLC Phases and UML Diagrams

Lecture 34 SDLC Phases and UML Diagrams That Object-Oriented Analysis and Design Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology-Kharagpur Lecture 34 SDLC Phases and UML Diagrams Welcome

More information

Construction: High quality code for programming in the large

Construction: High quality code for programming in the large Construction: High quality code for programming in the large Paul Jackson School of Informatics University of Edinburgh What is high quality code? High quality code does what it is supposed to do......

More information

Software Design Heuristics

Software Design Heuristics Software Design Heuristics Software Design Heuristics CONTENT 1. Introduction 2. Encapsulation/Information Hiding 3. Strong Cohesion 4. Loose Dr. Samira Sadaoui 1 Introduction Introduction Software Design

More information

Chapter 10 Object-Oriented Design Principles

Chapter 10 Object-Oriented Design Principles Chapter 10 Object-Oriented Design Principles Dr. Supakit Nootyaskool Faculty of Information Technology King Mongkut s Institute of Technology Ladkrabang Outline Object-oriented design: bridging from analysis

More information

Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page:

Lecturer: Sebastian Coope Ashton Building, Room G.18   COMP 201 web-page: Lecturer: Sebastian Coope Ashton Building, Room G.18 E-mail: coopes@liverpool.ac.uk COMP 201 web-page: http://www.csc.liv.ac.uk/~coopes/comp201 Lecture 17 Concepts of Object Oriented Design Object-Oriented

More information

SWEN425 DESIGN PATTERNS

SWEN425 DESIGN PATTERNS T E W H A R E W Ā N A N G A O T E Ū P O K O O T E I K A A M Ā U I VUW V I C T O R I A UNIVERSITY OF WELLINGTON EXAMINATIONS 2011 END OF YEAR SWEN425 DESIGN PATTERNS Time Allowed: 3 Hours Instructions:

More information

What is Inheritance?

What is Inheritance? Inheritance 1 Agenda What is and Why Inheritance? How to derive a sub-class? Object class Constructor calling chain super keyword Overriding methods (most important) Hiding methods Hiding fields Type casting

More information

by Pearson Education, Inc. All Rights Reserved. 2

by Pearson Education, Inc. All Rights Reserved. 2 Suppose you want to drive a car and make it go faster by pressing down on its accelerator pedal. Before you can drive a car, someone has to design it and build it. A car typically begins as engineering

More information

8. Polymorphism and Inheritance

8. Polymorphism and Inheritance 8. Polymorphism and Inheritance Harald Gall, Prof. Dr. Institut für Informatik Universität Zürich http://seal.ifi.uzh.ch/info1 Objectives Describe polymorphism and inheritance in general Define interfaces

More information

Topic 10: Introduction to OO analysis and design

Topic 10: Introduction to OO analysis and design Topic 10: Introduction to OO analysis and design Learning Outcomes Upon successful completion of this topic you will be able to: design classes define class member variables and functions explain public

More information

Object Fundamentals, Part One. Kenneth M. Anderson University of Colorado, Boulder CSCI 4448/5448 Lecture 2 08/27/2009

Object Fundamentals, Part One. Kenneth M. Anderson University of Colorado, Boulder CSCI 4448/5448 Lecture 2 08/27/2009 Object Fundamentals, Part One Kenneth M. Anderson University of Colorado, Boulder CSCI 4448/5448 Lecture 2 08/27/2009 1 Lecture Goals Introduce basic concepts, terminology, and notations for object-oriented

More information

Overview. OOP: model, map, reuse, extend. Examples of objects. Introduction to Object Oriented Design

Overview. OOP: model, map, reuse, extend. Examples of objects. Introduction to Object Oriented Design Overview Introduction to Object Oriented Design Understand Classes and Objects. Understand some of the key concepts/features in the Object Oriented paradigm. Benefits of Object Oriented Design paradigm.

More information

Computer Science II. OO Programming Classes Scott C Johnson Rochester Institute of Technology

Computer Science II. OO Programming Classes Scott C Johnson Rochester Institute of Technology Computer Science II OO Programming Classes Scott C Johnson Rochester Institute of Technology Outline Object-Oriented (OO) Programming Review Initial Implementation Constructors Other Standard Behaviors

More information

Programming II (CS300)

Programming II (CS300) 1 Programming II (CS300) Chapter 03: Creating Classes MOUNA KACEM mouna@cs.wisc.edu Spring 2018 Creating Classes 2 Constructors and Object Initialization Static versus non-static fields/methods Encapsulation

More information

Assignment 1. Application Development

Assignment 1. Application Development Application Development Assignment 1 Content Application Development Day 1 Lecture The lecture provides an introduction to programming, the concept of classes and objects in Java and the Eclipse development

More information

G51PGP Programming Paradigms. Lecture 009 Concurrency, exceptions

G51PGP Programming Paradigms. Lecture 009 Concurrency, exceptions G51PGP Programming Paradigms Lecture 009 Concurrency, exceptions 1 Reminder subtype polymorphism public class TestAnimals public static void main(string[] args) Animal[] animals = new Animal[6]; animals[0]

More information

Chapter 8 Objects and Classes

Chapter 8 Objects and Classes Chapter 8 Objects and Classes 1 Motivations After learning the preceding chapters, you are capable of solving many programming problems using selections, loops, methods, and arrays. However, these Java

More information

SINGLE EVENT HANDLING

SINGLE EVENT HANDLING SINGLE EVENT HANDLING Event handling is the process of responding to asynchronous events as they occur during the program run. An event is an action that occurs externally to your program and to which

More information

9 Working with the Java Class Library

9 Working with the Java Class Library 9 Working with the Java Class Library 1 Objectives At the end of the lesson, the student should be able to: Explain object-oriented programming and some of its concepts Differentiate between classes and

More information

Java Software Solutions for AP Computer Science 3rd Edition, Lewis et al. 2011

Java Software Solutions for AP Computer Science 3rd Edition, Lewis et al. 2011 A Correlation of AP Computer Science 3rd Edition, Lewis et al. 2011 To the INTRODUCTION This document demonstrates how AP (Advanced Placement) Computer Science, 3rd Edition 2011, Lewis et al. meets the

More information

12/22/11. Java How to Program, 9/e. public must be stored in a file that has the same name as the class and ends with the.java file-name extension.

12/22/11. Java How to Program, 9/e. public must be stored in a file that has the same name as the class and ends with the.java file-name extension. Java How to Program, 9/e Education, Inc. All Rights Reserved. } Covered in this chapter Classes Objects Methods Parameters double primitive type } Create a new class (GradeBook) } Use it to create an object.

More information

Tutorial: Functions and Functional Abstraction. Nathaniel Osgood CMPT

Tutorial: Functions and Functional Abstraction. Nathaniel Osgood CMPT Tutorial: Functions and Functional Abstraction Nathaniel Osgood CMPT 858 2-8-2011 Building the Model Right: Some Principles of Software Engineering Technical guidelines Try to avoid needless complexity

More information

Design Patterns. CSC207 Fall 2017

Design Patterns. CSC207 Fall 2017 Design Patterns CSC207 Fall 2017 Design Patterns A design pattern is a general description of the solution to a well-established problem using an arrangement of classes and objects. Patterns describe the

More information

INTERNAL ASSESSMENT TEST III Answer Schema

INTERNAL ASSESSMENT TEST III Answer Schema INTERNAL ASSESSMENT TEST III Answer Schema Subject& Code: Object-Oriented Modeling and Design (15CS551) Sem: V ISE (A & B) Q. No. Questions Marks 1. a. Ans Explain the steps or iterations involved in object

More information

Self-review Questions

Self-review Questions 7Class Relationships 106 Chapter 7: Class Relationships Self-review Questions 7.1 How is association between classes implemented? An association between two classes is realized as a link between instance

More information

MSO Exam November 7, 2016, 13:30 15:30, Educ-Gamma

MSO Exam November 7, 2016, 13:30 15:30, Educ-Gamma MSO 2016 2017 Exam November 7, 2016, 13:30 15:30, Educ-Gamma Name: Student number: Please read the following instructions carefully: Fill in your name and student number above. Be prepared to identify

More information

UML Component Diagrams A.Y 2018/2019

UML Component Diagrams A.Y 2018/2019 UML Component Diagrams A.Y 2018/2019 Component diagrams Component diagrams are integral to building your software system. Drawn out with UML diagramming software, they help your team understand the structure

More information

State Application Using MVC

State Application Using MVC State Application Using MVC 1. Getting ed: Stories and GUI Sketch This example illustrates how applications can be thought of as passing through different states. The code given shows a very useful way

More information

Imperative Languages!

Imperative Languages! Imperative Languages! Java is an imperative object-oriented language. What is the difference in the organisation of a program in a procedural and an objectoriented language? 30 class BankAccount { private

More information

Case studies: Outline Case Study: Noughts and Crosses

Case studies: Outline Case Study: Noughts and Crosses I. Automated Banking System Case studies: Outline Case Study: Noughts and Crosses II. III. Library Noughts and Crosses Definition of the problem Game played on a 3x3 square board between two players. The

More information

Lecture 1 Contracts : Principles of Imperative Computation (Fall 2018) Frank Pfenning

Lecture 1 Contracts : Principles of Imperative Computation (Fall 2018) Frank Pfenning Lecture 1 Contracts 15-122: Principles of Imperative Computation (Fall 2018) Frank Pfenning In these notes we review contracts, which we use to collectively denote function contracts, loop invariants,

More information

Object-Oriented Analysis and Design Using UML (OO-226)

Object-Oriented Analysis and Design Using UML (OO-226) Object-Oriented Analysis and Design Using UML (OO-226) The Object-Oriented Analysis and Design Using UML course effectively combines instruction on the software development processes, objectoriented technologies,

More information

CPS221 Lecture: Threads

CPS221 Lecture: Threads Objectives CPS221 Lecture: Threads 1. To introduce threads in the context of processes 2. To introduce UML Activity Diagrams last revised 9/5/12 Materials: 1. Diagram showing state of memory for a process

More information

System Modelling. Chapter CMPT 276 Dr. B. Fraser. Based on slides from Software Engineering 9th ed, Sommerville.

System Modelling. Chapter CMPT 276 Dr. B. Fraser. Based on slides from Software Engineering 9th ed, Sommerville. System Modelling Chapter 5.1-5.5 Slides #12 CMPT 276 Dr. B. Fraser 18-7-3 Based on slides from Software Engineering 9th ed, Sommerville. 1 Topics 1) Why model a system? 2) How can we model. a) the context

More information

Object-Oriented Modeling Using UML. CS151 Chris Pollett Aug. 29, 2005.

Object-Oriented Modeling Using UML. CS151 Chris Pollett Aug. 29, 2005. Object-Oriented Modeling Using UML CS151 Chris Pollett Aug. 29, 2005. Outline Objects and Classes Modeling Relationships and Structures Some Terms and Concepts Objects and classes are fundamental to OO

More information

Objectives: 1. Introduce the course. 2. Define programming 3. Introduce fundamental concepts of OO: object, class

Objectives: 1. Introduce the course. 2. Define programming 3. Introduce fundamental concepts of OO: object, class CS112 Lecture: Course Introduction Last revised 1/3/06 Objectives: 1. Introduce the course. 2. Define programming 3. Introduce fundamental concepts of OO: object, class Materials: 1. Questionnaire 2. Syllabi

More information

Object-Oriented Software Engineering Re-exam, 2012 (Also Object-Oriented Analysis, Design and Programming, Re-exam, 2012)

Object-Oriented Software Engineering Re-exam, 2012 (Also Object-Oriented Analysis, Design and Programming, Re-exam, 2012) Object-Oriented Software Engineering Re-exam, 2012 (Also Object-Oriented Analysis, Design and Programming, Re-exam, 2012) Medialogy, 4 th Semester, Aalborg Thursday 23 August 2012, 09.00 12.00 Instructions

More information

LECTURE 3: SOFTWARE DESIGN. Software Engineering Mike Wooldridge

LECTURE 3: SOFTWARE DESIGN. Software Engineering Mike Wooldridge LECTURE 3: SOFTWARE DESIGN Mike Wooldridge 1 Design Computer systems are not monolithic: they are usually composed of multiple, interacting modules. Modularity has long been seen as a key to cheap, high

More information

Programmazione. Prof. Marco Bertini

Programmazione. Prof. Marco Bertini Programmazione Prof. Marco Bertini marco.bertini@unifi.it http://www.micc.unifi.it/bertini/ Introduction Why OO Development? Improved structure of software easier to: Understand Maintain Enhance Reusable

More information

G51PGP Programming Paradigms. Lecture 008 Inner classes, anonymous classes, Swing worker thread

G51PGP Programming Paradigms. Lecture 008 Inner classes, anonymous classes, Swing worker thread G51PGP Programming Paradigms Lecture 008 Inner classes, anonymous classes, Swing worker thread 1 Reminder subtype polymorphism public class TestAnimals public static void main(string[] args) Animal[] animals

More information

The JFrame Class Frame Windows GRAPHICAL USER INTERFACES. Five steps to displaying a frame: 1) Construct an object of the JFrame class

The JFrame Class Frame Windows GRAPHICAL USER INTERFACES. Five steps to displaying a frame: 1) Construct an object of the JFrame class CHAPTER GRAPHICAL USER INTERFACES 10 Slides by Donald W. Smith TechNeTrain.com Final Draft 10/30/11 10.1 Frame Windows Java provides classes to create graphical applications that can run on any major graphical

More information

News and info. Array. Feedback. Lab 4 is due this week. It should be easy to change the size of the game grid.

News and info. Array. Feedback. Lab 4 is due this week. It should be easy to change the size of the game grid. Calculation Applet! Arrays! Sorting! Java Examples! D0010E! Lecture 11! The GUI Containment Hierarchy! Mergesort! News and info Lab 4 is due this week. It should be easy to change the size of the game

More information

Lecture 3: Java Graphics & Events

Lecture 3: Java Graphics & Events Lecture 3: Java Graphics & Events CS 62 Fall 2017 Kim Bruce & Alexandra Papoutsaki Text Input Scanner class Constructor: myscanner = new Scanner(System.in); can use file instead of System.in new Scanner(new

More information

SEEM4570 System Design and Implementation. Lecture 11 From Design to Implementation

SEEM4570 System Design and Implementation. Lecture 11 From Design to Implementation SEEM4570 System Design and Implementation Lecture 11 From Design to Implementation Introduction We learned programming and we learned UML, but separately. Now, the question is how can we translate a design

More information

POAD Book: Chapter 4: Design Patterns as Components Chapter 5: Visual Design Models

POAD Book: Chapter 4: Design Patterns as Components Chapter 5: Visual Design Models POAD Book: Chapter 4: Design Patterns as Components Chapter 5: Visual Design Models Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU Outline Chapter 4: Design Patterns

More information

Software Design and Analysis for Engineers

Software Design and Analysis for Engineers Software Design and Analysis for Engineers by Dr. Lesley Shannon Email: lshannon@ensc.sfu.ca Course Website: http://www.ensc.sfu.ca/~lshannon/courses/ensc251 Simon Fraser University Slide Set: 2 Date:

More information

Lecture 1 Contracts. 1 A Mysterious Program : Principles of Imperative Computation (Spring 2018) Frank Pfenning

Lecture 1 Contracts. 1 A Mysterious Program : Principles of Imperative Computation (Spring 2018) Frank Pfenning Lecture 1 Contracts 15-122: Principles of Imperative Computation (Spring 2018) Frank Pfenning In these notes we review contracts, which we use to collectively denote function contracts, loop invariants,

More information

Design Patterns and Frameworks Command

Design Patterns and Frameworks Command Design Patterns and Frameworks Command Oliver Haase Oliver Haase Emfra Command 1/13 Description Classification: Object-based behavioral pattern Purpose: Encapsulate a command as an object. Allows to dynamically

More information

Lecture 23: Domain-Driven Design (Part 1)

Lecture 23: Domain-Driven Design (Part 1) 1 Lecture 23: Domain-Driven Design (Part 1) Kenneth M. Anderson Object-Oriented Analysis and Design CSCI 6448 - Spring Semester, 2005 2 Goals for this lecture Introduce the main concepts of Domain-Driven

More information

Lab & Assignment 1. Lecture 3: ArrayList & Standard Java Graphics. Random Number Generator. Read Lab & Assignment Before Lab Wednesday!

Lab & Assignment 1. Lecture 3: ArrayList & Standard Java Graphics. Random Number Generator. Read Lab & Assignment Before Lab Wednesday! Lab & Assignment 1 Lecture 3: ArrayList & Standard Java Graphics CS 62 Fall 2015 Kim Bruce & Michael Bannister Strip with 12 squares & 5 silver dollars placed randomly on the board. Move silver dollars

More information

CSE 331 Software Design and Implementation. Lecture 17 Events, Listeners, Callbacks

CSE 331 Software Design and Implementation. Lecture 17 Events, Listeners, Callbacks CSE 331 Software Design and Implementation Lecture 17 Events, Listeners, Callbacks Zach Tatlock / Winter 2016 The limits of scaling What prevents us from building huge, intricate structures that work perfectly

More information

6.001 Notes: Section 17.5

6.001 Notes: Section 17.5 6.001 Notes: Section 17.5 Slide 17.5.1 Now, let's look at one example in which changing the evaluation model allows us to explore a very different kind of computational problem. Our goal is to show how

More information

Cover Page. The handle holds various files of this Leiden University dissertation

Cover Page. The handle   holds various files of this Leiden University dissertation Cover Page The handle http://hdl.handle.net/1887/22891 holds various files of this Leiden University dissertation Author: Gouw, Stijn de Title: Combining monitoring with run-time assertion checking Issue

More information

2. The object-oriented paradigm

2. The object-oriented paradigm 2. The object-oriented paradigm Plan for this section: Look at things we have to be able to do with a programming language Look at Java and how it is done there Note: I will make a lot of use of the fact

More information

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture - 33 Overloading Operator for User - Defined Types: Part 1 Welcome

More information

SE Assignment III. 1. List and explain primitive symbols used for constructing DFDs. Illustrate the use of these symbols with the help of an example.

SE Assignment III. 1. List and explain primitive symbols used for constructing DFDs. Illustrate the use of these symbols with the help of an example. SE Assignment III 1. List and explain primitive symbols used for constructing DFDs. Illustrate the use of these symbols with the help of an example. There are essentially 5 different types of symbols used

More information

Lecture 5: Java Graphics

Lecture 5: Java Graphics Lecture 5: Java Graphics CS 62 Spring 2019 William Devanny & Alexandra Papoutsaki 1 New Unit Overview Graphical User Interfaces (GUI) Components, e.g., JButton, JTextField, JSlider, JChooser, Containers,

More information

Agenda CS121/IS223. Reminder. Object Declaration, Creation, Assignment. What is Going On? Variables in Java

Agenda CS121/IS223. Reminder. Object Declaration, Creation, Assignment. What is Going On? Variables in Java CS121/IS223 Object Reference Variables Dr Olly Gotel ogotel@pace.edu http://csis.pace.edu/~ogotel Having problems? -- Come see me or call me in my office hours -- Use the CSIS programming tutors Agenda

More information

A4 Explain how the Visitor design pattern works (4 marks)

A4 Explain how the Visitor design pattern works (4 marks) COMP61532 exam Performance feedback Original marking scheme in bold, additional comments in bold italic. Section A In general the level of English was poor, spelling and grammar was a problem in most cases.

More information

ITEC 120 4/14/11. Review. Need. Objectives. GUI basics JFrame JPanel JLabel, JButton, JTextField Layout managers. Lecture 38 GUI Interactivity

ITEC 120 4/14/11. Review. Need. Objectives. GUI basics JFrame JPanel JLabel, JButton, JTextField Layout managers. Lecture 38 GUI Interactivity Review ITEC 120 Lecture 38 GUI GUI basics JFrame JPanel JLabel, JButton, JTextField Layout managers Flow / Box Border / Grid Objectives Need Add interactivity When you click on a button How does your code

More information

Throughout the exam, write concisely and underline key words or phrases. Have fun! Exam 2. Week 7 (Winter 2013). Dr. Yoder. Sec 031.

Throughout the exam, write concisely and underline key words or phrases. Have fun! Exam 2. Week 7 (Winter 2013). Dr. Yoder. Sec 031. SE1021 Exam 2 Name: You may have an 8.5x11 note sheet for this exam. No calculators or other study aids on this exam. Write your initials at the tops of the following pages and read through the exam before

More information

CS112 Lecture: Inheritance and Polymorphism

CS112 Lecture: Inheritance and Polymorphism CS112 Lecture: Inheritance and Polymorphism Last revised 4/10/08 Objectives: 1. To review the basic concept of inheritance 2. To introduce Polymorphism. 3. To introduce the notions of abstract methods,

More information

RDD and Strategy Pa.ern

RDD and Strategy Pa.ern RDD and Strategy Pa.ern CSCI 3132 Summer 2011 1 OO So1ware Design The tradi7onal view of objects is that they are data with methods. Smart Data. But, it is be.er to think of them as en##es that have responsibili#es.

More information

KF5008 Program Design & Development. Lecture 1 Usability GUI Design and Implementation

KF5008 Program Design & Development. Lecture 1 Usability GUI Design and Implementation KF5008 Program Design & Development Lecture 1 Usability GUI Design and Implementation Types of Requirements Functional Requirements What the system does or is expected to do Non-functional Requirements

More information

Defining Classes and Methods

Defining Classes and Methods Defining Classes and Methods Chapter 4 Chapter 4 1 Basic Terminology Objects can represent almost anything. A class defines a kind of object. It specifies the kinds of data an object of the class can have.

More information

Database Design Using E/R Model

Database Design Using E/R Model CS145 Lecture Notes #2 Database Design Using E/R Model Steps in Building a Database 1. Understand real-world domain being captured 2. Specify it using a database design model 3. Translate specification

More information

2.1 Introduction UML Preliminaries Class diagrams Modelling delegation... 4

2.1 Introduction UML Preliminaries Class diagrams Modelling delegation... 4 Department of Computer Science COS121 Lecture Notes Chapter 2- Memento design pattern Copyright c 2015 by Linda Marshall and Vreda Pieterse. All rights reserved. Contents 2.1 Introduction.................................

More information

Lab 4. D0010E Object-Oriented Programming and Design. Today s lecture. GUI programming in

Lab 4. D0010E Object-Oriented Programming and Design. Today s lecture. GUI programming in Lab 4 D0010E Object-Oriented Programming and Design Lecture 9 Lab 4: You will implement a game that can be played over the Internet. The networking part has already been written. Among other things, the

More information

Encapsulation. Administrative Stuff. September 12, Writing Classes. Quick review of last lecture. Classes. Classes and Objects

Encapsulation. Administrative Stuff. September 12, Writing Classes. Quick review of last lecture. Classes. Classes and Objects Administrative Stuff September 12, 2007 HW3 is due on Friday No new HW will be out this week Next Tuesday we will have Midterm 1: Sep 18 @ 6:30 7:45pm. Location: Curtiss Hall 127 (classroom) On Monday

More information

Plan. Design principles: laughing in the face of change. What kind of change? What are we trying to achieve?

Plan. Design principles: laughing in the face of change. What kind of change? What are we trying to achieve? Plan Design principles: laughing in the face of change Perdita Stevens School of Informatics University of Edinburgh What are we trying to achieve? Review: Design principles you know from Inf2C-SE Going

More information

ITP 342 Mobile App Development. Model View Controller

ITP 342 Mobile App Development. Model View Controller ITP 342 Mobile App Development Model View Controller Model-View-Controller The Model-View-Controller (MVC) design pattern assigns objects in an application one of three roles: model, view, or controller.

More information

CSC207H: Software Design SOLID. CSC207 Winter 2018

CSC207H: Software Design SOLID. CSC207 Winter 2018 SOLID CSC207 Winter 2018 1 SOLID Principles of Object-Oriented Design How do we make decisions about what is better and what is worse design? Principles to aim for instead of rules. e.g. there is no maximum

More information

Programming II (CS300)

Programming II (CS300) 1 Programming II (CS300) Chapter 03: Creating Classes MOUNA KACEM mouna@cs.wisc.edu Spring 2019 Creating Classes 2 Constructors and Object Initialization Static versus non-static fields/methods Encapsulation

More information

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Lecture 15: Refining Analysis Relationships Department of Computer Engineering Sharif University of Technology 1 Refining Analysis Relationships Relationships in analysis are converted

More information

CS121/IS223. Object Reference Variables. Dr Olly Gotel

CS121/IS223. Object Reference Variables. Dr Olly Gotel CS121/IS223 Object Reference Variables Dr Olly Gotel ogotel@pace.edu http://csis.pace.edu/~ogotel Having problems? -- Come see me or call me in my office hours -- Use the CSIS programming tutors CS121/IS223

More information

Wireless Internet Tutoring System Design Document. Nadya Belov, Dmitriy Bespalov, Ilya Braude, Immanuel Comer, Daniel Lapadat, Andrew Ragone

Wireless Internet Tutoring System Design Document. Nadya Belov, Dmitriy Bespalov, Ilya Braude, Immanuel Comer, Daniel Lapadat, Andrew Ragone Wireless Internet Tutoring System Design Document Nadya Belov, Dmitriy Bespalov, Ilya Braude, Immanuel Comer, Daniel Lapadat, Andrew Ragone Contents Introduction 4. Goals and Guidelines........................................

More information

Building custom components IAT351

Building custom components IAT351 Building custom components IAT351 Week 1 Lecture 1 9.05.2012 Lyn Bartram lyn@sfu.ca Today Review assignment issues New submission method Object oriented design How to extend Java and how to scope Final

More information

RAIK 183H Examination 2 Solution. November 10, 2014

RAIK 183H Examination 2 Solution. November 10, 2014 RAIK 183H Examination 2 Solution November 10, 2014 Name: NUID: This examination consists of 5 questions and you have 110 minutes to complete the test. Show all steps (including any computations/explanations)

More information

Lou Burnard Consulting

Lou Burnard Consulting Getting started with oxygen Lou Burnard Consulting 2014-06-21 1 Introducing oxygen In this first exercise we will use oxygen to : create a new XML document gradually add markup to the document carry out

More information

On why C# s type system needs an extension

On why C# s type system needs an extension On why C# s type system needs an extension Wolfgang Gehring University of Ulm, Faculty of Computer Science, D-89069 Ulm, Germany wgehring@informatik.uni-ulm.de Abstract. XML Schemas (XSD) are the type

More information