-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ADRs: 012-016 - Adding Impact Sections #1627
base: main
Are you sure you want to change the base?
Changes from all commits
cd1e048
e42110e
37ae486
0326b5b
150764e
99011f2
cd07d62
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,15 +12,52 @@ Accepted. | |
|
||
## Context | ||
|
||
Per [ADR 5](./005-oesa.md), one of the principles to follow is that less important code should depend upon more important code. Third party dependencies are less important than our business logic, so how do we isolate the HAPI library's resource classes from our business logic? | ||
Per [ADR 5](./005-oea.md), one of the principles to follow is that less important code should depend upon more important code. Third party dependencies are less important than our business logic, so how do we isolate the HAPI library's resource classes from our business logic? | ||
|
||
We typically isolate libraries by creating an Interface at the library boundary. To take advantage of Java's type safety we define the interface using Generic types to ensure that the correct classes are used. On a wrapper Interface we always include a method to retrieve the underlying object. Extra methods are defined based on business needs. The implementation of this interface is customized to use the underlying third party library. | ||
|
||
Our business logic can then use the wrapper Interface without needing to know the actual underlying implementation, and that implementation can be changed without changing the Interface that the business logic relies on. | ||
|
||
You can see an example of this in [Order.java](../etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/orders/Order.java) (the interface) and [HapiOrder.java](../etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/hapi/HapiOrder.java) (the implementation). | ||
|
||
|
||
## Impact | ||
|
||
### Positive | ||
|
||
- **Decoupling of Business Logic and Third-Party Libraries:** allows us to decouple our business logic from the specific implementation details of the third-party library. This enhances maintainability and readability. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might be beneficial to add specific examples or case studies that demonstrate the positive impacts mentioned, such as how the decoupling has concretely improved maintainability in past projects. [medium] |
||
|
||
|
||
- **Flexibility and Extensibility:** The use of interfaces provides flexibility to switch to a different FHIR library in the future without requiring significant changes to the business logic. New functionalities can also be added easily by extending the wrapper interface. | ||
|
||
|
||
- **Enhanced Testability:** The wrapper interface makes it easier to mock (or stub) dependencies during testing, allowing for more effective unit tests without relying on the actual HAPI FHIR implementation. | ||
|
||
|
||
- **Consistent API:** Wrapping the resource classes can help enforce a consistent API across different types of resources. | ||
|
||
### Negative | ||
|
||
- **Performance Overhead:** Wrapping resource classes could introduce slight performance overhead due to additional method calls. However, this is generally minimal and acceptable for the benefits gained. | ||
|
||
|
||
- **Maintenance of Wrapper Classes:** As the HAPI FHIR library or business requirements evolve, the wrapper classes will need to be maintained to ensure they remain compatible with the underlying library. | ||
|
||
### Risks | ||
|
||
- **Increased Complexity:** Having an additional layer (the wrapper) may add complexity to the codebase. Developers must understand both the wrapper and the underlying library, which can increase the learning curve. | ||
|
||
|
||
- **Dependency on Wrapper Design:** If the wrapper interface is not designed thoughtfully, it may limit flexibility or create tight coupling with specific implementations, countering the goal of decoupling. | ||
|
||
|
||
- **Integration Challenges:** If we switch to a different FHIR library, there may be unforeseen integration challenges that arise from differences in implementation details or API design. | ||
|
||
|
||
- **Increased Development Time:** Initially creating wrapper classes may require additional development time and effort, especially if the resource classes are extensive or complex. | ||
|
||
|
||
### Related Issues | ||
|
||
- #79 | ||
- [ADR 5 - Option-enabling Software Architecture (OeSA)](./005-oesa.md) | ||
- [ADR 5 - Option-enabling Architecture (OeA)](./005-oea.md) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,35 @@ Accepted. | |
|
||
This naming convention applies to all locations where our keys are stored. Previously, we didn't have a consistent naming convention across all our locations which caused confusion on which key was to be used in which context and environment. | ||
|
||
|
||
## Impact | ||
|
||
|
||
### Positive | ||
|
||
- **Clarity and Consistency:** Standardized naming ensures keys are easily identifiable and reduces misconfigurations. | ||
|
||
|
||
- **Improved Operations:** Teams will spend less time resolving key-related issues. | ||
|
||
|
||
- **Scalability:** As more organizations integrate, the naming convention will simplify management and avoid duplication. | ||
|
||
### Negative | ||
|
||
- **Migration Effort:** Renaming existing keys and updating references in systems may require a one-time effort. | ||
|
||
|
||
### Risks | ||
|
||
- **Human Error in Implementation:** Incorrectly applying the naming convention during key creation or migration could lead to confusion or outages. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To address the risk of human error in implementation, consider recommending specific tools or automated checks that can enforce the naming conventions consistently across the project. [important] |
||
|
||
|
||
- **Lack of Enforcement:** Without clear processes or automation, teams might unintentionally deviate from the convention. | ||
|
||
|
||
- **Backward Compatibility:** Older systems or scripts may fail if they rely on the previous key names. | ||
|
||
### Related Issues | ||
|
||
- #584 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider reducing the verbosity of the Impact section by summarizing the key points more succinctly. This will help maintain the readability and focus of the document. [important]