SlideShare une entreprise Scribd logo
1  sur  44
JaMU April 2009
STMIK AKAKOM
Yogyakarta




 Practical OOP in Java
                  A Case Study Approach




                                            Thomas Wiradikusuma
                                          wiradikusuma@gmail.com
Objective

To demonstrate practical Object
Oriented Programming in Java using
a case study.
       Focus on OOP, Design
       Pattern, the UML and Java
       EE (Web).
Agenda

Quick tour on software engineering

Introduction to OOP

Introduction to Design Pattern

Introduction to the UML

Case study
A Journey to the Source

 Everything begins from the source (code), based
 on requirements. Source code gets compiled,
 resulting in executable (actual deliverable).

 Requirements getting more complex, at the same
 time development must be faster, cheaper and
 better.

 Some order is required.
Hope for Silver Bullets
High-level language advancements

Object-oriented programming

Graphical programming (diagramming)

Incremental and iterative development

Rapid prototyping

Great designers

…
Object-oriented Programming

   Essence: Abstraction

   Principals:

     Encapsulation

     Inheritance

     Polymorphism
Abstraction
Humans manage complexity
through abstraction.

For example, people do not
think a car as a set of tens
of thousands of individual
parts. They think of it as a
well-defined object with its
own unique behavior.

A powerful way to manage
abstraction is through the
use of hierarchical
classifications (layers).
Abstraction
Humans manage complexity
through abstraction.

For example, people do not
think a car as a set of tens
of thousands of individual
parts. They think of it as a
well-defined object with its
own unique behavior.

A powerful way to manage
abstraction is through the
use of hierarchical
classifications (layers).
Encapsulation
The mechanism that binds together
code and the data it manipulates.

Protective wrapper that prevents
the code and data from being
misused outside the wrapper.

Controlled through a well-defined
interface.

Allows migration of implementation
without breaking contract with
users of that class.

In Java, the basis of encapsulation
is the class.
Encapsulation
The mechanism that binds together
code and the data it manipulates.

Protective wrapper that prevents
the code and data from being
misused outside the wrapper.

Controlled through a well-defined
interface.

Allows migration of implementation
without breaking contract with
users of that class.

In Java, the basis of encapsulation
is the class.
Inheritance
The process by which one
object acquires the
properties of another object.

Supports the concept of
hierarchical classification.

Using inheritance, object
needs only define qualities
that make it unique. General
attributes are inherited from
its parent.

The concept of super class
and sub class.
Inheritance
The process by which one
object acquires the
properties of another object.

Supports the concept of
hierarchical classification.

Using inheritance, object
needs only define qualities
that make it unique. General
attributes are inherited from
its parent.

The concept of super class
and sub class.
Polymorphism
Feature that allows one
interface to be used for a
general class of actions.
The specific action is
determined by the exact
nature of the situation.

One interface, multiple
methods.

Allows creation of clean,
sensible, readable and
resilient code.
Polymorphism
Feature that allows one
interface to be used for a
general class of actions.
The specific action is
determined by the exact
nature of the situation.

One interface, multiple
methods.

Allows creation of clean,
sensible, readable and
resilient code.
Benefits of OO Approach

 Objects are more “real-world”

 Objects provide the flexibility and control
 necessary to deal with evolving requirements

 Object use facilitates collaboration

 Objects help manage complexity

 Reusability, maintainability and extensibility
Design Pattern

General repeatable solution to a commonly-
occurring problem in software design.

Old idea, made popular by Gamma et al (Design
Patterns -- Elements of Reusable Software,
1995).

Must be Useful, Useable, and Used.
Patterns vs Algorithms

Algorithms and data structures generally solve
more fine-grained computational problems like
sorting and searching.

Patterns are typically concerned with broader
architectural issues that have larger-scale
effects.
Patterns vs Frameworks
A software framework is a reusable mini-architecture
that provides the generic structure and behavior for
a family of software abstractions, along with a
context of memes/metaphors which specifies their
collaboration and use within a given domain.

A framework is usually not a complete application: it
often lacks the necessary application-specific
functionality.

Frameworks employ an inverted flow of control
between itself and its clients.
Patterns vs Frameworks, cont’d
    Design patterns may be employed both in the design and the documentation of a
    framework. A single framework typically encompasses several design patterns. A
    framework can be viewed as the implementation of a system of design patterns.

    Frameworks and design patterns are distinct: a framework is executable
    software, design patterns represent knowledge and experience about software.
    Frameworks are of a physical nature, patterns are of a logical nature:
    frameworks are the physical realization of one or more software pattern
    solutions; patterns are the instructions for how to implement those solutions.

    Major differences:

       Design patterns are more abstract than frameworks.

       Design patterns are smaller architectural elements than frameworks.

       Design patterns are less specialized than frameworks.
Classification
Creational patterns, object creation mechanisms, example:

    Factory method

    Prototype

    Singleton

Structural patterns, identify a simple way to realize relationships between entities, example:

    Adapter

    Decorator

    Proxy

Behavioral patterns, identify common communication patterns between objects, example:

    Chain of responsibility

    Observer

    Strategy
Unified Modeling Language

 Standardized general-purpose modeling language
 in the field of software engineering.

 Combines the best practice from data modeling
 concepts such as entity relationship diagrams
 (ERD), business modeling (work flow), object
 modeling and component modeling.
Connecting People
Allows developers to
communicate clearly.

Natural language is
cumbersome for complex
concepts. Code is too
detailed.

Need to see from “high
above.”

UML is the lingua franca
of analysis and design.
Classification
Worth a thousand words, but...

    The most important part is the executable
    (source code).

    Diagrams are for communication and
    documentation.

    Be flexible, use the simplest that works.

    Don’t be trapped with 100% roundtrip
    engineering.
Java
Three in one:

  Programming language

  Virtual Machine

  Platform

A product of Sun Microsystems

Open sourced in November 2006 under the GNU General
Public License

Used in a wide variety of computing platforms
Java Programming Language
 C-like dialect

 !   public class Hello {

 !   !   public static void main(String args[]) {

 !   !   !   System.out.println(“Hello!”);

 !   !   }

 !   }

 Object oriented

 Interpreted and compiled

 Widely used to teach Programming 101 in many courses
Java Virtual Machine (JVM)

  Makes Java application portable

  Code compiled into bytecode

  JIT (Just In Time) native compiler

  Available in a wide range of computer
  architecture
Java Platform
Java Card, applet embedded in smart card

Java ME (Micro Edition), for cellphone

Java SE (Standard Edition), desktop application and
everything else

Java EE (Enterprise Edition), Java SE with additional
enterprise packages

JavaFX, emerging rich client platform, Flash-like

Android, from Google, not the “standard” one
Java EE
Widely used platform for server programming in the
Java programming language.

Differs from Java SE in that it adds libraries which
provide functionality to deploy fault-tolerant,
distributed, multi-tier Java software, based largely on
modular components running on an application server.

There are “non standard” (alternative) tools/
frameworks to complement Java SE to be “enterprise-
ready” (e.g. Spring Framework, EhCache, Mule ESB,
etc).
Frameworks
A system has many aspects: DB access, interoperability, security,
logging, caching, validation, theme, testing, scalability, etc. Very
hard and time consuming to build everything from scratch.

Don’t reinvent the wheel (the NIH syndrome)

Framework vs home-grown, framework is:

   Proven

   Abundant resource

   Community/commercial support

Focus on “business problem”
Case study: Dewantara
Open source student information system.

Aims to be flexible, allowing it to be used in
varying educational institutions.

Java Web application (JPA, Spring, JSF).

JUG CodeCamp 2008 project.

Familiar domain for most of us (you go to school,
don’t you?).
Lecturer   Student
Lecturer   Student




           Subject
Lecturer   Student




 Room      Subject
Lecturer             Student



           Session



 Room                Subject
Klass




Lecturer             Student



           Session



 Room                Subject
Klass




Lecturer             Student   Parent



           Session



 Room                Subject
Klass



 Staff



Lecturer             Student   Parent



           Session



 Room                Subject
Stakeholder              Klass



   Staff



 Lecturer               Student   Parent



              Session



   Room                 Subject
Institution




Stakeholder                  Klass



   Staff



 Lecturer                   Student   Parent



               Session



   Room                     Subject
Institution




       Stakeholder                  Klass



          Staff



User    Lecturer                   Student   Parent



                      Session



          Room                     Subject
Institution




       Stakeholder                  Klass



          Staff



User    Lecturer                   Student   Parent



Role                  Session



          Room                     Subject
Questions?
JUG Joglosemar jug-joglosemar.org
      JUG Indonesia jug.or.id


     Thomas Wiradikusuma
 Blog jroller.com/wiradikusuma
Twitter twitter.com/wiradikusuma

Contenu connexe

Tendances

Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in javajunnubabu
 
Deadlock in Operating System
Deadlock in Operating SystemDeadlock in Operating System
Deadlock in Operating SystemSanthiNivas
 
Multiple choice questions for Java io,files and inheritance
Multiple choice questions for Java io,files and inheritanceMultiple choice questions for Java io,files and inheritance
Multiple choice questions for Java io,files and inheritanceAbishek Purushothaman
 
Introduction to method overloading & method overriding in java hdm
Introduction to method overloading & method overriding  in java  hdmIntroduction to method overloading & method overriding  in java  hdm
Introduction to method overloading & method overriding in java hdmHarshal Misalkar
 
LinkedList vs Arraylist- an in depth look at java.util.LinkedList
LinkedList vs Arraylist- an in depth look at java.util.LinkedListLinkedList vs Arraylist- an in depth look at java.util.LinkedList
LinkedList vs Arraylist- an in depth look at java.util.LinkedListMarcus Biel
 
Java: The Complete Reference, Eleventh Edition
Java: The Complete Reference, Eleventh EditionJava: The Complete Reference, Eleventh Edition
Java: The Complete Reference, Eleventh Editionmoxuji
 
Exception Handling
Exception HandlingException Handling
Exception HandlingReddhi Basu
 
Elements of Java Language
Elements of Java Language Elements of Java Language
Elements of Java Language Hitesh-Java
 
Arrays in Java | Edureka
Arrays in Java | EdurekaArrays in Java | Edureka
Arrays in Java | EdurekaEdureka!
 

Tendances (13)

Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
 
Deadlock in Operating System
Deadlock in Operating SystemDeadlock in Operating System
Deadlock in Operating System
 
Multiple choice questions for Java io,files and inheritance
Multiple choice questions for Java io,files and inheritanceMultiple choice questions for Java io,files and inheritance
Multiple choice questions for Java io,files and inheritance
 
Introduction to method overloading & method overriding in java hdm
Introduction to method overloading & method overriding  in java  hdmIntroduction to method overloading & method overriding  in java  hdm
Introduction to method overloading & method overriding in java hdm
 
Packages in java
Packages in javaPackages in java
Packages in java
 
LinkedList vs Arraylist- an in depth look at java.util.LinkedList
LinkedList vs Arraylist- an in depth look at java.util.LinkedListLinkedList vs Arraylist- an in depth look at java.util.LinkedList
LinkedList vs Arraylist- an in depth look at java.util.LinkedList
 
Access modifiers in java
Access modifiers in javaAccess modifiers in java
Access modifiers in java
 
Java: The Complete Reference, Eleventh Edition
Java: The Complete Reference, Eleventh EditionJava: The Complete Reference, Eleventh Edition
Java: The Complete Reference, Eleventh Edition
 
Exception Handling
Exception HandlingException Handling
Exception Handling
 
Elements of Java Language
Elements of Java Language Elements of Java Language
Elements of Java Language
 
C#
C#C#
C#
 
Arrays in Java | Edureka
Arrays in Java | EdurekaArrays in Java | Edureka
Arrays in Java | Edureka
 
Inheritance In Java
Inheritance In JavaInheritance In Java
Inheritance In Java
 

En vedette

Java OOP s concepts and buzzwords
Java OOP s concepts and buzzwordsJava OOP s concepts and buzzwords
Java OOP s concepts and buzzwordsRaja Sekhar
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Conceptsthinkphp
 
oops concept in java | object oriented programming in java
oops concept in java | object oriented programming in javaoops concept in java | object oriented programming in java
oops concept in java | object oriented programming in javaCPD INDIA
 
Object Oriented Programming with Java
Object Oriented Programming with JavaObject Oriented Programming with Java
Object Oriented Programming with Javabackdoor
 
Basic concepts of object oriented programming
Basic concepts of object oriented programmingBasic concepts of object oriented programming
Basic concepts of object oriented programmingSachin Sharma
 
Object oriented programming (oop) cs304 power point slides lecture 01
Object oriented programming (oop)   cs304 power point slides lecture 01Object oriented programming (oop)   cs304 power point slides lecture 01
Object oriented programming (oop) cs304 power point slides lecture 01Adil Kakakhel
 
Introduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingIntroduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingMoutaz Haddara
 
Object+oriented+programming+in+java
Object+oriented+programming+in+javaObject+oriented+programming+in+java
Object+oriented+programming+in+javaYe Win
 
Java OOP Programming language (Part 6) - Abstract Class & Interface
Java OOP Programming language (Part 6) - Abstract Class & InterfaceJava OOP Programming language (Part 6) - Abstract Class & Interface
Java OOP Programming language (Part 6) - Abstract Class & InterfaceOUM SAOKOSAL
 
Creación de Bases de Datos en SQL Server
Creación de Bases de Datos en SQL ServerCreación de Bases de Datos en SQL Server
Creación de Bases de Datos en SQL ServerPedrangas Pedrangas
 
20 online promotion tips for seafood industry to try right now
20 online promotion tips for seafood industry to try right now20 online promotion tips for seafood industry to try right now
20 online promotion tips for seafood industry to try right nowSocial Bubble
 
"Creación de bases de datos en SQL Server"
"Creación de bases de datos en SQL Server" "Creación de bases de datos en SQL Server"
"Creación de bases de datos en SQL Server" pacovar
 
C, C++, Java, Android
C, C++, Java, AndroidC, C++, Java, Android
C, C++, Java, AndroidMayank Jain
 
Java database connectivity
Java database connectivityJava database connectivity
Java database connectivityVaishali Modi
 
Fly weight pattern #dezapatan
Fly weight pattern #dezapatanFly weight pattern #dezapatan
Fly weight pattern #dezapatankuidaoring
 

En vedette (20)

Java OOP s concepts and buzzwords
Java OOP s concepts and buzzwordsJava OOP s concepts and buzzwords
Java OOP s concepts and buzzwords
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
 
OOP in Java
OOP in JavaOOP in Java
OOP in Java
 
oops concept in java | object oriented programming in java
oops concept in java | object oriented programming in javaoops concept in java | object oriented programming in java
oops concept in java | object oriented programming in java
 
Object Oriented Programming with Java
Object Oriented Programming with JavaObject Oriented Programming with Java
Object Oriented Programming with Java
 
Basic concepts of object oriented programming
Basic concepts of object oriented programmingBasic concepts of object oriented programming
Basic concepts of object oriented programming
 
OOP java
OOP javaOOP java
OOP java
 
Object oriented programming (oop) cs304 power point slides lecture 01
Object oriented programming (oop)   cs304 power point slides lecture 01Object oriented programming (oop)   cs304 power point slides lecture 01
Object oriented programming (oop) cs304 power point slides lecture 01
 
Introduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingIntroduction to Object Oriented Programming
Introduction to Object Oriented Programming
 
Object+oriented+programming+in+java
Object+oriented+programming+in+javaObject+oriented+programming+in+java
Object+oriented+programming+in+java
 
Java OOP Programming language (Part 6) - Abstract Class & Interface
Java OOP Programming language (Part 6) - Abstract Class & InterfaceJava OOP Programming language (Part 6) - Abstract Class & Interface
Java OOP Programming language (Part 6) - Abstract Class & Interface
 
Java Basic Oops Concept
Java Basic Oops ConceptJava Basic Oops Concept
Java Basic Oops Concept
 
Oop java
Oop javaOop java
Oop java
 
Object-oriented concepts
Object-oriented conceptsObject-oriented concepts
Object-oriented concepts
 
Creación de Bases de Datos en SQL Server
Creación de Bases de Datos en SQL ServerCreación de Bases de Datos en SQL Server
Creación de Bases de Datos en SQL Server
 
20 online promotion tips for seafood industry to try right now
20 online promotion tips for seafood industry to try right now20 online promotion tips for seafood industry to try right now
20 online promotion tips for seafood industry to try right now
 
"Creación de bases de datos en SQL Server"
"Creación de bases de datos en SQL Server" "Creación de bases de datos en SQL Server"
"Creación de bases de datos en SQL Server"
 
C, C++, Java, Android
C, C++, Java, AndroidC, C++, Java, Android
C, C++, Java, Android
 
Java database connectivity
Java database connectivityJava database connectivity
Java database connectivity
 
Fly weight pattern #dezapatan
Fly weight pattern #dezapatanFly weight pattern #dezapatan
Fly weight pattern #dezapatan
 

Similaire à Practical OOP In Java

Oops design pattern intro
Oops design pattern intro Oops design pattern intro
Oops design pattern intro anshu_atri
 
Introduction to Software - Coder Forge - John Mulhall
Introduction to Software - Coder Forge - John MulhallIntroduction to Software - Coder Forge - John Mulhall
Introduction to Software - Coder Forge - John MulhallJohn Mulhall
 
Class notes(week 2) on basic concepts of oop-2
Class notes(week 2) on basic concepts of oop-2Class notes(week 2) on basic concepts of oop-2
Class notes(week 2) on basic concepts of oop-2Kuntal Bhowmick
 
Evolution Of Object Oriented Technology
Evolution Of Object Oriented TechnologyEvolution Of Object Oriented Technology
Evolution Of Object Oriented TechnologySharon Roberts
 
Class notes(week 2) on basic concepts of oop-2
Class notes(week 2) on basic concepts of oop-2Class notes(week 2) on basic concepts of oop-2
Class notes(week 2) on basic concepts of oop-2Kuntal Bhowmick
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to javaSujit Majety
 
Bartlesville Dot Net User Group Design Patterns
Bartlesville Dot Net User Group Design PatternsBartlesville Dot Net User Group Design Patterns
Bartlesville Dot Net User Group Design PatternsJason Townsend, MBA
 
Object-Oriented Programming in Java.pdf
Object-Oriented Programming in Java.pdfObject-Oriented Programming in Java.pdf
Object-Oriented Programming in Java.pdfBharath Choudhary
 
Exploring the Pillars of Object java.pdf
Exploring the Pillars of Object java.pdfExploring the Pillars of Object java.pdf
Exploring the Pillars of Object java.pdfKajal Digital
 
A Survey of Object Oriented Programming LanguagesMaya Hris.docx
A Survey of Object Oriented Programming LanguagesMaya Hris.docxA Survey of Object Oriented Programming LanguagesMaya Hris.docx
A Survey of Object Oriented Programming LanguagesMaya Hris.docxdaniahendric
 
Software design and Architecture.pptx
Software design and Architecture.pptxSoftware design and Architecture.pptx
Software design and Architecture.pptxSHAHZAIBABBAS13
 

Similaire à Practical OOP In Java (20)

Oops design pattern intro
Oops design pattern intro Oops design pattern intro
Oops design pattern intro
 
OOP Java
OOP JavaOOP Java
OOP Java
 
Java1
Java1Java1
Java1
 
Java
Java Java
Java
 
Introduction to Software - Coder Forge - John Mulhall
Introduction to Software - Coder Forge - John MulhallIntroduction to Software - Coder Forge - John Mulhall
Introduction to Software - Coder Forge - John Mulhall
 
Class notes(week 2) on basic concepts of oop-2
Class notes(week 2) on basic concepts of oop-2Class notes(week 2) on basic concepts of oop-2
Class notes(week 2) on basic concepts of oop-2
 
Evolution Of Object Oriented Technology
Evolution Of Object Oriented TechnologyEvolution Of Object Oriented Technology
Evolution Of Object Oriented Technology
 
Dtacs
DtacsDtacs
Dtacs
 
Class notes(week 2) on basic concepts of oop-2
Class notes(week 2) on basic concepts of oop-2Class notes(week 2) on basic concepts of oop-2
Class notes(week 2) on basic concepts of oop-2
 
Java
JavaJava
Java
 
Core Java Learning Path
Core Java Learning PathCore Java Learning Path
Core Java Learning Path
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
Bartlesville Dot Net User Group Design Patterns
Bartlesville Dot Net User Group Design PatternsBartlesville Dot Net User Group Design Patterns
Bartlesville Dot Net User Group Design Patterns
 
CAR SHOWROOM SYSTEM
CAR SHOWROOM SYSTEMCAR SHOWROOM SYSTEM
CAR SHOWROOM SYSTEM
 
Object-Oriented Programming in Java.pdf
Object-Oriented Programming in Java.pdfObject-Oriented Programming in Java.pdf
Object-Oriented Programming in Java.pdf
 
Java for C++ programers
Java for C++ programersJava for C++ programers
Java for C++ programers
 
Exploring the Pillars of Object java.pdf
Exploring the Pillars of Object java.pdfExploring the Pillars of Object java.pdf
Exploring the Pillars of Object java.pdf
 
A Survey of Object Oriented Programming LanguagesMaya Hris.docx
A Survey of Object Oriented Programming LanguagesMaya Hris.docxA Survey of Object Oriented Programming LanguagesMaya Hris.docx
A Survey of Object Oriented Programming LanguagesMaya Hris.docx
 
Java Programming.pdf
Java Programming.pdfJava Programming.pdf
Java Programming.pdf
 
Software design and Architecture.pptx
Software design and Architecture.pptxSoftware design and Architecture.pptx
Software design and Architecture.pptx
 

Plus de wiradikusuma

Open Source And Java
Open Source And JavaOpen Source And Java
Open Source And Javawiradikusuma
 
Open Source is Not An Alternative, It is The Solution
Open Source is Not An Alternative, It is The SolutionOpen Source is Not An Alternative, It is The Solution
Open Source is Not An Alternative, It is The Solutionwiradikusuma
 
Spring 2.1 Exposed
Spring 2.1 ExposedSpring 2.1 Exposed
Spring 2.1 Exposedwiradikusuma
 
A Taste of Java ME
A Taste of Java MEA Taste of Java ME
A Taste of Java MEwiradikusuma
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2wiradikusuma
 

Plus de wiradikusuma (8)

Open Source And Java
Open Source And JavaOpen Source And Java
Open Source And Java
 
Open Source is Not An Alternative, It is The Solution
Open Source is Not An Alternative, It is The SolutionOpen Source is Not An Alternative, It is The Solution
Open Source is Not An Alternative, It is The Solution
 
Design Pattern
Design PatternDesign Pattern
Design Pattern
 
Spring 2.1 Exposed
Spring 2.1 ExposedSpring 2.1 Exposed
Spring 2.1 Exposed
 
A Taste of Java ME
A Taste of Java MEA Taste of Java ME
A Taste of Java ME
 
Subversion
SubversionSubversion
Subversion
 
Spring and DWR
Spring and DWRSpring and DWR
Spring and DWR
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
 

Dernier

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 

Dernier (20)

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 

Practical OOP In Java

  • 1. JaMU April 2009 STMIK AKAKOM Yogyakarta Practical OOP in Java A Case Study Approach Thomas Wiradikusuma wiradikusuma@gmail.com
  • 2. Objective To demonstrate practical Object Oriented Programming in Java using a case study. Focus on OOP, Design Pattern, the UML and Java EE (Web).
  • 3. Agenda Quick tour on software engineering Introduction to OOP Introduction to Design Pattern Introduction to the UML Case study
  • 4. A Journey to the Source Everything begins from the source (code), based on requirements. Source code gets compiled, resulting in executable (actual deliverable). Requirements getting more complex, at the same time development must be faster, cheaper and better. Some order is required.
  • 5. Hope for Silver Bullets High-level language advancements Object-oriented programming Graphical programming (diagramming) Incremental and iterative development Rapid prototyping Great designers …
  • 6. Object-oriented Programming Essence: Abstraction Principals: Encapsulation Inheritance Polymorphism
  • 7. Abstraction Humans manage complexity through abstraction. For example, people do not think a car as a set of tens of thousands of individual parts. They think of it as a well-defined object with its own unique behavior. A powerful way to manage abstraction is through the use of hierarchical classifications (layers).
  • 8. Abstraction Humans manage complexity through abstraction. For example, people do not think a car as a set of tens of thousands of individual parts. They think of it as a well-defined object with its own unique behavior. A powerful way to manage abstraction is through the use of hierarchical classifications (layers).
  • 9. Encapsulation The mechanism that binds together code and the data it manipulates. Protective wrapper that prevents the code and data from being misused outside the wrapper. Controlled through a well-defined interface. Allows migration of implementation without breaking contract with users of that class. In Java, the basis of encapsulation is the class.
  • 10. Encapsulation The mechanism that binds together code and the data it manipulates. Protective wrapper that prevents the code and data from being misused outside the wrapper. Controlled through a well-defined interface. Allows migration of implementation without breaking contract with users of that class. In Java, the basis of encapsulation is the class.
  • 11. Inheritance The process by which one object acquires the properties of another object. Supports the concept of hierarchical classification. Using inheritance, object needs only define qualities that make it unique. General attributes are inherited from its parent. The concept of super class and sub class.
  • 12. Inheritance The process by which one object acquires the properties of another object. Supports the concept of hierarchical classification. Using inheritance, object needs only define qualities that make it unique. General attributes are inherited from its parent. The concept of super class and sub class.
  • 13. Polymorphism Feature that allows one interface to be used for a general class of actions. The specific action is determined by the exact nature of the situation. One interface, multiple methods. Allows creation of clean, sensible, readable and resilient code.
  • 14. Polymorphism Feature that allows one interface to be used for a general class of actions. The specific action is determined by the exact nature of the situation. One interface, multiple methods. Allows creation of clean, sensible, readable and resilient code.
  • 15. Benefits of OO Approach Objects are more “real-world” Objects provide the flexibility and control necessary to deal with evolving requirements Object use facilitates collaboration Objects help manage complexity Reusability, maintainability and extensibility
  • 16. Design Pattern General repeatable solution to a commonly- occurring problem in software design. Old idea, made popular by Gamma et al (Design Patterns -- Elements of Reusable Software, 1995). Must be Useful, Useable, and Used.
  • 17. Patterns vs Algorithms Algorithms and data structures generally solve more fine-grained computational problems like sorting and searching. Patterns are typically concerned with broader architectural issues that have larger-scale effects.
  • 18. Patterns vs Frameworks A software framework is a reusable mini-architecture that provides the generic structure and behavior for a family of software abstractions, along with a context of memes/metaphors which specifies their collaboration and use within a given domain. A framework is usually not a complete application: it often lacks the necessary application-specific functionality. Frameworks employ an inverted flow of control between itself and its clients.
  • 19. Patterns vs Frameworks, cont’d Design patterns may be employed both in the design and the documentation of a framework. A single framework typically encompasses several design patterns. A framework can be viewed as the implementation of a system of design patterns. Frameworks and design patterns are distinct: a framework is executable software, design patterns represent knowledge and experience about software. Frameworks are of a physical nature, patterns are of a logical nature: frameworks are the physical realization of one or more software pattern solutions; patterns are the instructions for how to implement those solutions. Major differences: Design patterns are more abstract than frameworks. Design patterns are smaller architectural elements than frameworks. Design patterns are less specialized than frameworks.
  • 20. Classification Creational patterns, object creation mechanisms, example: Factory method Prototype Singleton Structural patterns, identify a simple way to realize relationships between entities, example: Adapter Decorator Proxy Behavioral patterns, identify common communication patterns between objects, example: Chain of responsibility Observer Strategy
  • 21. Unified Modeling Language Standardized general-purpose modeling language in the field of software engineering. Combines the best practice from data modeling concepts such as entity relationship diagrams (ERD), business modeling (work flow), object modeling and component modeling.
  • 22. Connecting People Allows developers to communicate clearly. Natural language is cumbersome for complex concepts. Code is too detailed. Need to see from “high above.” UML is the lingua franca of analysis and design.
  • 24. Worth a thousand words, but... The most important part is the executable (source code). Diagrams are for communication and documentation. Be flexible, use the simplest that works. Don’t be trapped with 100% roundtrip engineering.
  • 25. Java Three in one: Programming language Virtual Machine Platform A product of Sun Microsystems Open sourced in November 2006 under the GNU General Public License Used in a wide variety of computing platforms
  • 26. Java Programming Language C-like dialect ! public class Hello { ! ! public static void main(String args[]) { ! ! ! System.out.println(“Hello!”); ! ! } ! } Object oriented Interpreted and compiled Widely used to teach Programming 101 in many courses
  • 27. Java Virtual Machine (JVM) Makes Java application portable Code compiled into bytecode JIT (Just In Time) native compiler Available in a wide range of computer architecture
  • 28. Java Platform Java Card, applet embedded in smart card Java ME (Micro Edition), for cellphone Java SE (Standard Edition), desktop application and everything else Java EE (Enterprise Edition), Java SE with additional enterprise packages JavaFX, emerging rich client platform, Flash-like Android, from Google, not the “standard” one
  • 29. Java EE Widely used platform for server programming in the Java programming language. Differs from Java SE in that it adds libraries which provide functionality to deploy fault-tolerant, distributed, multi-tier Java software, based largely on modular components running on an application server. There are “non standard” (alternative) tools/ frameworks to complement Java SE to be “enterprise- ready” (e.g. Spring Framework, EhCache, Mule ESB, etc).
  • 30. Frameworks A system has many aspects: DB access, interoperability, security, logging, caching, validation, theme, testing, scalability, etc. Very hard and time consuming to build everything from scratch. Don’t reinvent the wheel (the NIH syndrome) Framework vs home-grown, framework is: Proven Abundant resource Community/commercial support Focus on “business problem”
  • 31. Case study: Dewantara Open source student information system. Aims to be flexible, allowing it to be used in varying educational institutions. Java Web application (JPA, Spring, JSF). JUG CodeCamp 2008 project. Familiar domain for most of us (you go to school, don’t you?).
  • 32.
  • 33. Lecturer Student
  • 34. Lecturer Student Subject
  • 35. Lecturer Student Room Subject
  • 36. Lecturer Student Session Room Subject
  • 37. Klass Lecturer Student Session Room Subject
  • 38. Klass Lecturer Student Parent Session Room Subject
  • 39. Klass Staff Lecturer Student Parent Session Room Subject
  • 40. Stakeholder Klass Staff Lecturer Student Parent Session Room Subject
  • 41. Institution Stakeholder Klass Staff Lecturer Student Parent Session Room Subject
  • 42. Institution Stakeholder Klass Staff User Lecturer Student Parent Session Room Subject
  • 43. Institution Stakeholder Klass Staff User Lecturer Student Parent Role Session Room Subject
  • 44. Questions? JUG Joglosemar jug-joglosemar.org JUG Indonesia jug.or.id Thomas Wiradikusuma Blog jroller.com/wiradikusuma Twitter twitter.com/wiradikusuma

Notes de l'éditeur