Structured Programming and UML Overview Session 2 LBSC 790 / INFM 718B Building the Human-Computer Interface.

Slides:



Advertisements
Similar presentations
Based on Java Software Development, 5th Ed. By Lewis &Loftus
Advertisements

The Line Class Suppose you are involved in the development of a large mathematical application, and this application needs an object to represent a Line.
Requirement Analysis Week 10 INFM 603. Agenda Systems analysis –Required for complex multi-person tasks User-centered design –Multiple stakeholders complicate.
CSCI 1100/ , 6.2, 6.4 April 12, 15, 17.
Chapter 10 Introduction to Arrays
Lecture 6 b Last time: array declaration and instantiationarray declaration and instantiation array referencearray reference bounds checkingbounds checking.
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
1 Objects, Classes, and Packages “Static” Classes Introduction to Classes Object Variables and Object References Instantiating Objects Using Methods in.
Unified Modeling Language
Java Programming, 3e Concepts and Techniques Chapter 5 Arrays, Loops, and Layout Managers Using External Classes.
1 Programming for Engineers in Python Autumn Lecture 5: Object Oriented Programming.
1 Objects and Classes Introduction to Classes Object Variables and Object References Instantiating Objects Using Methods in Objects Reading for this Lecture:
Chapter Day 5. © 2007 Pearson Addison-Wesley. All rights reserved2-2 Agenda Day 5 Questions from last Class?? Problem set 1 Posted  Introduction on developing.
Web Infrastructure Week 3 INFM 603. The Key Ideas Questions Structured Programming Modular Programming Data Structures Object-Oriented Programming.
Data Structures Week 4 INFM 603. The Key Ideas Structured Programming  Modular Programming  Data Structures Object-Oriented Programming.
Aalborg Media Lab 23-Jun-15 Inheritance Lecture 10 Chapter 8.
PHP Programming Session 2 INFM 718N Web-Enabled Databases.
1 Generics and Using a Collection Generics / Parameterized Classes Using a Collection Customizing a Collection using Inheritance Inner Classes Use of Exceptions.
1 Arrays  Arrays are objects that help us organize large amounts of information  Chapter 8 focuses on: array declaration and use passing arrays and array.
Aalborg Media Lab 28-Jun-15 Software Design Lecture 8 “Arrays”
Modular Programming and Use Case Models Session 3 LBSC 790 / INFM 718B Building the Human-Computer Interface.
Software Development Process and Introduction to Java Session 1 LBSC 790 / INFM 718B Building the Human-Computer Interface.
1 Run time vs. Compile time The compiler must generate code to handle issues that arise at run time Representation of various data types Procedure linkage.
Chapter 9 Introduction to Arrays
CS 106 Introduction to Computer Science I 03 / 17 / 2008 Instructor: Michael Eckmann.
Chapter 3 Object-Oriented Analysis of Library Management System(LMS)
UML Sequence Diagrams Michael L. Collard, Ph.D. Department of Computer Science Kent State University.
Data Structures Session 8 LBSC 790 / INFM 718B Building the Human-Computer Interface.
Introduction To System Analysis and design
Distributed Teams Week 13 INFM 603. Agenda Distributed teams Project presentation prep Final exam prep.
Object-oriented Programming and Collaboration and Sequence Diagrams Session 5 LBSC 790 / INFM 718B Building the Human-Computer Interface.
Object-Oriented Analysis and Design An Introduction.
Requirements Analysis Session 12 INFM 603. Different Perspectives on Design Thanks to Satish Mishra.
Copyright © 2002, Systems and Computer Engineering, Carleton University a-JavaReview.ppt * Object-Oriented Software Development Unit.
Lecture 3 Uses Cases Topics UML Use Cases pop quiz Readings: Chapter 3 January 24, 2008 CSCE 492 Software Engineering.
Requirements Analysis Session 12 INFM 603. The System Life Cycle Systems analysis –How do we know what kind of system to build? User-centered design –How.
Information Systems Engineering
OOP in Java : © W. Milner 2005 : Slide 1 Java and OOP Part 2 – Classes and objects.
Topic 1 Object Oriented Programming. 1-2 Objectives To review the concepts and terminology of object-oriented programming To discuss some features of.
Use Case Driven Analysis Requirements Use Case Use Case Description System Sequence Diagram Chapter 5.
CSC1401 Classes - 2. Learning Goals Computing concepts Adding a method To show the pictures in the slide show Creating accessors and modifiers That protect.
Final Exam Review Session 14 LBSC 790 / INFM 718B Building the Human-Computer Interface.
Design Model Lecture p6 T120B pavasario sem.
UML Use Case Models and Modular Programming Session 3 LBSC 790 / INFM 718B Building the Human-Computer Interface.
Constructors & Garbage Collection Ch. 9 – Head First Java.
Chapter 10: Classes and Data Abstraction. Objectives In this chapter, you will: Learn about classes Learn about private, protected, and public members.
EGR 2261 Unit 11 Classes and Data Abstraction  Read Malik, Chapter 10.  Homework #11 and Lab #11 due next week.  Quiz next week.
Lecture 9-1 : Intro. to UML (Unified Modeling Language)
Chapter 3: Introducing the UML
Written by: Dr. JJ Shepherd
Array Size Arrays use static allocation of space. That is, when the array is created, we must specify the size of the array, e.g., int[] grades = new int[100];
Modular Programming and UML Class and Object Diagrams Session 4 LBSC 790 / INFM 718B Building the Human-Computer Interface.
M1G Introduction to Programming 2 2. Creating Classes: Game and Player.
Grouping Data Together Often we want to group together a number of values or objects to be treated in the same way e.g. names of students in a tutorial.
Unified Modeling Language (UML)
Programming Session 6 LBSC 690 Information Technology.
© 2004 Pearson Addison-Wesley. All rights reserved September 5, 2007 Packages & Random and Math Classes ComS 207: Programming I (in Java) Iowa State University,
Structured Programming and UML Introduction Session 2 LBSC 790 / INFM 718B Building the Human-Computer Interface.
© 2004 Pearson Addison-Wesley. All rights reserved3-1 Objects Declaration: String title;  title (object variable) of type String( Class )  title is just.
Chapter 5 Introduction to Defining Classes Fundamentals of Java.
The Movement To Objects
Java Programming: Guided Learning with Early Objects
About the Presentations
Requirements Analysis
User-Defined Classes and ADTs
Chapter 22 Object-Oriented Systems Analysis and Design and UML
Review for Midterm 3.
Corresponds with Chapter 5
Arrays.
Presentation transcript:

Structured Programming and UML Overview Session 2 LBSC 790 / INFM 718B Building the Human-Computer Interface

Agenda Questions The big picture Making java UML overview

The Big Picture ??

Language Learning Learn some words Put those words together in simple ways Examine to broaden your understanding Create to deepen your mastery Repeat until fluent

Variables Hold a reference to an object –Or the value of a primitive data type Must be declared –Generally, done at the beginning of: Classes (“instance variables”) Methods (“local variables”) –Inline declarations are allowed Local variables must be initialized!

Static Exist without using “new” –Referred to by the class name, not the object Static variables are “constants” Static methods can be invoked with no instance –This is how the main method in an application works –Static methods can’t refer to instance variables

Arrays in Java A set of elements –For example, the number of days in each month Each element is assigned an index –A number used to refer to that element For example, x[4] is the fifth element - count from zero –Arrays and loops work naturally together

Methods in Java Defining a method int multiplyNumbers (a, b){return a*b;} Argument values are local to the method Explicitly invoking a method multiplyNumbers(b, 7); Events invoke a method in response to a stimulus –Mouse click, mouseover, resize window, …

Java Objects Java objects represent specific things “new” operator “instantiates” an object –By calling a “constructor” method “Garbage collection” destroys objects

Java Classes Java classes represent types of things –Can be thought of as blueprints for objects Classes = state + actions –State is represented by variables –Actions are represented by methods Scope rules support abstract thinking –Public: can be used from other classes –Private: can only be seen in the class

Java By Example Identify the needed types of objects For each object type (“class”): –Represent the state using variables –Represent the actions using methods –Write the java code –Test it using a main method Test the entire system

Library Circulation Example A library is a collection of books –Initially, assume just one copy of each book Users can check to see if a book they want is available Users can check out and check in books

Exercise Read the Book class –Available on the session 2 notes page Create the Library class Test the two together Revise the book class for multiple copies Test the improved system

Some Things to Pay Attention To How variables are named How arrays are used How strings are used Modularity of methods How errors are handled How methods are invoked How arguments work How layout helps reading How results are passed How scope is managed How boolean flags are used How output is created How classes are defined How applications are invoked

Unified Modeling Language Systems can get more complex than people can comprehend all at once Key idea: Progressive refinement –Carve the problem into pieces –Carve each piece into smaller pieces –When the pieces are small enough, code them UML provides a formalism for doing this –But it does not provide the process

Getting to the Object Structure Capturing the big picture –Use case diagram (interactions with the world) –Narrative –Scenarios (examples to provoke thinking) Designing the object structure –Class diagram (“entity-relationship” diagram) –Object diagram (used to show examples)

Specifying Behavior Represent a candidate workflow –Activity diagram (a “flowchart”) Represent object interactions for a scenario –Collaboration diagram (object-based depiction) –Sequence diagram (time-based depiction) Represent event-object interactions –Statechart diagram (a “finite state machine”)

Good Uses for UML Focusing your attention –Design from the outside in Representing partial understanding –Says what you know, silent otherwise Validate that understanding –Structuring communication with stakeholders

Avoiding UML Pitfalls Don’t sweat the notation too much –The key is to be clear about what you mean! Don’t try to make massive conceptual leaps –Leverage abstraction encapsulation Don’t get to attached to your first design –Goal is to find weaknesses in your understanding

First Steps in UML Examine the FlightFinder – Identify the key actors Identify the use cases Draw a use case diagram

Show and Tell What cool resources have you found? –Books and Web sites? What new Java tricks have you learned? What do you need to know to make progress?

Muddiest Point On a blank sheet of paper, write a single sentence that will convey to me what you found to be the most confusing thing that was discussed during today’s class.