You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-5Lines changed: 3 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,20 +8,18 @@ However, traditional DI often presented an inconvenience in how methods were gro
8
8
9
9
This framework addresses that inconvenience. The data access interface used by a logic function is unique to that specific logic, passed as an argument to the logic function. This interface declares all the data access methods that specific logic will use.
10
10
11
-
On the data access layer side, implementations can be provided by concrete types that fulfill multiple `DataAcc` derived class. This allows for implementation in any arbitrary unit — whether by external data service, by table, or by functional concern.
11
+
On the data access layer side, implementations can be provided by concrete types that fulfill multiple `DataAcc` derived classes. This allows for implementation in any arbitrary unit — whether by external data service, by table, or by functional concern.
12
12
13
13
This is achieved through the following mechanism:
14
14
15
-
- A `DataHub` class aggregates all data access methods. `DataAcc` derived classs are attached to `DataHub`, giving `DataHub` the implementations of the data access methods.
15
+
- A `DataHub` class aggregates all data access methods. `DataAcc` derived classes are attached to `DataHub`, giving `DataHub` the implementations of the data access methods.
16
16
- Logic functional interfaces accept specific, narrowly defined data access interfaces as arguments. These interfaces declare only the methods relevant to that particular piece of logic.
17
17
- The `DataHub` class implements all of these specific data access interfaces. When a `DataHub` instance is passed to a logic functional interface, the logic functional interface interacts with it via the narrower interface, ensuring it only sees and uses the methods it needs. Using Java's inheritance mechanism, a type implements an interface by methods of other classes. The `DataHub` simply needs to have methods that match the signatures of all the methods declared across the various logic-facing data access interfaces.
18
18
19
19
This approach provides strong compile-time guarantees that logic only uses what it declares, while allowing flexible organization of data access implementations.
20
20
21
21
## Installation
22
22
23
-
## Install
24
-
25
23
This package can be installed from [Maven Central Repository][mvn-url].
26
24
27
25
The examples of declaring that repository and the dependency on this package in Maven `pom.xml` and Gradle `build.gradle` are as follows:
0 commit comments