gerhardvanwyk / contacts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Contacts

Did not implement everything, looked at Company and Customer. Think most of the design and coding points have been touch upon.

The circular reference is looked at in the Controller, not in the DB. Although circular reference is possible, the application should warn the user.

Design

I opted for no Service layer since there is no business logic The controller use the repository layer, which already holds the relationships amongst the entities

Run the App

Open in a IDE then run main in the Application class. You need a MySQL database

Test

There are 3 test in the MainControllerTest

  1. Create a company as a supplier. New Supplier

    • Simply create a company as a Supplier, and the supplier information is new.
  2. Create a company as a customer. Circular fails

  • Create company x as a supplier (PASS)
  • Create customer y as company x (PASS)
  • Create company z as customer y (FAIL - company z cannot be company x)
  1. Create a company as a customer. Existing
  • Create person x as a supplier (PASS)
  • Create customer y as person x (Not implemented)
  • Create company z as person y (Not implemented)

The is 1 test in the CompanyRepositoryTest

  • findbyId

About


Languages

Language:Java 100.0%