- Architecture governance is a system for maintaining consistency and quality in architectural decisions throughout the development process of a software project.
- It involves having control over architectural rules and guidelines and ensuring they are adhered to.
- The fitness function is an important component of architecture governance which acts as a “cop” to ensure developers don’t break established architectural rules and measures the alignment of the software architecture with business goals.
- NetArchTest is a tool that can be used to implement the automatic fitness function by writing unit tests that check dependencies between packages, classes, and methods in the codebase.
What is architecture governance?
When building software projects, there are many architectural decisions that need to be made. It is important to maintain consistency in these decisions to ensure the overall quality and maintainability of the project.
Having a system for architecture governance allows the team to have control over the architectural rules and guidelines, and to ensure that they are being adhered to throughout the development process. This can help to ensure that the project remains on track, and that any issues or inconsistencies are identified and addressed in a timely manner.
Additionally, having a well-defined architecture governance system can facilitate collaboration and communication among team members and help to ensure that everyone is working towards the same goals. This can lead to a more cohesive team and a better end product.
It’s also important to note that architecture governance is not a one time process, but a continuous one that adapts to the changes of the project and the organization. That way, the team can ensure that the software architecture is aligned with the business goals and the evolving requirements.
The fitness function is a way to measure the alignment between the software architecture and the business goals.
One approach to implementing a fitness function is through the use of automatic fitness functions. Automatic fitness functions will be in our case units that will check the validity of architecture decisions.
NetArchTest comes to play
NetArchTest is a library that can be used to write such tests (automatic fitness functions), it allows to check the architecture and ensure that it adheres to predefined rules and constraints.
With NetArchTest, developers can write unit tests that check the dependencies between different packages, classes, and methods in their codebase. This can be useful for checking that the architecture adheres to principles such as separation of concerns and the single responsibility principle. By running these tests regularly, developers can ensure that the architecture remains consistent and that any changes to the codebase do not violate the predefined rules. ADR and Arch unit test is amazing mix that will help you keep consistant great design.
We have identified that the current using the Microsoft ILogger interface does not provide optimal memory efficiency and there is inconsistent code optimization across our solution. This can lead to performance issues within our codebase. Additionally, having a consistent logging implementation across the solution will make it more maintainable and easier to understand.
We have decided to develop a custom shared logging NuGet package with “IOptimizedLogging” interface to improve the efficiency of our logging system.
- Improved memory efficiency: The custom shared logging NuGet package will improve the memory efficiency of the logging system, as the optimized implementation will be used consistently throughout the solution.
- Improved performance: The package will also improve the performance of the logging system, as the code that optimizes log execution will be consistently implemented throughout the solution.
- Increased development and maintenance effort: The development of a custom shared logging NuGet package will require additional resources and effort, including the development and testing of the package, as well as its ongoing maintenance and updates.
- Each new developer or current one has to know that he must use
The team has determined that the current design of the notifications modules, which relies on coupling via interfaces, is not flexible enough to allow for easy integration with other modules.
The decision is to decouple the notifications modules by using events as the only method of integration, where other modules can publish integration events can be consumed by the notifications modules
- Increased flexibility in the overall system design
- Easier integration with other modules
- Improved maintainability of the codebase
- Reduced dependencies between modules
- Cons of decoupling notifications modules by using events:
- Additional complexity in the codebase
- Additional overhead of managing events and event listeners
- The need to re-architect the current notifications modules
- More difficult to debug and troubleshoot if there are issues with the event-based communication.
Checks that any interfaces or class from notifications modules is used in other modules. This checks compliance with a predetermined ADR to avoid coupling via interfaces in the notification module. It is used as a means of ensuring that the code base complies with this ADR and that new developers do not introduce violations of this decision by their lack of knowledge.
This function verifies that the notification module has event handlers that only consume integration events. It is used to ensure that the notification module adheres to an architectural decision (ADR) that specified that the module should be integrated with other modules through events. The function is checking that this design decision is being followed.
Architecture governance is a system for maintaining consistency and quality in architectural decisions throughout the development process of a software project.
It involves having control over architectural rules and guidelines, and ensuring they are adhered to. It also promotes collaboration and communication among team members, and helps to align the software architecture with business goals and evolving requirements.
A key component of architecture governance is the use of a fitness function, which acts as a “cop” to ensure that developers do not break established architectural rules and measures the alignment of the software architecture with business goals. One way to implement this is through automatic fitness functions, such as using NetArchTest, a library for writing unit tests that check dependencies between packages, classes, and methods in the codebase to ensure adherence to predefined rules and principles such as separation of concerns and the single responsibility principle.
If you’re looking for ways to improve your software development skills and stay up to date with the latest trends and best practices, be sure to follow me on dev.to!? I regularly share valuable insights and tips on software development, as well as updates on my latest projects.
Speaking of projects, I’d like to invite you to check out my modular monolith project on GitHub?, called Estimation Tool. It’s a great example of how you can use modularization to build a more scalable and maintainable system. The project is open-source and well-documented, so you can learn by example and see how I applied the concepts of modularization in practice.
So if you’re looking to level up your development skills, be sure to follow me on dev.to and check out my modular monolith project on GitHub. Happy coding!?