8000 GitHub - kgrzybek/hotels-manager
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

kgrzybek/hotels-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Hotels Manager

How to run

  1. Build application
  2. Go to src\HotelsManager.CLI\bin\Debug\net8.0
  3. Run dotnet HotelsManager.CLI.dll --hotels hotels.json --bookings bookings.json

You can also run directly from the IDE passing command arguments --hotels hotels.json --bookings bookings.json.

Application Architecture and Design Details

1. Domain-Oriented Application Architecture (Clean, Onion)

The application is divided into the following layers:

  • Domain Layer: Represents the core business concepts and primary computational logic.
  • Application Layer: Responsible for orchestrating use cases.
  • Infrastructure Layer: Handles communication with I/O (e.g., reading JSON files).
  • Presentation Layer: Implements a Command Line Interface (CLI).

2. Dynamic JSON Loading

  • JSON files are loaded dynamically each time they are accessed, which impacts performance.
  • Alternatively, all files can be loaded into memory upfront, improving performance but requiring a restart of the application when files are updated (or implementation of data reload).

3. Simplified Approach

  • No IoC container is used (a "vanilla DI" approach).
  • No additional libraries like CliWrap are used for handling CLI commands.

4. Testing Strategy

Tests are implemented at multiple levels:

  • Domain Level: Unit tests to verify core business logic.
  • Infrastructure Level: Integration tests to verify JSON file handling.
  • Integration Level: Tests validating the entire use case (application, domain, and infrastructure layers).
  • End-to-End Tests: Not included due to the comprehensive coverage of lower-level tests, but they can be added if needed.

5. UX Improvements

Several changes have been made to enhance user experience, such as:

  • Adding Help and Exit commands.
  • Displaying appropriate messages when no availability instead of leaving empty output.

6. Performance Considera 55FC tions

Performance-related topics, such as request rates or JSON file sizes, have not been addressed.

7. Error Handling

  • Basic error handling has been implemented with certain assumptions (e.g., if files contain invalid data or format, an empty list is returned).
  • This strategy is intentional and validated through tests, but alternative approaches could be adopted if needed.

Sample test data

Sample data (JSON files) have been prepared, and their presentation, which is important in the context of the algorithms, is included in the file SampleData.xlsx.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0