SlideShare a Scribd company logo
Session-5
● This module introduces patcipants to the new
UML concepts . Mapping of UML concepts to
the java terminology. Describing examples
that show OOPs concepts.Shows how to access
state and behaviour of the object.
Module Overview
2
 Define modeling concepts: abstraction, encapsulation,
and packages
 Discuss why you can reuse Java technology
application Code
 Define class, member, attribute, method, constructor,
and Package
 Use the access modifiers private and public as
appropriate for the guidelines of encapsulation
 Invoke a method on a particular object
 Use the Java technology application programming
interface (API) online documentation
Objectives
3
Software Engineering
<<Module name>>/<<Session #>>/<<Lesson Name>> >>
4
 Analysis describes what the system needs to do:
 Modeling the real-world, including actors and
activities, objects, and behaviors
 Design describes how the system does it:
– Modeling the relationships and interactions between
objects and actors in the system
– Finding useful abstractions to help simplify the
problem or solution
The Analysis and Design Phase
<<Module name>>/<<Session #>>/<<Lesson Name>> >>
5
• Functions – Write an algorithm once to be used in
many Situations
• Objects – Group a related set of attributes and
behaviors into a class
• Frameworks and APIs – Large groups of objects that
support a complex activity; Frameworks can be used
as is or be modified to extend the basic behavior
Abstraction
<<Module name>>/<<Session #>>/<<Lesson Name>> >>
6
 In manufacturing, a blueprint describes a device
from which many physical devices are
constructed.
 In software, a class is a description of an object:
– A class describes the data that each object includes.
– A class describes the behaviors that each object exhibits.
 In Java technology, classes support three key
features of object-oriented programming (OOP):
– Encapsulation
– Inheritance
– Polymorphism
Classes as Blueprints for Objects
<<Module name>>/<<Session #>>/<<Lesson Name>> >>
7
Declaring Java Technology Classes
<<Module name>>/<<Session #>>/<<Lesson Name>> >>
8
Declaring Attributes
<<Module name>>/<<Session #>>/<<Lesson Name>> >>
9
Declaring Methods
<<Module name>>/<<Session #>>/<<Lesson Name>> >>
10
Accessing Object Members
<<Module name>>/<<Session #>>/<<Lesson Name>> >>
11
• The dot notation is: <object>.<member>
• This is used to access object members, including
attributes and methods.
• Examples of dot notation are:
d.setWeight(42);
d.weight = 42; // only permissible if weight is public
Information Hiding
<<Module name>>/<<Session #>>/<<Lesson Name>> >>
12
Problem:
Information Hiding
<<Module name>>/<<Session #>>/<<Lesson Name>> >>
13
The solution:
Encapsulation
<<Module name>>/<<Session #>>/<<Lesson Name>> >>
14
 Hides the implementation details of a class
 Forces the user to use an interface to access data
 Makes the code more maintainable
Declaring Constructors
<<Module name>>/<<Session #>>/<<Lesson Name>> >>
15
● There is always at least one constructor in every
class.
● If the writer does not supply any constructors,
the default constructor is present automatically:
– The default constructor takes no arguments
– The default constructor body is empty
● The default enables you to create object
instances with new xxx()without having to write
a constructor.
The Default Constructor
<<Module name>>/<<Session #>>/<<Lesson Name>> >>
16
Source File Layout
<<Module name>>/<<Session #>>/<<Lesson Name>> >>
17
Software Packages
<<Module name>>/<<Session #>>/<<Lesson Name>> >>
18
 Packages help manage large software systems.
 Packages can contain classes and sub-packages.
 Basic syntax of the package statement is: package
<top_pkg_name>[.<sub_pkg_name>]*;
 Examples of the statement are: package
shipping.gui.reportscreens;
 Specify the package declaration at the beginning
of the source file.
 Only one package declaration per source file.
 If no package is declared, then the class is placed
into the default package.
 Package names must be hierarchical and
separated by dots.
The package Statement
<<Module name>>/<<Session #>>/<<Lesson Name>> >>
19
 Basic syntax of the import statement is:
import <pkg_name>[.<sub_pkg_name>]*.<class_name>;
OR
import <pkg_name>[.<sub_pkg_name>]*.*;
 Examples of the statement are:
import java.util.List;
import java.io.*;
import shipping.gui.reportscreens.*;
 The import statement does the following:
– Precedes all class declarations
– Tells the compiler where to find classes
The import Statement
20
 Packages are stored in the directory tree
containing the package name.
 An example is the shipping application packages.
Directory Layout and Packages
21
Development
22
cd JavaProjects/ShippingPrj/src
javac -d ../classes shipping/domain/*.java
Compiling Using the -d Option
23
 Class – The source-code blueprint for a run-time
object
 Object – An instance of a class; also known as
instance
 Attribute – A data element of an object; also known
as data member, instance variable, and data field
 Method – A behavioral element of an object; also
known as algorithm, function, and procedure
 Constructor – A method-like construct used to
initialize a new
object
 Package – A grouping of classes and sub-packages
Terminology Recap
24
● A set of Hypertext Markup Language (HTML)
files provides information about the API.
● A frame describes a package and contains
hyperlinks to information describing each class
in that package.
● A class document includes the class hierarchy, a
description of the class, a list of member
variables, a list of constructors, and so on.
Java Technology API Documentation
25
Java Technology API Documentation
26

More Related Content

Similar to UML to Object Oriented Mapping java .ppt (20)

java part 1 computer science.pptx
java part 1 computer science.pptxjava part 1 computer science.pptx
java part 1 computer science.pptx
MUHAMMED MASHAHIL PUKKUNNUMMAL
 
Java chapter 3 - OOPs concepts
Java chapter 3 - OOPs conceptsJava chapter 3 - OOPs concepts
Java chapter 3 - OOPs concepts
Mukesh Tekwani
 
Chapter2 bag2
Chapter2 bag2Chapter2 bag2
Chapter2 bag2
teknik komputer ui
 
03 Java Language And OOP Part III
03 Java Language And OOP Part III03 Java Language And OOP Part III
03 Java Language And OOP Part III
Hari Christian
 
Java Presentation.ppt
Java Presentation.pptJava Presentation.ppt
Java Presentation.ppt
Morgan309846
 
10-Lecture10_Leeeeeeeeeeeeeeeecture.pptx
10-Lecture10_Leeeeeeeeeeeeeeeecture.pptx10-Lecture10_Leeeeeeeeeeeeeeeecture.pptx
10-Lecture10_Leeeeeeeeeeeeeeeecture.pptx
ssuser7fe189
 
Android Training (Java Review)
Android Training (Java Review)Android Training (Java Review)
Android Training (Java Review)
Khaled Anaqwa
 
JAVA-PPT'S-complete-chrome.pptx
JAVA-PPT'S-complete-chrome.pptxJAVA-PPT'S-complete-chrome.pptx
JAVA-PPT'S-complete-chrome.pptx
KunalYadav65140
 
JAVA-PPT'S.pptx
JAVA-PPT'S.pptxJAVA-PPT'S.pptx
JAVA-PPT'S.pptx
RaazIndia
 
JAVA-PPT'S.pdf
JAVA-PPT'S.pdfJAVA-PPT'S.pdf
JAVA-PPT'S.pdf
AnmolVerma363503
 
The smartpath information systems java
The smartpath information systems javaThe smartpath information systems java
The smartpath information systems java
The Smartpath Information Systems,Bhilai,Durg,Chhattisgarh.
 
4-OOPS.pptx
4-OOPS.pptx4-OOPS.pptx
4-OOPS.pptx
SatyamMishra237306
 
Class in Java, Declaring a Class, Declaring a Member in a Class.pdf
Class in Java, Declaring a Class, Declaring a Member in a Class.pdfClass in Java, Declaring a Class, Declaring a Member in a Class.pdf
Class in Java, Declaring a Class, Declaring a Member in a Class.pdf
nandiaditi2010
 
Java Presentation For Syntax
Java Presentation For SyntaxJava Presentation For Syntax
Java Presentation For Syntax
PravinYalameli
 
ITFT-Classes and object in java
ITFT-Classes and object in javaITFT-Classes and object in java
ITFT-Classes and object in java
Atul Sehdev
 
classes-objects in oops java-201023154255.pptx
classes-objects in oops java-201023154255.pptxclasses-objects in oops java-201023154255.pptx
classes-objects in oops java-201023154255.pptx
janetvidyaanancys
 
Ch-2ppt.pptx
Ch-2ppt.pptxCh-2ppt.pptx
Ch-2ppt.pptx
ssuser8347a1
 
Core java
Core javaCore java
Core java
Ganesh Chittalwar
 
Introduction to OOP.pptx
Introduction to OOP.pptxIntroduction to OOP.pptx
Introduction to OOP.pptx
ParthaSarathiBehera9
 
9 cm604.14
9 cm604.149 cm604.14
9 cm604.14
myrajendra
 

More from JyothiAmpally (19)

node.js interview questions and answers.
node.js interview questions and answers.node.js interview questions and answers.
node.js interview questions and answers.
JyothiAmpally
 
Exception and ErrorHandling in Java .ppt
Exception and ErrorHandling in Java .pptException and ErrorHandling in Java .ppt
Exception and ErrorHandling in Java .ppt
JyothiAmpally
 
Java Strings methods and operations.ppt
Java Strings  methods and operations.pptJava Strings  methods and operations.ppt
Java Strings methods and operations.ppt
JyothiAmpally
 
Arrays Basicfundamentaldatastructure.ppt
Arrays Basicfundamentaldatastructure.pptArrays Basicfundamentaldatastructure.ppt
Arrays Basicfundamentaldatastructure.ppt
JyothiAmpally
 
_Java__Expressions__and__FlowControl.ppt
_Java__Expressions__and__FlowControl.ppt_Java__Expressions__and__FlowControl.ppt
_Java__Expressions__and__FlowControl.ppt
JyothiAmpally
 
Java-Variables_about_different_Scope.ppt
Java-Variables_about_different_Scope.pptJava-Variables_about_different_Scope.ppt
Java-Variables_about_different_Scope.ppt
JyothiAmpally
 
Java Operators explained _in __brief.ppt
Java Operators explained _in __brief.pptJava Operators explained _in __brief.ppt
Java Operators explained _in __brief.ppt
JyothiAmpally
 
OOPS_AbstractClasses_explained__java.ppt
OOPS_AbstractClasses_explained__java.pptOOPS_AbstractClasses_explained__java.ppt
OOPS_AbstractClasses_explained__java.ppt
JyothiAmpally
 
Java_Identifiers_keywords_data_types.ppt
Java_Identifiers_keywords_data_types.pptJava_Identifiers_keywords_data_types.ppt
Java_Identifiers_keywords_data_types.ppt
JyothiAmpally
 
Java_gui_with_AWT_and_its_components.ppt
Java_gui_with_AWT_and_its_components.pptJava_gui_with_AWT_and_its_components.ppt
Java_gui_with_AWT_and_its_components.ppt
JyothiAmpally
 
1. Introduction to HTML5.ppt
1. Introduction to HTML5.ppt1. Introduction to HTML5.ppt
1. Introduction to HTML5.ppt
JyothiAmpally
 
01-basics-functions.ppt
01-basics-functions.ppt01-basics-functions.ppt
01-basics-functions.ppt
JyothiAmpally
 
03_A-OOPs_Interfaces.ppt
03_A-OOPs_Interfaces.ppt03_A-OOPs_Interfaces.ppt
03_A-OOPs_Interfaces.ppt
JyothiAmpally
 
25-functions.ppt
25-functions.ppt25-functions.ppt
25-functions.ppt
JyothiAmpally
 
03_A-OOPs_Interfaces.ppt
03_A-OOPs_Interfaces.ppt03_A-OOPs_Interfaces.ppt
03_A-OOPs_Interfaces.ppt
JyothiAmpally
 
02-Java Technology Details.ppt
02-Java Technology Details.ppt02-Java Technology Details.ppt
02-Java Technology Details.ppt
JyothiAmpally
 
01-Java Introduction.ppt
01-Java Introduction.ppt01-Java Introduction.ppt
01-Java Introduction.ppt
JyothiAmpally
 
01_What is Java.ppt
01_What is Java.ppt01_What is Java.ppt
01_What is Java.ppt
JyothiAmpally
 
Spring security
Spring securitySpring security
Spring security
JyothiAmpally
 
node.js interview questions and answers.
node.js interview questions and answers.node.js interview questions and answers.
node.js interview questions and answers.
JyothiAmpally
 
Exception and ErrorHandling in Java .ppt
Exception and ErrorHandling in Java .pptException and ErrorHandling in Java .ppt
Exception and ErrorHandling in Java .ppt
JyothiAmpally
 
Java Strings methods and operations.ppt
Java Strings  methods and operations.pptJava Strings  methods and operations.ppt
Java Strings methods and operations.ppt
JyothiAmpally
 
Arrays Basicfundamentaldatastructure.ppt
Arrays Basicfundamentaldatastructure.pptArrays Basicfundamentaldatastructure.ppt
Arrays Basicfundamentaldatastructure.ppt
JyothiAmpally
 
_Java__Expressions__and__FlowControl.ppt
_Java__Expressions__and__FlowControl.ppt_Java__Expressions__and__FlowControl.ppt
_Java__Expressions__and__FlowControl.ppt
JyothiAmpally
 
Java-Variables_about_different_Scope.ppt
Java-Variables_about_different_Scope.pptJava-Variables_about_different_Scope.ppt
Java-Variables_about_different_Scope.ppt
JyothiAmpally
 
Java Operators explained _in __brief.ppt
Java Operators explained _in __brief.pptJava Operators explained _in __brief.ppt
Java Operators explained _in __brief.ppt
JyothiAmpally
 
OOPS_AbstractClasses_explained__java.ppt
OOPS_AbstractClasses_explained__java.pptOOPS_AbstractClasses_explained__java.ppt
OOPS_AbstractClasses_explained__java.ppt
JyothiAmpally
 
Java_Identifiers_keywords_data_types.ppt
Java_Identifiers_keywords_data_types.pptJava_Identifiers_keywords_data_types.ppt
Java_Identifiers_keywords_data_types.ppt
JyothiAmpally
 
Java_gui_with_AWT_and_its_components.ppt
Java_gui_with_AWT_and_its_components.pptJava_gui_with_AWT_and_its_components.ppt
Java_gui_with_AWT_and_its_components.ppt
JyothiAmpally
 
1. Introduction to HTML5.ppt
1. Introduction to HTML5.ppt1. Introduction to HTML5.ppt
1. Introduction to HTML5.ppt
JyothiAmpally
 
01-basics-functions.ppt
01-basics-functions.ppt01-basics-functions.ppt
01-basics-functions.ppt
JyothiAmpally
 
03_A-OOPs_Interfaces.ppt
03_A-OOPs_Interfaces.ppt03_A-OOPs_Interfaces.ppt
03_A-OOPs_Interfaces.ppt
JyothiAmpally
 
03_A-OOPs_Interfaces.ppt
03_A-OOPs_Interfaces.ppt03_A-OOPs_Interfaces.ppt
03_A-OOPs_Interfaces.ppt
JyothiAmpally
 
02-Java Technology Details.ppt
02-Java Technology Details.ppt02-Java Technology Details.ppt
02-Java Technology Details.ppt
JyothiAmpally
 
01-Java Introduction.ppt
01-Java Introduction.ppt01-Java Introduction.ppt
01-Java Introduction.ppt
JyothiAmpally
 
Ad

Recently uploaded (20)

Ray Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big CycleRay Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big Cycle
Dadang Solihin
 
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptxPests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Arshad Shaikh
 
Hemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptxHemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptx
Arshad Shaikh
 
LDMMIA Reiki Yoga Next Week Grad Updates
LDMMIA Reiki Yoga Next Week Grad UpdatesLDMMIA Reiki Yoga Next Week Grad Updates
LDMMIA Reiki Yoga Next Week Grad Updates
LDM & Mia eStudios
 
What are the benefits that dance brings?
What are the benefits that dance brings?What are the benefits that dance brings?
What are the benefits that dance brings?
memi27
 
How to Configure Vendor Management in Lunch App of Odoo 18
How to Configure Vendor Management in Lunch App of Odoo 18How to Configure Vendor Management in Lunch App of Odoo 18
How to Configure Vendor Management in Lunch App of Odoo 18
Celine George
 
TV Shows and web-series quiz | QUIZ CLUB OF PSGCAS | 13TH MARCH 2025
TV Shows and web-series quiz | QUIZ CLUB OF PSGCAS | 13TH MARCH 2025TV Shows and web-series quiz | QUIZ CLUB OF PSGCAS | 13TH MARCH 2025
TV Shows and web-series quiz | QUIZ CLUB OF PSGCAS | 13TH MARCH 2025
Quiz Club of PSG College of Arts & Science
 
Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Webcrawler_Mule_AIChain_MuleSoft_Meetup_HyderabadWebcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Veera Pallapu
 
Black and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdfBlack and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdf
AnnasofiaUrsini
 
Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...
Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...
Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...
National Information Standards Organization (NISO)
 
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
parmarjuli1412
 
Pfeiffer "Secrets to Changing Behavior in Scholarly Communication: A 2025 NIS...
Pfeiffer "Secrets to Changing Behavior in Scholarly Communication: A 2025 NIS...Pfeiffer "Secrets to Changing Behavior in Scholarly Communication: A 2025 NIS...
Pfeiffer "Secrets to Changing Behavior in Scholarly Communication: A 2025 NIS...
National Information Standards Organization (NISO)
 
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdfFEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
ChristinaFortunova
 
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti MpdBasic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Restu Bias Primandhika
 
Rai dyansty Chach or Brahamn dynasty, History of Dahir History of Sindh NEP.pptx
Rai dyansty Chach or Brahamn dynasty, History of Dahir History of Sindh NEP.pptxRai dyansty Chach or Brahamn dynasty, History of Dahir History of Sindh NEP.pptx
Rai dyansty Chach or Brahamn dynasty, History of Dahir History of Sindh NEP.pptx
Dr. Ravi Shankar Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
Rose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdfRose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdf
kushallamichhame
 
Adam Grant: Transforming Work Culture Through Organizational Psychology
Adam Grant: Transforming Work Culture Through Organizational PsychologyAdam Grant: Transforming Work Culture Through Organizational Psychology
Adam Grant: Transforming Work Culture Through Organizational Psychology
Prachi Shah
 
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
EduSkills OECD
 
Unit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdfUnit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdf
KRUTIKA CHANNE
 
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKANMATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
Ray Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big CycleRay Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big Cycle
Dadang Solihin
 
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptxPests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Arshad Shaikh
 
Hemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptxHemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptx
Arshad Shaikh
 
LDMMIA Reiki Yoga Next Week Grad Updates
LDMMIA Reiki Yoga Next Week Grad UpdatesLDMMIA Reiki Yoga Next Week Grad Updates
LDMMIA Reiki Yoga Next Week Grad Updates
LDM & Mia eStudios
 
What are the benefits that dance brings?
What are the benefits that dance brings?What are the benefits that dance brings?
What are the benefits that dance brings?
memi27
 
How to Configure Vendor Management in Lunch App of Odoo 18
How to Configure Vendor Management in Lunch App of Odoo 18How to Configure Vendor Management in Lunch App of Odoo 18
How to Configure Vendor Management in Lunch App of Odoo 18
Celine George
 
Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Webcrawler_Mule_AIChain_MuleSoft_Meetup_HyderabadWebcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Veera Pallapu
 
Black and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdfBlack and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdf
AnnasofiaUrsini
 
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
parmarjuli1412
 
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdfFEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
ChristinaFortunova
 
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti MpdBasic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Restu Bias Primandhika
 
Rose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdfRose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdf
kushallamichhame
 
Adam Grant: Transforming Work Culture Through Organizational Psychology
Adam Grant: Transforming Work Culture Through Organizational PsychologyAdam Grant: Transforming Work Culture Through Organizational Psychology
Adam Grant: Transforming Work Culture Through Organizational Psychology
Prachi Shah
 
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
EduSkills OECD
 
Unit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdfUnit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdf
KRUTIKA CHANNE
 
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKANMATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
Ad

UML to Object Oriented Mapping java .ppt

  • 2. ● This module introduces patcipants to the new UML concepts . Mapping of UML concepts to the java terminology. Describing examples that show OOPs concepts.Shows how to access state and behaviour of the object. Module Overview 2
  • 3.  Define modeling concepts: abstraction, encapsulation, and packages  Discuss why you can reuse Java technology application Code  Define class, member, attribute, method, constructor, and Package  Use the access modifiers private and public as appropriate for the guidelines of encapsulation  Invoke a method on a particular object  Use the Java technology application programming interface (API) online documentation Objectives 3
  • 5.  Analysis describes what the system needs to do:  Modeling the real-world, including actors and activities, objects, and behaviors  Design describes how the system does it: – Modeling the relationships and interactions between objects and actors in the system – Finding useful abstractions to help simplify the problem or solution The Analysis and Design Phase <<Module name>>/<<Session #>>/<<Lesson Name>> >> 5
  • 6. • Functions – Write an algorithm once to be used in many Situations • Objects – Group a related set of attributes and behaviors into a class • Frameworks and APIs – Large groups of objects that support a complex activity; Frameworks can be used as is or be modified to extend the basic behavior Abstraction <<Module name>>/<<Session #>>/<<Lesson Name>> >> 6
  • 7.  In manufacturing, a blueprint describes a device from which many physical devices are constructed.  In software, a class is a description of an object: – A class describes the data that each object includes. – A class describes the behaviors that each object exhibits.  In Java technology, classes support three key features of object-oriented programming (OOP): – Encapsulation – Inheritance – Polymorphism Classes as Blueprints for Objects <<Module name>>/<<Session #>>/<<Lesson Name>> >> 7
  • 8. Declaring Java Technology Classes <<Module name>>/<<Session #>>/<<Lesson Name>> >> 8
  • 10. Declaring Methods <<Module name>>/<<Session #>>/<<Lesson Name>> >> 10
  • 11. Accessing Object Members <<Module name>>/<<Session #>>/<<Lesson Name>> >> 11 • The dot notation is: <object>.<member> • This is used to access object members, including attributes and methods. • Examples of dot notation are: d.setWeight(42); d.weight = 42; // only permissible if weight is public
  • 12. Information Hiding <<Module name>>/<<Session #>>/<<Lesson Name>> >> 12 Problem:
  • 13. Information Hiding <<Module name>>/<<Session #>>/<<Lesson Name>> >> 13 The solution:
  • 14. Encapsulation <<Module name>>/<<Session #>>/<<Lesson Name>> >> 14  Hides the implementation details of a class  Forces the user to use an interface to access data  Makes the code more maintainable
  • 16. ● There is always at least one constructor in every class. ● If the writer does not supply any constructors, the default constructor is present automatically: – The default constructor takes no arguments – The default constructor body is empty ● The default enables you to create object instances with new xxx()without having to write a constructor. The Default Constructor <<Module name>>/<<Session #>>/<<Lesson Name>> >> 16
  • 17. Source File Layout <<Module name>>/<<Session #>>/<<Lesson Name>> >> 17
  • 18. Software Packages <<Module name>>/<<Session #>>/<<Lesson Name>> >> 18  Packages help manage large software systems.  Packages can contain classes and sub-packages.
  • 19.  Basic syntax of the package statement is: package <top_pkg_name>[.<sub_pkg_name>]*;  Examples of the statement are: package shipping.gui.reportscreens;  Specify the package declaration at the beginning of the source file.  Only one package declaration per source file.  If no package is declared, then the class is placed into the default package.  Package names must be hierarchical and separated by dots. The package Statement <<Module name>>/<<Session #>>/<<Lesson Name>> >> 19
  • 20.  Basic syntax of the import statement is: import <pkg_name>[.<sub_pkg_name>]*.<class_name>; OR import <pkg_name>[.<sub_pkg_name>]*.*;  Examples of the statement are: import java.util.List; import java.io.*; import shipping.gui.reportscreens.*;  The import statement does the following: – Precedes all class declarations – Tells the compiler where to find classes The import Statement 20
  • 21.  Packages are stored in the directory tree containing the package name.  An example is the shipping application packages. Directory Layout and Packages 21
  • 23. cd JavaProjects/ShippingPrj/src javac -d ../classes shipping/domain/*.java Compiling Using the -d Option 23
  • 24.  Class – The source-code blueprint for a run-time object  Object – An instance of a class; also known as instance  Attribute – A data element of an object; also known as data member, instance variable, and data field  Method – A behavioral element of an object; also known as algorithm, function, and procedure  Constructor – A method-like construct used to initialize a new object  Package – A grouping of classes and sub-packages Terminology Recap 24
  • 25. ● A set of Hypertext Markup Language (HTML) files provides information about the API. ● A frame describes a package and contains hyperlinks to information describing each class in that package. ● A class document includes the class hierarchy, a description of the class, a list of member variables, a list of constructors, and so on. Java Technology API Documentation 25
  • 26. Java Technology API Documentation 26

Editor's Notes

  • #2: Instructor Notes:
  • #3: Instructor Notes: By the end of this module, participants should be able to: <Obj1> <Obj 2>
  • #4: Instructor Notes: <<lesson Overview>>.
  • #5: Instructor Notes: <<Key Word>>: <<Definition>>
  • #6: Instructor Notes:
  • #7: Instructor Notes:
  • #8: Instructor Notes: <<Process flow steps>>
  • #9: Instructor Notes: <<Concept Description>>
  • #10: Instructor Notes:
  • #11: Instructor Notes: <<Concept Description>>
  • #12: Instructor Notes: <<Concept Description>>
  • #13: Instructor Notes: <<Concept Description>>
  • #14: Instructor Notes:
  • #15: Instructor Notes:
  • #16: Instructor Notes:
  • #17: Instructor Notes:
  • #18: Instructor Notes: The benefits of <<Lesson name>> are: <<Benefit 1>> <<Benefit 2>>
  • #19: Instructor Notes:
  • #20: Instructor Notes:
  • #21: Instructor Notes:
  • #22: Instructor Notes:
  • #23: Instructor Notes:
  • #24: Instructor Notes:
  • #25: Instructor Notes:
  • #26: Instructor Notes: