Tuesday, February 8, 2011

Classes and Objects

Java is an "Object Oriented Programming Language" (OOLP) which simply means that everything in a java program are essentially objects. In better words, ANY java program is a collection of objects and these objects interact with each other to achieve some specific task.

An object to java world is what an entity is to real world. Any real world entity has some characteristic attributes and behaviors. For example, a dog is a real world entity which has "one tail","two eyes","four legs",etc. as some of its attributes and which has "barking","jumping up","wagging its tail",etc. as some of its behaviors.

Quite similar to a real world entity, a typical java object has a unique state (defined by the values of its instance variables) and some functions (its methods). The states and functions that a java object can have are decided by its definition or blueprint and this blueprint is called a class.

A class defines a type in java world. Any java object is of a specific type. In order to understand it better, we can take an analogy from the real world - cars. When we say car, it conjures up a picture of something that has four wheels, four doors, which has an engine, which runs on some fuel and so on. A car is the blueprint but it does not exist physically. On the other hand, a Volkswagen Beetle is a real entity that exists. Beetle is an entity of type car or we can also say that car is a class and Beetle is an object of class car.

Sunday, January 9, 2011

UML Basics

UML stands for Unified Modeling Language. Before we go into any further details, let us first understand what it means when we say UML stands for 'Unified Modeling Language'.

What is a modeling language?
A modeling language is graphical or textual represenation of information or knowledge of in a standardized format. 
 
Why Unified?
This language can be used for all the processes of software development (like requirement, architecture, implementation, deployment, etc.) and for various implementation technologies.

In simple words, UML is the standard way of documenting requirement, architecture, design, implementation and deployment of any software system. It graphically represents the 'software' solution to any real-world problem. UML helps the architects, business analysts and developers to talk in the same language without having to understand any programming language jargons. 

UML is a tool for Object-Oriented Analysis and Design (OOAD). At the heart of UML are its various modeling diagrams like Use Case Diagram, Sequence Diagram, Class Diagram, Activity Diagram, etc.