ppyordanov / Dynamic-Noise-and-Pollution-Map

A dynamically generated University of Glasgow noise and pollution campus map via the innovative Smart Citizen Kit developed in Barcelona, Spain by FabLab.
0 stars 0 forks source link

DAO Services #46

Closed ppyordanov closed 9 years ago

ppyordanov commented 9 years ago

Currently the database access abstraction is in the form of @Repository classes that extend MongoRepository. Those classes are connected directly to the controllers and are used to insert/ retrieve/ modify data via the @Autowired Spring MVC annotation.

This technique provides enough flexibility at the moment and should be sufficient for prototype development. However, when more complex collections querying becomes needed, it will be much more scalable to develop reusable service classes to improve the DAO (data access objects) abstraction. Services will be reusable as they will help encapsulate the complexity of the new, more complex methods used for information retrieval and will be implemented by splitting the current repository classes into, for instance, daoClass and daoImplementationClass. The daoClass then being autowired whenever needed.

NOTE: this is one of the many possible implementation practices and might be changed later.

ppyordanov commented 9 years ago

The @Repository classes used at present are entirely sufficient for the needs of this project as became clear after scaling the level of complexity while going further into the development process.

This issue can be closed now.