Skip to content

Problems Week 2

Trayan Iliev edited this page May 22, 2019 · 10 revisions

Problems Week 2

  1. Refactor your course project from week 1: Create Entity Repositories - extract Entity (domain, model) classes Create-Read-Update-Delete (CRUD) logic into separate Repository (DAO) classes for each top level Entity class (domain aggregate in terms of Domain Driven Design).
  2. Refactor / implement all Controller (Service) classes in a way that they delegate all Entity CRUD operations to the Repository (DAO) classes.
  3. Implement all console text input/output Menu and View classes necessary to create, present, update and delete all types of Entities (following the MVC pattern). Use Command design pattern to implement the necessary actions. The command actions implementation should delegate the execution of business logic to the appropriate Controller methods (implemented in previous point).
  4. Refactor / extract the console input and validation functionality for different types of Entities to separate Utility classes, to be invoked by the Commands implemented in previous point.
  5. The text for different Menu items should be read from a text file called menus.txt containing each menu option text on a separate line in format: COMMAND = Command Text.
  6. Implement lightweight persistence for all your Entity data by Object serialization and de-serialization using ObjectInputStream/ObjectOutputStream to/from a file called invoices.db. All Entities state should be read from the file in the initialization stage of your program, before presenting the Menus, as well as in response to a Load Data Command. The state of your Entities should be written to the file in response to Save Data Command as well as before exiting the program automatically.
  7. Create MainApplication class orchestrating the above functionality, by presenting the Main Menu and delegating to other Menu, View, and Utility classes implemented so far. MainApplication should have a main method to start the application.




  1. Implement a simple Markdown parser converting the text fields of Entity objects from Markdown to HTML, as indicated in initial course project description. Implement only the first 10 item of Basic Systax as presented at https://www.markdownguide.org/cheat-sheet/ (without images). Markdown syntax should be simplified - only single level lists allowed.

Clone this wiki locally