Code Monkey home page Code Monkey logo

airjam's Introduction

AirJAM

Software Design Methods

Original Project Timeline: January 2017 - May 2017

Original Members and Initial Creators

Team JAM: Juan Guerrero, Alfayed Baksh, Maynard Santos

Project description

The objective of this assignment involved using Object Oriented Design and Programming in Java to create the simulation of an airplane's booking system.


Revival Period

January 2019 - TBD

I have proposed the reimplementation of the project using updated skills in OOD, OOP, and unit testing. It is my hope that the project can further showcase my skills in these areas.

Feel free to:

  • Use parts of this project as you see fit under the license.
  • Contribute.

Highlights

Data Abstraction through a public interface:

  • The client solely interacts with the ReservationSystem and Plane.
  • CabinRow.create() is package private to prevent objects outside of the place objects from interacting with it.

Encapsulation & Modularity:

  • The majority of the objects contain internals hidden by the compiler, and the public interface provides only the means that can be used to ask the object to modify the data; ensuring integrity.
  • The visible components to the client are certainly important for each other, but the components themselves have been written to easily be passed around inside of the system.

Overriding & Overloading:

  • Various forms of inheritance occur. Overriding is present in many of these situations, for example; the majority of objects have had their default toString() method reimplemented in this way.
  • Overloading has been a major factor to the fluidity of the current code. Some examples include: private void setSeats(SeatType... types), public Party(CabinType requestedCabin, Person... people), and public void addPerson(Person... people).

StringBuilder:

  • Strings are immutable in Java and concatenation is expensive. StringBuilder has been used to make our String creation more efficient. Some examples include:
     public String toString() { 
         StringBuilder sb = new StringBuilder();
         for (CabinRow cr : cabinRows) {
             sb.append('\n');
             sb.append(cr.toString());
             sb.append('\n');
         }
         return sb.toString();
     }

Generics:

  • Parameterized methods/classes using generics to accept multiple data types are a great way to implement reusable and flexible code.
boolean hasAvailable(Iterable<SeatType> types) {
                for (SeatType requested : types)
                    if (!availableSeatTypes.contains(requested)) return false;
                return true;
} 

Enums: - Vitally used to map the location of objects and the available locations of seats through HashSets and HashMaps. enum RowSide {LEFT, RIGHT} enum SeatType {WINDOW, CENTER, AISLE}

Exceptions: - Exceptions are important to reveal possible bugs in our program as soon as possible. if (!canAddParty(p)) throw new IllegalArgumentException("Cannot add party to cabin");

The Factory Pattern: - We can use the Factory Pattern in situations where classes need to create or produce an object, but that exact object may be a bit different depending on the initial product. static CabinRow[] createCabinRows(CabinType type, int n)

Event-Driven Programming: - Evident in the ReservationSystem.

while (true) {
            System.out.println("Hello, welcome to JAM Airlines! \n");
            System.out.println("Please select an option: \n");
            System.out.println("1: Add new passengers");
            System.out.println("2: View Seating Chart");
            System.out.println("3: Exit\n");
            System.out.print("Enter choice: ");
    ...
}

Possible Todo's

Inheritance & Polymorphism:

  • Creation employee objects which are involved in the airplane simulation.
  • Analyze maintainability and scalability for possible changes in Cabin and Plane.

Unit Testing & J-Unit Testing:

  • Verify each component is working as intended throughout the development process.

airjam's People

Contributors

baksha97 avatar

Watchers

 avatar  avatar

Forkers

mayntos

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.