ZooSimulatorLibrary 1.0.3
dotnet add package ZooSimulatorLibrary --version 1.0.3
NuGet\Install-Package ZooSimulatorLibrary -Version 1.0.3
<PackageReference Include="ZooSimulatorLibrary" Version="1.0.3" />
<PackageVersion Include="ZooSimulatorLibrary" Version="1.0.3" />
<PackageReference Include="ZooSimulatorLibrary" />
paket add ZooSimulatorLibrary --version 1.0.3
#r "nuget: ZooSimulatorLibrary, 1.0.3"
#:package ZooSimulatorLibrary@1.0.3
#addin nuget:?package=ZooSimulatorLibrary&version=1.0.3
#tool nuget:?package=ZooSimulatorLibrary&version=1.0.3
ZooSimulatorLibrary:
The Zoo Simulator is a meticulously architected application designed to model a dynamic zoo environment where diverse animals interact, exhibit behaviours, and maintain health statuses. Central to its robustness and maintainability, the simulator rigorously adheres to the SOLID principles, ensuring each class has a single responsibility, remains open for extension but closed for modification, and upholds reliable inheritance and interface segregation. This adherence facilitates seamless scalability and ease of maintenance.
Complementing these principles, the Zoo Simulator employs a variety of design patterns such as the Strategy Pattern for flexible health management, the Observer Pattern to handle dynamic event notifications, the State Pattern for managing animal life states, and the Factory Method Pattern to streamline the creation of diverse animal types. The Singleton Pattern and the Template Pattern are also used.
Additionally, the Disposable Pattern ensures efficient resource management, preventing memory leaks and promoting optimal performance. Together, these SOLID principles and design patterns create a highly organized, extensible, and resilient architecture, enabling the Zoo Simulator to efficiently manage complex interactions and evolve with future enhancements.
Furthermore, asynchronous programming is widely used to run background processes that monitors and handles animal’s life over a given time period. This backend logic has been written in a .NET Core library named ZooSimulatorLibrary. It is available through NuGet Package downloadable by writing ZooSimulatorLibrary or by searching the developer’s name: Salvatore Amaddio.
SOLID:
The Zoo Simulator meticulously adheres to the SOLID principles, ensuring a well-structured, maintainable, and scalable architecture. Single Responsibility is exemplified through distinct classes such as HealthService, FeedingService, and MortuaryService, each dedicated to managing specific aspects of animal care and zoo operations.
The Open/Closed Principle is upheld by designing classes that are open for extension but closed for modification; for example, new animal types like Lion or Tiger can be integrated by extending the AbstractAnimal class without altering existing service implementations.
Liskov Substitution is maintained by ensuring that subclasses of AbstractAnimal, such as Monkey, Giraffe, and Elephant, can seamlessly replace their superclass without affecting the correctness of the program.
The Interface Segregation Principle is achieved by utilizing focused interfaces like IHealthService and IFeedingService, which prevent classes from being burdened with unnecessary methods and promote cleaner, more modular code.
Lastly, the Dependency Inversion Principle is implemented by depending on abstractions rather than concrete classes; services are injected into classes like AbstractZoo through interfaces, enhancing flexibility and facilitating easier testing and maintenance. Collectively, these SOLID principles fortify the Zoo Simulator's architecture, making it robust against changes and scalable for future enhancements
Design Patterns:
Animal Template Pattern
The AbstractAnimal class provides a template for initializing health services in its constructor. Derived classes like Monkey, Elephant and Giraffe can override specific steps (e.g., providing custom service implementations) without altering the overall initialization process.
Animal Strategy Pattern
Interfaces like IHealthService and IHealthMonitorService represent different strategies for managing and monitoring animal health. Concrete implementations such as GeneralHealthService, GeneralHealthMonitorService, and ElephantHealthMonitorService encapsulate specific behaviors, allowing for dynamic selection and modification of health-related algorithms without altering the animal classes.
State Change Pattern
The HealthMonitorService class utilizes the State Pattern to manage the life states of animals (AliveState, DyingState, DeadState). By encapsulating state-specific behaviors within distinct state classes, the HealthMonitorService can dynamically transition an animal's state based on its health levels. This approach ensures that each state manages its own behaviour, enhancing code maintainability and scalability.
The State Pattern is employed within your Zoo Simulator to manage the dynamic life states of animals, ensuring that behaviours are appropriately encapsulated and easily maintainable
Zoo Template Pattern
:
The AbstractZoo class provides a template for initializing feeding and mortuary services in its constructor. Derived classes like Zoo can override specific steps (e.g., providing custom service implementations) without altering the overall initialization process.
Zoo Strategy Pattern
Interfaces like IFeedingService and IMortuaryService define strategies for feeding and mortuary operations, enabling the system to switch or extend these behaviors seamlessly.
Others
This library is used in ZooSimulator GitHub Repository
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Microsoft.Extensions.DependencyInjection (>= 8.0.1)
- Refractored.MvvmHelpers (>= 1.6.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.