Introduction (1) Chapter 1 (1) Object-Oriented Modeling and Design Byung-Hyun Ha

Slides:



Advertisements
Similar presentations
 2005 Pearson Education, Inc. All rights reserved Introduction.
Advertisements

INSTRUCTOR: SHIH-SHINH HUANG Windows Programming Using Java Chapter4: Control Statements Part I.
Introduction To System Analysis and Design
Liang,Introduction to Java Programming,revised by Dai-kaiyu 1 Chapter 10 Object-Oriented Modeling.
CMT Programming Software Applications
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. COMPSCI 125 Introduction to Computer Science I.
HST 952 Computing for Biomedical Scientists Lecture 2.
Datalogi A 1: 8/9. Book: Cay Horstmann: Big Java or Java Consepts.
CS31: Introduction to Computer Science I Discussion 1A 4/2/2010 Sungwon Yang
Objects & Object-Oriented Programming (OOP) CSC 1401: Introduction to Programming with Java Week 15 – Lecture 1 Wanda M. Kunkle.
Outline Chapter 1 Hardware, Software, Programming, Web surfing, … Chapter Goals –Describe the layers of a computer system –Describe the concept.
Review CSC 171 FALL 2004 LECTURE 21. Topics Objects and Classes Fundamental Types Graphics and Applets Decisions Iteration Designing Classes Testing and.
 2002 Prentice Hall. All rights reserved. 1 Chapter 2 – Introduction to Python Programming Outline 2.1 Introduction 2.2 First Program in Python: Printing.
Computer Science A 1: 3/2. Course plan Introduction to programming Basic concepts of typical programming languages. Tools: compiler, editor, integrated.
COMP 14: Primitive Data and Objects May 24, 2000 Nick Vallidis.
1 The First Step Learning objectives write Java programs that display text on the screen. distinguish between the eight built-in scalar types of Java;
C++ fundamentals.
A Short Introduction to JAVA
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Java Software Solutions Foundations of Program Design Sixth Edition by Lewis.
CMSC 341 Introduction to Java Based on tutorial by Rebecca Hasti at
Concept of Computer Programming November 2, 2011.
MIT AITI 2003 Lecture 7 Class and Object - Part I.
Introduction To System Analysis and design
Introduction to Java Appendix A. Appendix A: Introduction to Java2 Chapter Objectives To understand the essentials of object-oriented programming in Java.
Introduction to Programming Prof. Rommel Anthony Palomino Department of Computer Science and Information Technology Spring 2011.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 12 Object-Oriented.
Object Oriented Design: Identifying Objects
Object Oriented Programming ITI 1121 Nour El Kadri.
Sadegh Aliakbary Sharif University of Technology Fall 2012.
Introduction To System Analysis and Design
An Introduction to Java Chapter 11 Object-Oriented Application Development: Part I.
Lecture 2 Object Oriented Programming Basics of Java Language MBY.
Lecture 2: Classes and Objects, using Scanner and String.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Chapter 8 Objects and Classes.
Final Exam Review Closed book Closed laptop One sheet of notes permitted SE-0010 Dr. Mark L. Hornick 1.
Input & Output In Java. Input & Output It is very complicated for a computer to show how information is processed. Although a computer is very good at.
Hello.java Program Output 1 public class Hello { 2 public static void main( String [] args ) 3 { 4 System.out.println( “Hello!" ); 5 } // end method main.
Summary of what we learned yesterday Basics of C++ Format of a program Syntax of literals, keywords, symbols, variables Simple data types and arithmetic.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 5: Software Design & Testing; Revision Session.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Using Data Within a Program Chapter 2.  Classes  Methods  Statements  Modifiers  Identifiers.
Fundamental Programming: Fundamental Programming Introduction to C++
Fall 2010 CS4310 Requirements Engineering A Brief Review of UML & OO Dr. Guoqiang Hu Department of Computer Science UTEP 1.
Introduction To OOP 1.0 Fundamentals Of Java Programming Language 2.0 Exception Handling 3.0 Classes, Inheritance And Polymorphism © 2011 | PN AZRINA.
Object-Oriented Paradigm and UML1 Introduction to the Object- Oriented Paradigm.
CMP-MX21: Lecture 4 Selections Steve Hordley. Overview 1. The if-else selection in JAVA 2. More useful JAVA operators 4. Other selection constructs in.
C++ Programming Basic Learning Prepared By The Smartpath Information systems
What is Object-Oriented?  Organization of software as a collection of discreet objects that incorporate both data structure and behavior.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Chapter 5 Conditionals and Loops. © 2004 Pearson Addison-Wesley. All rights reserved5-2 The switch Statement The switch statement provides another way.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 6 Objects and Classes.
What is Java? Object Oriented Programming Language Sun Microsystems “Write Once, Run Everywhere” Bytecode and Virtual Machine Java Platform (Java VM and.
Business Applications with Object-Oriented Paradigm (Modeling Concepts) Professor Chen School of Business Gonzaga University Spokane, WA
CS 106 Introduction to Computer Science I 09 / 10 / 2007 Instructor: Michael Eckmann.
Computer Science A 1. Course plan Introduction to programming Basic concepts of typical programming languages. Tools: compiler, editor, integrated editor,
Methodology Review Chapter 7 Part 2: Design Methodology Object-Oriented Modeling and Design Byung-Hyun Ha
WELCOME TO OUR PRESENTATION UNIFIED MODELING LANGUAGE (UML)
Object Oriented Programming Lecture 2: BallWorld.
Enterprise Systems Modeling EGN 5621 Enterprise Systems Collaboration (Professional MSEM) Fall, 2012.
SESSION 1 Introduction in Java. Objectives Introduce classes and objects Starting with Java Introduce JDK Writing a simple Java program Using comments.
Object-Oriented programming for Beginners LEAPS Computing 2015
Chapter 0: Introduction
Concepts of Object Oriented Programming
Switch, Rounding Errors, Libraries
Computer Programming 1 introduction to JAVA Lecture 1 Instructor: Ruba A. Salamah Islamic University of Gaza.
Review CSE116 2/21/2019 B.Ramamurthy.
Introduction to Data Structure
Chapter 3 Selections Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
Outline Software Development Activities
Presentation transcript:

Introduction (1) Chapter 1 (1) Object-Oriented Modeling and Design Byung-Hyun Ha

Lecture Outline  Prolog  Preface (in the Textbook)  Introduction  Object-oriented  Basics in Java programming

Caution!  My English  I’d like to hear from you, if you cannot understand my words, please.

Prolog  This course is about software engineering or software development, not about computer programming including object-oriented languages and coding.  However, if you are not familiar with computer programming, it will never easy to understand concepts in this book.  That is, the audience of this course is those who have experience of computer programming.

Prolog  Who need to take this course  Those who want to be a professional programmer,  Those who want to be a S/W library developer,  Those who want to be (software) system engineer,  Those who want to learn a new way of thinking for world (system)  Those who wonder what SE is, or ……  Who can take this course  those who have experience of participating in large S/W development process,  those who have basic knowledge in programming,  those who want to learn SE,  those who have to take qualified exam, or ……

Prolog  Who may make mistake of taking this course  those who believe this course will improve their knowledge about computer or computer programming,  those who expect this course will improve their computer programming skill,  those who want to learn how to implement Heuristic algorithms for the problems in the projects they participate in,  those who believe it is quite sufficient for computer applications (programs) to run without error,  those who hate complex approach to simple problems, and ……

Prolog  Say again,  Computer programming skill for industrial engineer  Very important! because if they have the skill, they can do much deeper study during their research.  But this course is for (software) system engineering!  I recommend a course from Prof. Ryu, our new professor.

Course Material  Textbook  Rumbaugh et al., Object-Oriented Modeling and Design, Prentice-Hall, Inc., NJ, 1991 the predecessor of UML (Unified Modeling Language)  References  Whitten, Bentley, Dittman, Systems Analysis and Design Methods, 6th Ed., McGraw-Hill, 2004  Gamma et al., Design Patterns: Elements of Reusable Object- Oriented Software, Addison-Wesley, 1995

Course Plan  Introduction  Including Java language review  Modeling concepts  Object modeling  Dynamic modeling  Functional modeling  Design methodology  Analysis  System design  Object design  Implementation & applications

Student Evaluation  Attendance: 10%  Homework: 20%  may include java programming  Mid/final exam: 35%  Term project: 35%

Preface (in the Textbook)  An object-oriented approach to software development based on  modeling objects from the real world  and then using the model to build a language-independent design organized around those objects  Object-oriented modeling and design promote  better understanding of requirements  cleaner design  more maintainable (information) systems  In this course  a set of object-oriented concepts  a language-independent graphical notation Object Modeling Technique

Preface (in the Textbook)  Object Modeling Technique  analyze problem requirements  design a solution to the problem  implement the solution in a programming language or database  the same concepts and a notation to be used throughout the entire software development process, does not need to translate into a new notation at each development stage  Object-oriented technology is more than just a way of programming  a way of thinking abstractly about a problem using real world concepts, rather than computer concepts  Think in terms of application, not of computer!

Introduction  Object-oriented modeling and design  a new way of thinking about problems using models organized around real-world concepts  Fundamental concept is object,  which combines both data structure and behavior in a single entry  OOMD lifecycle  First, analysis model to abstract essential aspects of application domain without regard for eventual implementation  Then, design decisions are made and details are added  Finally, design model is implemented

Object-Oriented  “Object-oriented” means  we organize software as a collection of discrete objects that incorporate both data and behavior  Required characteristics  Identity  Classification  Polymorphism  Inheritance

Object-Oriented  Identity  Data is quantized into discrete, distinguishable entities called objects e.g. a paragraph in a document, a window on my PC, white queen in a chess game  Objects can be concrete or conceptual e.g. a file in a file system, a scheduling policy  Each object has its own inherent identity Two objects are distinct even if their attribute values (such as name and size) are identical

Object-Oriented  Classification  Objects with the same data structure (attributes, signature, …) and behavior (operations, methods, …) are grouped into a class  A class is an abstraction that describes properties important to an application and ignores the rest  Each class describes a possibly infinite set of individual objects Each object is said to be an instance of its class  Polymorphism  The same operation may behave differently on different classes  Inheritance  The sharing of attributes and operations among classes based on a hierarchical relationship

Object-Oriented  Anyway, what is object-oriented?  Before moving further, let’s review the object-oriented using Java

Java Programming  I recommend Eclipse for Java programming

Hello World!  First, you have to memorize! public class Hello { public static void main(String[] args) { System.out.println("Hello World!"); System.out.println("Hello Java!"); } Hello World! Hello Java!

Java Programming Using Eclipse  Select [File – New – Java Project], enter project name, select [Finish] button

Java Programming Using Eclipse  Select [File – New – Class], enter class name (Hello), select [Finish] button

Java Programming Using Eclipse  Type codes and save it

Java Programming Using Eclipse  Execute by selecting run button ( )

Arithmetic Operations  Numerical and string-wide public class Calc { public static void main(String[] args) { System.out.println(127.0 * / 23.2); } public class StringAdd { public static void main(String[] args) { System.out.println("I" + " am " + "handsome"); }

Arithmetic Operations  Mixed form public class StringAdd { public static void main(String[] args) { System.out.println("I" "handsome"); } I134handsome

Variables  Primitive types public class Variable { public static void main(String[] args) { int a; int b; a = 2; b = 3; a = b; System.out.println(a); a = a + 5; System.out.println(a); }

Numerical Type  Integral types  byte : 8-bit,  128 to 127  short : 16-bit,  to  int : 32-bit,  to  long : 64-bit,  to  char : 16-bit, 0 to  Floating-point types  float : 32-bit  double : 64-bit

Swapping Values  Wrong implementation public class Swap { public static void main(String[] args) { int a = 1; int b = 2; b = a; a = b; System.out.println(a + " " + b); }

Swapping Values  Correct one public class Swap { public static void main(String[] args) { int a = 1; int b = 2; int c = a; a = b; b = c; System.out.println(a + " " + b); }

Arrays  A collection of values public class Array { public static void main(String[] args) { int[] a = new int[3]; a[0] = 10; a[1] = 5; a[2] = 7; System.out.println(a[0] + " " + a[1] + " " + a[2]); }

Arrays  Using variable as reference public class Array { public static void main(String[] args) { int[] a = new int[3]; a[0] = 10; a[1] = 5; int[] b = a; b[2] = 7; System.out.println(a[0] + " " + b[1] + " " + a[2]); }

Arrays  Indexing using variables public class Index { public static void main(String[] args) { double[] a = new double[3]; int b = 2; a[b] = 5.5; a[b - 1] = -3.2; a[0] = 4.1; System.out.println(a[b - 2] - a[1]); }

Arrays  Multi-dimensional array public class TwoDim { public static void main(String[] args) { int[][] a = new int[2][3]; a[0][0] = 1; a[0][1] = 2; a[0][2] = 3; a[1][0] = 4; a[1][1] = 5; a[1][2] = 6; System.out.println(a[1][2]); System.out.println(a[0][1]); }

Handling Text String in Java  Actually implemented by String class public class StringClass { public static void main(String[] args) { String a = new String("This is string"); String b = "For simplicity"; String c = b + " " + a; System.out.println(c); }

Operations  Check leap year public class Lunar { public static void main(String[] args) { int year = 2000; boolean p = ((year % 4) == 0); boolean q = ((year % 100) != 0); boolean r = ((year % 400) == 0); System.out.println((p && q) || r); year = 2004; p = ((year % 4) == 0); q = ((year % 100) != 0); r = ((year % 400) == 0); System.out.println((p && q) || r); }

User Input Processing  Check leap year by user input public class IsLunar { public static void main(String[] args) { java.util.Scanner s = new java.util.Scanner(System.in); System.out.print("Input year: "); int year = s.nextInt(); boolean p = ((year % 4) == 0); boolean q = ((year % 100) != 0); boolean r = ((year % 400) == 0); System.out.println((p && q) || r); }

Java API Reference (Have to Be Installed)

HW1: Sum from n to m  Run sample  For every HW, send to me by one day before the next lecture Input n: 8 Input m which is more than 8: 10 Sum from 8 to 10 is 27.

Control Flow  If statement public class EvenOdd { public static void main(String[] args) { java.util.Scanner s = new java.util.Scanner(System.in); System.out.print("Input an integer: "); int a = s.nextInt(); if ((a % 2) == 0) { System.out.println(a + " is an even number."); } else { System.out.println(a + " is an odd number."); }

Control Flow  Nested if statements public class Score { public static void main(String[] args) { java.util.Scanner s = new java.util.Scanner(System.in); System.out.print("Your points? "); int points = s.nextInt(); if (points > 80) { if (points == 100) { System.out.println("A"); } else { System.out.println("B"); } } else { System.out.println("F"); }

Control Flow  for statement public class Gugu { public static void main(String[] args) { java.util.Scanner s = new java.util.Scanner(System.in); System.out.print("For what? "); int n = s.nextInt(); for (int i = 1; i <= 9; i++) { System.out.println(n + " * " + i + " = " + n * i); }

Control Flow  while statement public class Binary { public static void main(String[] args) { java.util.Scanner s = new java.util.Scanner(System.in); System.out.print("Input decimal number: "); int n = s.nextInt(); int[] digits = new int[32]; int i = 0; while (n > 0) { digits[i] = n % 2; n = n / 2; i++; } for (int j = i - 1; j >= 0; j--) { System.out.print(digits[j]); }

HW2: Displaying Diamonds  Write code of displaying diamonds as follows Height? 3 Number? 4 * * * * *** *** *** *** ***** ***** *** *** *** *** * * * * Height? 5 Number? 2 * * *** *** ***** ***** ******* ******* ********* ******* ******* ***** ***** *** *** * *