Java Oop

Only available on StudyMode
  • Download(s) : 59
  • Published : March 24, 2013
Open Document
Text Preview
Contents

Introduction3
System Functionality3
Object Oriented Approach3
Objects and Classes4
Packaging5
Inheritance5
Class Inheritance5
Interface Inheritance (Multiple Inheritances)6
Encapsulation6
Polymorphism7
Design Patterns Implemented8
The Strategy Pattern8
Strategy for Success Pattern11
UML Modeling12
Use Case Diagram (Admin)13
Specifications14
Use Case Diagram (Staff and Admin)16
Specifications17
Class Diagram19
Activity Diagram20
Future Enhancements21
Conclusion21
References22

Introduction

Java programming language has developed and become increasingly popular in the past few years due to its rich compatibility which allows it to operate on various types of machines and the object oriented approach implemented by the language. The concentration of the following project is based on the use of object oriented programming techniques combined with the implementation of design patterns in order to develop robust applications using the java platform. Secondly the project also focuses on unified modeling language design (UML) elements which form the core of java systems development, the report contains actual UML designs that have been utilized for the development of the following project. These include use case diagrams, class diagrams, activity diagrams and sequence diagrams. System Functionality

The functionalities of the system included in this project are as followed: * Allow admin to add/delete user (Staff)
* Allow admin to add room type
* Allow admin to view financial report
* Allow admin/staff to add customer
* Allow admin/staff to add rooms
* Allow admin/staff to make reservations (Check in)
* Allow admin/staff to check out and collect payment
Object Oriented Approach

Object oriented programming paradigm gives the freedom to developers to take advantage of variety of tools in order to develop more user friendly and reliable applications. David J. Eck stated that “It is claimed that object-orientation provides software developers with new mind tools to use in solving a wide variety of problems. Object-orientation provides a new view of computation. A software system is seen as a community of objects that cooperate with each other by passing messages in solving a problem”. The following object oriented concepts are provided in object oriented programming paradigm: * Objects and classes

* Packaging
* Inheritance
* Encapsulation
* Polymorphism and dynamic binding
The above concepts of OOP are all implemented by the developer in this project. Objects and Classes

As stated by jGuru (2003) in his report on object oriented programming concepts “All objects are instances of a class. The method invoked by an object in response to a message is determined by the class of the receiver. All objects of a given class use the same method in response to similar messages”. In java an object is similar to a real world object where attributes and classes are instances of that object. This allows the ability to classify several classes of an object under one object that share similar attributes. For example Person is an object and student, teacher, lecturer and manager are its instances that share similar attributes with Person. The following code has been extracted from the developed system for the purpose of demonstration of objects and classes implementation. Extracted Code:|

public class Admin extends Staff { private String type_id; public Admin() { super(); } protected final void set_type_id(String i) { type_id = i; }|

Packaging

Packages are a folder of related java classes. Packaging gives users the ability to import or export their application anywhere they want or even use some of the classes of a package in another package to prevent rewriting codes. Another advantage of packaging is that developers can divide a project into various tasks and put them...
tracking img