Unit 1: Java and Eclipse UML. Depending on the source, the acronym UML is said to stand for “unified modeling language” or “universal modeling language”.

Slides:



Advertisements
Similar presentations
Computer Science Dept. Fall 2003 Object models Object models describe the system in terms of object classes An object class is an abstraction over a set.
Advertisements

CIT731: Database Development Object Oriented Modeling (OOM)
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 9 Slide 1 Appendix 3 Object-Oriented Analysis and Design.
Systems Analysis and Design 8th Edition
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 8 Slide 1 System modeling 2.
Unified Modeling Language
Object-Oriented Analysis and Design
Department of Computing
Chapter 15: System Modeling with UML
Systems Analysis and Design in a Changing World, Fourth Edition
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 5: Restaurant.
UML – Class Diagrams.
Design Patterns in Java Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
1 UML – an overview What is UML? UML stands for Unified Modelling Language. ”The Unified Modelling Language is a visual language for specifying, constructing.
© 2005 Prentice Hall4-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
Component and Deployment Diagrams
Systems Analysis & Design Sixth Edition Systems Analysis & Design Sixth Edition Toolkit Part 5.
* Calls to methods may have implicit parameters. * Explicit parameters may not be needed because the method has the implicit parameter to work with. *
Chapter 13: Object-Oriented Programming
System Analysis and Design
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation (Adapted) Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra,
WHAT IS INHERITANCE? Java Unit 11: Inheritance I.
Chapter 7: The Object-Oriented Approach to Requirements
UML for Java Programmers Object Mentor, Inc. Copyright  by Object Mentor, Inc All Rights Reserved
Software Engineering 2003 Jyrki Nummenmaa 1 USE CASES In this lecture: Use cases - What are use cases? - Why to use use cases? - How to write.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 2: Modelling.
Software Engineering – University of Tampere, CS DepartmentJyrki Nummenmaa USE CASES In this lecture: Use cases - What are use.
CSCI-383 Object-Oriented Programming & Design Lecture 9.
Unit 1: Java Introduction and Eclipse Kirk Scott.
Analyzing the Requirements with Formal Specifications Vienna Development Method Specification Language (VDM-SL) Book: Formal Software Development From.
Starting Out With Java 5 (Control Structures to Objects) Chapter 6 By Tony Gaddis Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
4.1 Instance Variables, Constructors, and Methods.
Unit 4 Prototype Summary prepared by Kirk Scott 1.
An Introduction to Java Chapter 11 Object-Oriented Application Development: Part I.
Design Patterns in Java Chapter 1 Introduction Summary prepared by Kirk Scott 1.
Programming in Java Unit 3. Learning outcome:  LO2:Be able to design Java solutions  LO3:Be able to implement Java solutions Assessment criteria: 
Object-Oriented Analysis and Design Fall 2009.
Systems Analysis & Design 7 th Edition Chapter 5.
To navigate the slide presentation, use the navigation bar on the left OR use your right and left arrow keys. Move your mouse over the key terms throughout.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 15 System Modeling with the UML.
Systems Analysis and Design 8 th Edition Chapter 6 Object Modeling.
Object-Oriented Design Simple Program Design Third Edition A Step-by-Step Approach 11.
UML Use Case Diagramming Guidelines. What is UML? The Unified Modeling Language (UML) is a standard language for specifying, visualizing, constructing,
1 Class Diagrams: The Essentials. 2 Terms and Concepts A class is... The most important building block of any object-oriented system. A description of.
Modeling system requirements. Purpose of Models Models help an analyst clarify and refine a design. Models help simplify the complexity of information.
An Introduction to the Unified Modeling Language
Course Instructor: Kashif Ihsan 1. Chapter # 3 2.
Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott.
Object-Oriented Analysis and Design with the Unified Process by Şensev Alicik.
Data Structures and Algorithms Dr. Tehseen Zia Assistant Professor Dept. Computer Science and IT University of Sargodha Lecture 1.
Systems Analysis and Design in a Changing World, Fourth Edition
M1G Introduction to Programming 2 3. Creating Classes: Room and Item.
UML Part 1: Class Diagrams. Introduction UML stands for Unified Modeling Language. It represents a unification of the concepts and notations presented.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Object-Oriented Software Engineering Practical Software Development using UML and Java Modelling with Classes.
Object Oriented Programming and Data Abstraction Earl Huff Rowan University.
7 Systems Analysis – ITEC 3155 The Object Oriented Approach – Use Cases.
11 Systems Analysis and Design in a Changing World, Fifth Edition.
CS16: UML’s Unified Modeling Language. UML Class Diagram A UML class diagram is a graphical tool that can aid in the design of a class. The diagram has.
CS 350 – Software Design UML – The Unified Modeling Language – Chapter 2 The Unified Modeling Language is a visual language used to create models of programs.
Data Modeling Using the Entity- Relationship (ER) Model
Evolution of UML.
Object-Oriented Analysis and Design
Unified Modeling Language
A first Look at Classes.
CIS 375 Bruce R. Maxim UM-Dearborn
Chapter 5.
CIS 375 Bruce R. Maxim UM-Dearborn
Uml diagrams In ooad.
Presentation transcript:

Unit 1: Java and Eclipse UML

Depending on the source, the acronym UML is said to stand for “unified modeling language” or “universal modeling language”. In any case, it is a set of conventions that can be used to diagram object-oriented software. It is possible to pictorially represent things like classes and their methods and instance variables; objects of those classes; relationships between classes; and so on.

These notes will not give complete coverage of UML. However, at various points in the presentation of Java it may be helpful to represent an idea or relationship visually. In those cases, the corresponding UML notation will be introduced and used for that purpose.

UML has a vocabulary as well as a set of visual symbols which are used to represent object- oriented components. The terms “class” and “object” have already been used in these notes. These terms are used to mean the same thing in UML.

The terms “instance variable” and “method” have already been introduced. The corresponding terms in UML are “attribute” and “operation”. There is more than one object-oriented language. UML is neutral. An object-oriented program in any of these languages could be described using UML terminology.

Since this book only covers Java, the terms “instance variable” and “method” will continue to be used. It should be noted that in the official Java documentation, the term “field” is used for “instance variable”. Since this is the term chosen by the language designers, in some sense it may be more technically correct. However, the term “field” may be confusing because it has other uses in various programming environments. “Instance variable” will be used instead because it is more descriptive.

In order to illustrate UML, it is necessary to have an example. It is possible to introduce such an example and talk about object-oriented ideas without even knowing any Java. The example which will be continued throughout the notes is based on the following idea: It is possible to store seeds in a cup.

This may seem a little impractical. You typically think of a cup as containing a liquid, and it’s not clear what kinds of interesting programs you might write involving cups and seeds. Any introductory example of a class would tend to be impractical anyway. The cup and seed example is given because it is a component of a game program which is developed later on in the notes.

Classes and objects are represented using rectangles in UML. Relationships are represented using labels, lines, arrowheads, and other symbols. In its simplest form, a class can be represented by a rectangle containing the name of the class. The name is capitalized and given in bold face. For example, this would represent the Cup class:

An object of a given class would have a name of its own. Say an instance is known as “my coffee mug”. It is also represented by a rectangle. The name is not capitalized. It is followed by a colon and the name of the class it is an instance of. All of this is underlined. For example:

The relationship between the class and the object can be graphically shown with an arrow. It turns out that in UML different kinds of relationships are shown with different kinds of arrows, so the form of the arrow is important. This relationship is shown with a dashed arrow with an open, or feathered arrowhead. The arrow points from the object to the class.

More detail about a class can be given by including its attributes and operations in the diagram. In general, such a class diagram takes this form:

To be specific, let the Cup class have one instance variable, named seedCount. Let the class have two methods, setSeedCount() and getSeedCount(). Let the seedCount be an integer, and when a new instance of the class is created, let its seedCount be initialized to the value 0. The setSeedCount() method assigns a value to the seedCount of an object. The getSeedCount() method returns the value currently stored in the seedCount variable, whatever that may be. This information is shown in this more complete form of the class diagram:

It is also possible to give even more detail, including information about the parameter of the setSeedCount() method, ranges of valid values, or other information, for example. The diagrams are used to document a software system, a program, or its components. The level of detail included should be gauged to be helpful to the intended reader of the diagram, whether a designer, a programmer, or a program user.

Section Summary UML is used for diagramming object-oriented programs. UML has a vocabulary for the components of classes. Java has its own, parallel vocabulary for the components of classes. The cup and seed example is used for the purposes of illustration.

In UML classes and objects are represented by rectangles and relationships are represented by arrows and other symbols and labels. A simple class diagram is a rectangle containing the capitalized name of the class in bold face. A simple object diagram is a rectangle containing the name of the object followed by a colon and the name of its class, all in bold face.

The relationship between an object and its class can be shown by a dashed arrow with an open arrowhead from the object to the class. A more complete class diagram includes the class’s attributes and operations, possibly along with more detailed information. The level of detail in diagrams can vary.

Vocabulary UML. Attribute. Instance variable. Field. Operation. Method.