Background
I made this change to apply the aggerate pattern in the open-source project we chose in the lab. And the goal of this lab is to find the place that can apply aggeration. Therefore we are asked to make 2 pull request
Abstract
When I design the domain diagram for this project. I have the sim domain in my design. But the in sim.py contained many functions like initializing, compute, display, etc. However, the functions were not grouped well together. This creates obscurity in the code and makes it hard to read. Hence, I created three new classes in sim as root aggregate which are set_up, compute and display.
Explanation
The sim module contained many functions that operate on certain data types, which were not aggregated together. For example, all the init_* functions are used to initialize the objects. These functions help construct data on states, so we can aggregate them into sim class to make the code easier to read and understand.
Applying Aggregate Design Pattern to sim.py
Background I made this change to apply the aggerate pattern in the open-source project we chose in the lab. And the goal of this lab is to find the place that can apply aggeration. Therefore we are asked to make 2 pull request
Abstract When I design the domain diagram for this project. I have the sim domain in my design. But the in sim.py contained many functions like initializing, compute, display, etc. However, the functions were not grouped well together. This creates obscurity in the code and makes it hard to read. Hence, I created three new classes in sim as root aggregate which are set_up, compute and display.
Explanation The sim module contained many functions that operate on certain data types, which were not aggregated together. For example, all the init_* functions are used to initialize the objects. These functions help construct data on states, so we can aggregate them into sim class to make the code easier to read and understand.