Introduction to Java &.NET SEAP/BTIS/DB&I/Aug 2010 1 Introduction to Java &.NET  A step to equip our team with the OO programming basics  An initiative.

Slides:



Advertisements
Similar presentations
Introduction to Object Orientation System Analysis and Design
Advertisements

UML an overview.
1 OBJECT-ORIENTED CONCEPTS. 2 What is an object?  An object is a software entity that mirrors the real world in some way.  A software object in OOP.
Lab Information Security Using Java (Review) Lab#0 Omaima Al-Matrafi.
Object-Oriented Analysis and Design
Chapter 1 Object-Oriented System Development
1 SWE Introduction to Software Engineering Lecture 23 – Architectural Design (Chapter 13)
Object Oriented System Development with VB .NET
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
Java Programming, 3e Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
Lecture 13: Object- Oriented Concepts Anita S. Malik Adapted from Schach (2004) Chapter 7.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
C++ fundamentals.
Distribution of Marks Internal Sessional Evaluation Assignments – 10 Quizzes – 10 Class Participation Attendence – 5 Mid – Term Test – 25 External Evaluation.
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
L EC. 01: J AVA FUNDAMENTALS Fall Java Programming.
01 Introduction to Java Technology. 2 Contents History of Java What is Java? Java Platforms Java Virtual Machine (JVM) Java Development Kit (JDK) Benefits.
UML and Object Oriented Concepts
Intro to dot Net Dr. John Abraham UTPA – Fall 09 CSCI 3327.
Introduction To System Analysis and design
Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
Object Oriented Software Development
CSCI 3327 Visual Basic Chapter 1: Introduction to Visual Basic
Programming Languages and Paradigms Object-Oriented Programming.
 2005 Pearson Education, Inc. All rights reserved. 1 Introduction & The Java Virtual Machine Small Java Chapter 1 1.
MT311 Java Application Development and Programming Languages Li Tak Sing( 李德成 )
CSM-Java Programming-I Spring,2005 Objects and Classes Overview Lesson - 1.
The Software Development Life Cycle: An Overview Presented by Maxwell Drew and Dan Kaiser Southwest State University Computer Science Program.
Object Oriented Design and Programming Alan Goude Room: Sheaf 9323.
Slide 1 UML Review Chapter 2: Introduction to Object-Oriented Systems Analysis and Design with the Unified Modeling Language, Version 2.0 Alan Dennis,
Unified Modeling Language, Version 2.0
Programming language A programming language is an artificial language designed to communicate instructions to a machine,languageinstructionsmachine particularly.
1. 2 Object-Oriented Concept Class & Object Object-Oriented Characteristics How does it work? Relationships Between Classes Development Tools Advantage.
Introduction To System Analysis and Design
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
1 COMP 350: Object Oriented Analysis and Design Lecture 1Introduction References: Craig Larman Chapter 1.
Fall 2010 CS4310 Requirements Engineering A Brief Review of UML & OO Dr. Guoqiang Hu Department of Computer Science UTEP 1.
 Programming Language  Object Oriented Programming  JAVA – An Introduction  JAVA Milestones  JAVA Features.
Object-Oriented Paradigm and UML1 Introduction to the Object- Oriented Paradigm.
Module 4 Part 2 Introduction To Software Development : Programming & Languages Introduction To Software Development : Programming & Languages.
1/26 On-demand Learning Series Software Engineering of Web Application - Object-Oriented Development & UML Hunan University, Software School.
Slide 1 Systems Analysis and Design With UML 2.0 An Object-Oriented Approach, Second Edition Chapter 2: Introduction to Object-Oriented Systems Analysis.
Unified Modeling Language. Object Oriented Methods ► What are object-oriented (OO) methods?  OO methods provide a set of techniques for analyzing, decomposing,
CT1513 Introduction To java © A.AlOsaimi.
Learners Support Publications Object Oriented Programming.
Basic Concepts of Object Orientation Object-Oriented Analysis CIM2566 Bavy LI.
Slide 1 Systems Analysis and Design With UML 2.0 An Object-Oriented Approach, Second Edition Chapter 2: Introduction to Object-Oriented Systems Analysis.
1 Unified Modeling Language, Version 2.0 Chapter 2.
Introduction to OOP CPS235: Introduction.
Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A.
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
Basic Characteristics of Object-Oriented Systems
JAVA TRAINING IN NOIDA. JAVA Java is a general-purpose computer programming language that is concurrent, class-based, object-oriented and specifically.
Modified from Sommerville’s originalsSoftware Engineering, 7th edition. Chapter 14 Slide 1 Object-Oriented Design.
Slide 1 Unified Modeling Language, Version 2.0 Object-Oriented SAD.
Unified Modeling Language (UML)
Visit for more Learning Resources
Sachin Malhotra Saurabh Choudhary
Roberta Roth, Alan Dennis, and Barbara Haley Wixom
Object-Oriented Analysis and Design
Lecture 1: Introduction to JAVA
Systems Analysis and Design With UML 2
Systems Analysis and Design With UML 2
Introduction Enosis Learning.
Introduction Enosis Learning.
(Computer fundamental Lab)
Java History, Editions, Version Features
Presentation transcript:

Introduction to Java &.NET SEAP/BTIS/DB&I/Aug Introduction to Java &.NET  A step to equip our team with the OO programming basics  An initiative to realize our values FAST Session 1

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug Agenda 1. Introduction 2. Java,.NET, and Procedural Languages 3.Object Oriented Basics

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug Introduction

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug Introduction Benefits a) broaden our knowledge by keeping up with the trend b) understand and support project programming phases Objectives a) realize the benefits set forth b) able to test change existing programs in our department Difficulties a) none of us come from OO programming background b) your contribution is necessary to continue the session d) training touches surface only d) commit time to further study

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug Introduction TaskAugSepOctNovDecJan - Mar 1: Introduction & OOZhang 2: Java Basics (1) Zhang 3: Java Basics (2) Zhang 4: Visio Studio ? 5: C# Introduction ? 6: VB (1) VBScript ? 7: VB (2) ? 8: Recode program

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug Java,.NET, and Procedural Languages

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug What is Java Java is a programming language and computing platform first released by Sun Microsystems in (Now belong to Oracle.) It is the underlying technology that powers state-of-the-art programs including utilities, games, and business applications. Java runs on more than 850 million personal computers worldwide, and on billions of devices worldwide, including mobile and TV devices. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities. Java applications are typically compiled to bytecode (class file) that can run on any Java Virtual Machine (JVM) regardless of computer architecture. Java is general-purpose, concurrent, class-based, and object-oriented, and is specifically designed to have as few implementation dependencies as possible. It is intended to let application developers "write once, run anywhere".

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug What is Java One characteristic of Java is portability, which means that computer programs written in the Java language must run similarly on any supported hardware/operating-system platform. This is achieved by compiling the Java language code to an intermediate representation called Java bytecode, instead of directly to platform-specific machine code. Java bytecode instructions are analogous to machine code, but are intended to be interpreted by a virtual machine (VM) written specifically for the host hardware. End-users commonly use a Java Runtime Environment (JRE) installed on their own machine for standalone Java applications, or in a Web browser for Java applets.

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug What is.NET The Microsoft.NET Framework is a software framework that can be installed on computers running Microsoft Windows operating systems. It includes a large library of coded solutions to common programming problems and a virtual machine that manages the execution of programs written specifically for the framework. The.NET Framework supports multiple programming languages in a manner that allows language interoperability, whereby each language can utilize code written in other languages; in particular, the.NET library is available to all the programming languages that.NET encompasses. The.NET Framework is a Microsoft offering and is intended to be used by most new applications created for the Windows platform.

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug What is.NET.NET and JVM are different. Java byte code isn't compatible with.NET byte code.

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug Procedural Languages e.g. FORTRAN, C, BASIC, Pascal, PL/SQL, etc Characteristics: Data is contained in data structures directly accessed by routines Data structures are separated from the routines’ code Different code modules access and modify the same data structures Data structures and code have different owners We may eventually lose knowledge of which code uses which data structure

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug Difference Between OOL & PPL A major factor in the invention of Object-Oriented approach is to remove some of the flaws encountered with the procedural approach. Object Orientation Languages (OOL) is concerned to develop an application based on real time while Procedural Programming Languages (PPL) are more concerned with the processing of procedures and functions. In OOL, more emphasis is given on data rather than procedures, while the programs are divided into Objects and the data is encapsulated (Hidden) from the external environment, providing more security to data which is not applicable or rather possible in PPL. In PPL, its possible to expose Data and/or variables to the external entities which is STRICTLY restricted IN OOL. In OOL, the Objects communicate with each other via Functions while there is no communication in PPL rather its simply a passing values to the Arguments to the Functions and / or procedures. OOL follows Bottom Up Approach of Program Execution while in PPL its Top Down approach. OOL concepts includes Inheritance, Encapsulation and Data Abstraction, Late Binding, Polymorphism, Multithreading, and Message Passing while PPL is simply a programming in a traditional way of calling functions and returning values. Source:

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug Object Oriented Basics

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug Why OO? A technology that strongly ties data structures to the code routines that relate to them, fusing them into objects Offers a good methodological framework for software engineering Provides the foundation for systematic software engineering Objects relate to the “real world” more closely than modules of routines Encourage better modeling and implementation of systems. Provide a focus throughout analysis, design, and implementation Emphasize state, behavior, and interaction Benefits of OO programming: Reusability Stability Reliability Data Hiding Faster Design Easier maintenance Design Independence

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug OO Building Blocks There are differences between different OO languages, but general building blocks are: Objects With individual characteristics Classes Objects belong to a type Associations Objects know about each other and communicate with each other Inheritance A type may be a specialization of another type. Polymorphism A specialized type can be treated in a generic way

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug UML – Unified Modelling Language This object-oriented system of notation has evolved from the work of Grady Booch, James Rumbaugh, Ivar Jacobson, and the Rational Software Corporation.Rational Software Corporation These renowned computer scientists fused their respective technologies into a single, standardized model. Today, UML is accepted by the Object Management Group (OMG) as the standard for modeling object oriented programs.Object Management Group (OMG) Types of UML Diagrams UML defines nine types of diagrams: class (package), object, use case, sequence, collaboration, statechart, activity, component, and deployment. Source:

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug Example

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug Example

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug Terminology Object: A thing that exists in the domain of the problem E.g. An office building might have a number of ‘Elevators’, ‘Offices’, ‘SecurityDoors’, etc. Object Oriented: Software is object-oriented if the design and implementation of that software is based on the interaction between the objects of the domain Class: A template used for the creation of objects A class describes various attributes an object might have e.g. A ‘Person’ class might have various attributes, including age, weight, height, eye colour, address, etc.

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug Objects and Classes Bank Account A class (the concept) John’s Bank Account Balance: $5,257 An object (the realization) Bill’s Bank Account Balance: $1,245,069 Mary’s Bank Account Balance: $16,833 Multiple objects from the same class

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug Example of a Class class Employee { // Fields private String name; //Can get but not change private double salary; // Cannot get or set // Constructor Employee(String n, double s) { name = n; salary = s; } // Methods void pay () { System.out.println("Pay to the order of " + name + " $" + salary); } public String getName() { return name; } // getter }

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug Association (“has-a”) public class AntiAirCraftGun { private Bomber target; private int positionX; private int positionY; private int damage; public void setTarget(Bomber newTarget) { this.target = newTarget; } //rest of AntiAircraftGun class } public class Bomber { private AntiAirCraftGun target; private int positionX; private int positionY; private int damage; public void setTarget(AntiAirCraftGun newTarget) { this.target = newTarget; } //rest of Bomber class }

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug Association - Composition Composition gives us a 'part-of' relationship. Within composition, the lifetime of the part (Engine) is managed by the whole (Car), in other words, when Car is destroyed, Engine is destroyed along with it. public class Engine {... } public class Car { Engine e = new Engine(); } As you can see in the example code above, Car manages the lifetime of Engine.

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug Association - Aggregation Within aggregation, the lifetime of the part is not managed by the whole. public class Address {... } public class Person { private Address address; public Person(Address address) { this.address = address; }... } Person would then be used as follows: Address address = new Address(); Person person = new Person(address); or Person person = new Person( new Address() );

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug Inheritance Inheritance is the process by which one object acquires the properties of another object. By use of inheritance, an object need only define all of its characteristics that make it unique within its class, it can inherit its general attributes from its parent. Account Checking Mortgage Loan In C# there may be more than one root In C# an object may have more than one parent (immediate superclass) But, Java has a single, strict hierarchy

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug Inheritance

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug Inheritance

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug Interface

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug Polymorphism Classical paradigm Must explicitly invoke correct version Polymorphism(from Greek, meaning“many forms”) is a feature that allows one interface to be used for a general class of actions, i.e. one interface, multiple methods.

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug Polymorphism Object-oriented paradigm All that is needed is myFile.open() Correct method invoked at run-time (dynamically) Method open can be applied to objects of different classes

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug  Overriding  Overloading  Genericity public class MyListUtils { ArrayList copy(T[] list) { ArrayList list2 = new ArrayList (); for (int i = 0; i < obj.length; i++) list2.add(list[i]); return false; } Polymorphism

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug Another Example

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug Further Studies And vast resources over Internet and Library books, such as: -> Introduction to UML -> OO Programming

Introduction to Java and.NET SEAP/BTIS/DB&I/Aug Thank You!