Code Monkey home page Code Monkey logo

a02_u01's Introduction

module name: A02_u01

Assignment II - WakeUpGym

Java application that works towards a CSV database for persistance.

The purpose of the work is to learn basic Java and java best practices. The work is wholly my own, but nevertheless a product of discussion with teachers and other students.

There are three secret menu items in mainMenu for testing purposes:

case 3: // Secret case for making default rooms.
    generateDefaultRooms();
    break inputLoop;

case 4: // Secret case for booking an activity. Will fail because no userID.
    bookActivity();
    
case 5: // Secret case for listing users.
    listUsers();

Joblist

A few points that could be improved upon in the code in the repository.

  • repo: remove the current *.jar dependency files as included in src in this repository. Bring dependencies in dynamically for forks and clones of this repo.

Style guide

This project conforms to an older version of the following style guide. The mian difference is this projects adherance to vertically aligned braces on the same column for constructs. This is depreciated in later versions of the style guide.

UML diagram

The application has the following structure. This diagram is not a live view of the code implementation and requires manual updates. The Diagram is generated from PlantUML markdown language.

 . . .

Critical reflection

The structure of the program is not satisfactory in many regards. I find the controller classes have drawbacks in the way they handle their responsibilities. The three Controller classes are similar, and yet have minor variations. I think with some planning the logic could be moved mor inte the classes and then the whole controller framework could be dropped. For example the WakeUp main class has to call a controller to then get the controller to retrieve the relevant object state from it's object instances (or actually only one: selectedUser/Subscription/Room).

However I think the whole structure is at a failure point due to not having a versetile permanence and recall of stored objects. The logic of searching for an object to instantiate would usually be done by a DBMS and this application has no such benefits. This is why the Controller classes exist to iterate over data structures looking for the right attribute value for an object before instantiating them.

The main trouble is that I have a reluctance to pass the objects out to the caller (i.e. to WakeUp main) through the controller classes. Hence the controllers have to have methods like fetchRoomPlacesBookingsList() and that would make much more sense to have in the Room class.

by Kai Weeks, student at Luleå Tekniska Universitet

Activity Flows

Flow - new user:

  1. A user starts the application and selects registerUser from mainMenu.
  2. The user is prompted for a userName and then a userID.
  3. The userID is then checked for validity.
  4. A new User is created and the selectedUser is set in UserControl.
  5. The new user is prompted for number of months of subscription.
  6. A new subscription is created with the date as and from now() and the usersID.
  7. SubscriptionControl has the selectedSubscription variable populated.
  8. The cost is calculated and displayed to user. If the selectedUser is not Active then a membership fee is added to the total.
  9. If the user accepts the price then the Subscription and the User are set to Active

Flow - Login

  1. A user starts the application and selects loginUser.
  2. The user is prompted for a name and then a userID.
  3. If these are found in the system then the user is authenticated.
  4. The menu changes to the loggedInMenu.

Flow - Book Activity

  1. Same flow as for Login and then:
  2. The user selects bookActivity from the loggedInMenu.
  3. A check is done that the user has a valid subscription and that the membership is still in date.
  4. If checks pass then program fetches a list of available activities.
  5. The user selects an activity from the list.
  6. The program fetches a list of available spaces in the room for that activity.
  7. Then the user selects a space and the program checks that it is a vailable, and that the user is not already booked.
  8. Once the user has found an available place then the room is updated with the userID to that place
  9. Room saved to database and user is given a confirmation message.
  10. Program returns to main menu.

a02_u01's People

Contributors

weleoka avatar

Stargazers

Carl Granström avatar

Watchers

James Cloos avatar  avatar

a02_u01's Issues

User-Subscription

Jag vet inte exakt hur du har tänkt dig strukturen, men nog bör Subscription vara kopplad mot User istället för main? Anropet går från main, men Subscription-objekten hör till användare. Om man vill lagra flera subs kan man ha dom i en Subscription[]. Men bäst är kanske att ha en sub med metoder för att förlänga den osv. Tror jag ska fundera mer på min egen sub-mekanism och försöka få den att funka så. Orkade bara inte med datumhanteringen ursprungligen.

Otydligt i aktivitetsbokning

Formuleringen i aktivitetsbokning är otydligt tycker jag.

Det finns 3 olika typer av aktiviteter (Spinning, Aerobics, och Yoga) och varje aktivitet har totalt 9 platser fördelat på 3 rader i salen (rad 1-3, plats a, b, c).

Det går inte ihop. Varje aktivitet kan inte ha 9 platser om salen bara har 9 platser. Eller ska det egentligen stå:

...fördelat på 3 rader i salen (rad 1-3, plats a, b, c,.. och så vidare)

Det vill säga att det är en rad per aktivitet, och därmed 1a-1i för en aktivitet, 2a-2i för nästa osv? Det vill säga totalt 27 platser. Jag gör bara olika salar för olika aktiviteter istället.

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.