1. Do you mean snake and ladder dto...then those acts as entity defining them... they are being used in respective repository to store them. 2. Design Principles: Single responsibility of class. 3. As asked to keep everything in memory... decoupling that storage logic from actual business/service layer of our application.
@@ShubhamHaritash I don't see snake and ladder dto being used anywhere in the code, we are directly storing start and end in the map. So many services will also take so many resources. It would be better to have one service and one repository class only
@@nitinmathur7454 I had directly used integer instead of having snake.start.....coz....of data type similarity..... Coming to repository and service decision...it's design decisions you may have...but that what design Principles states to us....aka Best practices....adding 2 extra class would not tremendously increase memory usage....as in real life application...there are n numbers of class...code maintaince precides all stuff....
Great one🎉 plz post more of machine coding rounds
Where are you using the snake and ladder object? And why do we need so many services ? And repositories as well.
1. Do you mean snake and ladder dto...then those acts as entity defining them... they are being used in respective repository to store them.
2. Design Principles: Single responsibility of class.
3. As asked to keep everything in memory... decoupling that storage logic from actual business/service layer of our application.
@@ShubhamHaritash I don't see snake and ladder dto being used anywhere in the code, we are directly storing start and end in the map. So many services will also take so many resources. It would be better to have one service and one repository class only
@@nitinmathur7454 I had directly used integer instead of having snake.start.....coz....of data type similarity.....
Coming to repository and service decision...it's design decisions you may have...but that what design Principles states to us....aka Best practices....adding 2 extra class would not tremendously increase memory usage....as in real life application...there are n numbers of class...code maintaince precides all stuff....
For this no need of UI
Nope....you just need to build command line application in any MC round.