I built an asset management system (a web application) using C# ASP.NET in MVC structure. My project is built upon the ASP.NET Boilerplate template, which includes 5 layers by default. These layers are:
- Core (Data) layer: Entity classes, domain services and some core helper classes.
- EntityFramework (ORM) layer: Database context, migration code and repositories. Database is created “code-first” by this layer.
- Application (Service) layer: Application services and data transfer objects. Most business logic lays at this layer.
- Web (View) layer: Controllers, ViewModels, HTML, CSS and JS files.
- API layer: Web services to provide and external endpoint. Usually runs something in app layer and returns.
These are all seperate assemblies, meaning they’re also modules. At the time this project was started, I wasn’t familiar with modular programming at all. So I just settled with these five. Learning about layered structure and decoupling by dependency injection was eye-opening enough for me, so I didn’t bother to create any new modules myself. I built the system with this template and people used it for a whole year.
Then one day, our customer (which is a government institution) made it mandatory for all contractors to get an ISO-15504 SPICE level 2 certificate. To meet the requirements, I had to divide the structure of my application in modules. The system I built is for tracking tangible assets (office equipment, tools and devices) within an organization. And here are the modules I logically divide my app into:
- Authentication Module: Login process, session management and authorization control.
- Listing Module: List, search and filter from assets, locations, people, etc. I’m not sure if this is viable as a module but my app is mostly a spreadsheet browsing system and there are many customer requirements about just listing data.
- Data Transfer Module: Importing data from spreadsheets or external services. Also sending data to the same services and exporting data as an Excel file. Not sure about import/export functionality would belong to the same module but I did it anyway.
- Acquisition Module: Acquiring new assets as batches and assigning them into a storage.
- Asset Profile Module: Entering, editing and displaying asset details.
- Labeling Module: Printing labels for individual assets with info and a QR Code, to easily track them later.
- Assignment Module: Assigning assets from storage to employees.
- Decommission Module: Disposal of old assets, sell or transfer them to another entity.
- Technical Service Module: Deal with broken assets, track calibration periods and such.
- Counting Module: Count the assets periodically with a mobile device and report missing.
So, now I have 10 new modules but they’re all on paper because none of them are seperate assemblies. In my code, these modules are just classes into folders distributed into 5 layers I mentioned before. Every module in this list has a class in almost every layer. Because that was my understanding when I started this project.
Now, I can’t wrap my head around how to structure these modules and layers (which are also modules) in code as seperate assemblies. Shared classes are one thing, but the real issue is, should I make a module out of every layer-module intersection (that would mean nearly 50 modules, not so feasible)?
Another question, which made me open this thread, came today while I was studying the SPICE process about integration. I knew about external integration, like interfacing with an external service or hardware. But there’s also an internal one, between my own modules. I also (kind of) understood this one, but at some point the process requires me to choose an integration (and integration testing) method (bottom-up, top-down, etc.). Which means I had to form a module hierarchy.
As far as I understand, module hierarchies are tree-like structures showing interdependencies between modules to visualize the internal integration structure, so I can choose a fitting method to build and test my integration process. You see, I’m not even sure about how to define my modules in the first place. This integration and hierarchy thing is a whole new abstraction for me. I can easily show the hierarchy between layers. But with my newly defined modules, I’m totally lost.
Any professional help on this issue is greatly appreciated. Googling this doesn’t bring up any solid explanation really. Every site teaches hierarchy by numbering modules as M1, M2, M3… with no practical example anywhere.
1