Reputation: 2378
I am trying to develop an asp.net application in a modular fashion in which functionality is divided among different modules. For instance, one module is inventory management system which has its own UI, BLL, DAL and a separate database schema. Same goes for HR module and User Management.
There is some data (or I should say objects) which are consumed by different modules. For instance Address, as Supplier (Inventory) has an address as well as Employee (HR) has too. Where should I keep such objects? Should I define the address class in all modules which would mean duplicating code or in some global module (which I think makes the modules dependent on the global module.
Sometimes modules does need to use the objects defined in other modules. For instance inventory module requires Employee object(HR) in order to perform some actions, which without the employee object won't be possible. I think this makes the Inventory Modules strongly coupled to HR, killing the purpose of modular design.
How can we make the modules truly independent of each other?
Upvotes: 0
Views: 89
Reputation: 4877
I am not sure what you are looking for. It seems like you already know the issue and the solution for it.
It is not a good idea to have module dependencies just for the sake of using data holders. The common practice is to move common classes like the model objects (Employee, Address etc) into its own separate module. This can be imported by any module.
Upvotes: 1