Skip to content

Commit e80f7b6

Browse files
committed
fix: modified what pointed out
1 parent 8f1f1cb commit e80f7b6

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,18 @@ However, traditional DI often presented an inconvenience in how methods were gro
88

99
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.
1010

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.
1212

1313
This is achieved through the following mechanism:
1414

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.
1616
- 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.
1717
- 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.
1818

1919
This approach provides strong compile-time guarantees that logic only uses what it declares, while allowing flexible organization of data access implementations.
2020

2121
## Installation
2222

23-
## Install
24-
2523
This package can be installed from [Maven Central Repository][mvn-url].
2624

2725
The examples of declaring that repository and the dependency on this package in Maven `pom.xml` and Gradle `build.gradle` are as follows:
@@ -98,7 +96,7 @@ interface MyData {
9896
void setText(String text) throws Exc;
9997
}
10098

101-
class MyLogic implements Logic {
99+
class MyLogic implements Logic<MyData> {
102100
@Override public void run(MyData data) throws Exc {
103101
String text = data.getText();
104102
data.setText(text);

0 commit comments

Comments
 (0)