Git Product home page Git Product logo

java2's Introduction

Java Intro Object Oriented Paradigm (OOP)

OOP is the tasteful interaction between objects to achieve a common goal. A properly object oriented solution ensures that all the objects share the same level of responsibility (weight), and all the objects follow the Single Responsibility Principal (SRP). The SRP states that an object should focus on one thing and it should do that one thing well. The OOP lends itself

Assignments are located here.

Pillars of Object Oriented Programming

Crusty Apple PIE?

  • Composition
  • Abstraction
  • Polymoripshm
  • Inheritance
  • Encapsulation

Composition

"Has a"

Composition (Aggregation) is when an object contains another object. Objects that contain many other objects can be hard to test. Composition leads to objects that are tightly dependent on each other. Dependency injection is a programming technique that reduces the tight dependency between objects.

Abstraction

To abstract something means to hide away the implementation details.
When you call/use the function/class you don't have to understand exactly what it is doing.

  • Keywords/concepts:
    • class
    • interface "Is a" or "Can be"
    • abstract
    • Methods/functions
    • Classes
    • Web APIs
    • Software Development Kit (SDK)

Polymoripshm

Literal translation is "many forms" or "the condition of occurring in several different forms."

  • Keywords
    • @Override
    • abstract

Encapsulation

Refers to the bundling of data, along with the methods that operate on that data, into a single unit.

  • Keywords
    • public
    • protected
    • private

Inheritance

"Is a"

Inheritance lets one object acquire the properties and methods of another object.

  • Keywords
    • extends
    • implements?
  • Java only supports single inheritance, other languages such as Python support multiple inheritance
  • The public and protected properties are fully accesible

The Golden Rule

A method is a subroutine or a function, but not both. A subroutine is code that possibly changes the state (data) of an object but does NOT return anything. A function is code that returns something but does NOT change the state of the object.

Best Practice

  • Avoid heavily nested objects, prefer only one or two levels of inheritance.
  • Use the final keyword in your classes to indicate to other developers that the class should NOT be subclassed/extended.
  • Remember the Golden Rule

Notes

  • Objects can be null whereas primitive types cannot.
  • Unified Modeling Language (UML) is a standardized modeling language consisting of an integrated set of diagrams, developed to help system and software developers for specifying, visualizing, constructing, and documenting the artifacts of software systems, as well as for business modeling and other non-software systems.
  • A group of objects that work together can be organized into a package.

Videos

Links

java2's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.