Skip to content

Latest commit

 

History

History
51 lines (37 loc) · 2.21 KB

README.md

File metadata and controls

51 lines (37 loc) · 2.21 KB

Internet discussion demo app

How to use

Profile IIS Express launches project on URL http://localhost:54189. The database is deleted and recreated on each start with dummy data from InternetDiscussionContext. Logger output is shown on the console window. The sequence of example REST calls for the Postman app is added to this solution https://github.com/MartinMatko/Mathesio/blob/master/Matthesio.postman_collection.json.


Implemented functionality

Entities in applications are author, the topic of discussion and reply to the given topic. I implemented only creating and retrieving of author and topic because it's enough for demonstrating architecture and design patterns I would use for the whole app. User is able to:


Project structure

  1. DbContexts (a bridge between domain entities and the database)
  2. Entities (domain entities Author, Topic)
  3. Services (Repository for DAL)
  4. Models (DTO)
  5. Profiles (mapping entities and DTOs)
  6. Controllers (CRUD operations on entities)
  7. Tools (Logger)

Design patterns

  1. Singleton for logger (dependency injection would be too cumbersome for the bigger app)
  2. Lazy initialization for logger instance (creating instance only when it is truly needed)
  3. Dependency injection of InternetDiscussionContext and InternetDiscussionRepository (creating and disposing is managed by dependency injection container of .NET core)

Architectural patterns

  1. Repository for data access layer
  2. DTO so API doesn't have to reflect DB schema, performance improvement - for list of topics TopicLookupDTO loads only titles and not huge texts in the description
  3. MVC for loose coupling between frontend and backend ("view in the model basically returns the value of microservice")