OOP in Java


Published on

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • OOP in Java

    1. 1. OOP in Java Introduction to the world of software engineering, object-oriented programming and Java Thomas Wiradikusuma [email_address] www.wiradikusuma.com Presentation to the 18 th Java User Group Meet Up (JaMU), January 14, 2006
    2. 2. Agenda <ul><li>Quick tour on software engineering </li></ul><ul><li>Object-oriented concept </li></ul><ul><li>Introduction to Java </li></ul><ul><li>OO approach in Java </li></ul>
    3. 3. Objective <ul><li>To attract newcomers into the field of programming and software development, practically using Java as their language of choice. </li></ul>
    4. 4. Programming Defined <ul><li>Algorithm and Program </li></ul><ul><li>Programming language </li></ul><ul><li>A short tour into Software Development Lifecycle (SDLC), from Waterfall to Iterative Development </li></ul>
    5. 5. Joys and Woes of Programming <ul><li>The joys </li></ul><ul><li>The woes </li></ul>
    6. 6. Program Evolution <ul><li>Program </li></ul><ul><li>Programming System </li></ul><ul><li>Programming Product </li></ul><ul><li>Programming Systems Product </li></ul>
    7. 7. Common Pitfalls <ul><li>Schedule slippage </li></ul><ul><li>Project objectives slippage </li></ul><ul><li>Unrealistic budget </li></ul><ul><li>Lack of documentation </li></ul><ul><li>Hard to extend </li></ul>
    8. 8. Essence of Modern Systems <ul><li>Complexity </li></ul><ul><li>Conformity </li></ul><ul><li>Changeability </li></ul><ul><li>Invisibility </li></ul>
    9. 9. Hope for Silver Bullets <ul><li>High-level language advancements </li></ul><ul><li>Object-oriented programming </li></ul><ul><li>Graphical programming (diagramming) </li></ul><ul><li>Incremental and iterative development </li></ul><ul><li>Rapid prototyping </li></ul><ul><li>Great designers </li></ul><ul><li>… </li></ul>
    10. 10. Object-oriented Programming <ul><li>Essence: Abstraction </li></ul><ul><li>Principals: </li></ul><ul><ul><li>Encapsulation </li></ul></ul><ul><ul><li>Inheritance </li></ul></ul><ul><ul><li>Polymorphism </li></ul></ul>
    11. 11. Abstraction <ul><li>Humans manage complexity through abstraction </li></ul><ul><li>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 </li></ul><ul><li>A powerful way to manage abstraction is through the use of hierarchical classifications (layers) </li></ul>
    12. 12. Encapsulation <ul><li>The mechanism that binds together code and the data it manipulates </li></ul><ul><li>Protective wrapper that prevents the code and data from being misused outside the wrapper </li></ul><ul><li>Controlled through a well-defined interface </li></ul><ul><li>Allows migration of implementation without breaking contract with users of that class </li></ul><ul><li>In Java, the basis of encapsulation is the class </li></ul>
    13. 13. Inheritance <ul><li>The process by which one object acquires the properties of another object </li></ul><ul><li>Supports the concept of hierarchical classification </li></ul><ul><li>Using inheritance, object needs only define qualities that make it unique. General attributes are inherited from its parent </li></ul><ul><li>The concept of super class and sub class </li></ul>
    14. 14. Polymorphism <ul><li>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 </li></ul><ul><li>One interface, multiple methods </li></ul><ul><li>Allows creation of clean, sensible, readable and resilient code </li></ul>
    15. 15. Benefits of OO Approach <ul><li>Objects are more “real-world” </li></ul><ul><li>Objects provide the flexibility and control necessary to deal with evolving requirements </li></ul><ul><li>Object use facilitates collaboration </li></ul><ul><li>Objects help manage complexity </li></ul><ul><li>Reusability, maintainability and extensibility </li></ul>
    16. 16. Introducing Java <ul><li>A little history </li></ul><ul><li>Buzzwords: simple, object-oriented, robust, multithreaded, architecture-neutral, interpreted and high performance, distributed, dynamic </li></ul><ul><li>Java platforms: JavaME, JavaSE, JavaEE </li></ul>
    17. 17. Applied OOP in Java <ul><li>Class as the unit of work </li></ul><ul><li>Everything but primitive types are objects </li></ul><ul><li>Encapsulation, inheritance and polymorphism in action </li></ul><ul><li>Interface </li></ul><ul><li>Design patterns </li></ul>
    18. 18. Being a Programmer <ul><li>Read literatures </li></ul><ul><li>Exercise </li></ul><ul><li>Take course in computer science </li></ul><ul><li>Get involved in actual projects (start from something simple and advancing!) </li></ul><ul><li>Get involved in discussions/forums (such as Java User Groups) </li></ul><ul><li>… </li></ul>