Skip to content

Commit 251effb

Browse files
Refining the README.md file
1 parent fc6b27c commit 251effb

File tree

1 file changed

+24
-14
lines changed

1 file changed

+24
-14
lines changed

README.md

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ JDS is licensed under the [3-Clause BSD License](https://opensource.org/licenses
2828

2929
The concept behind JDS is quite simple. Extend a base **Entity** class, define strongly-typed **Fields** and then **map** them against implementations of the **Property** interface.
3030

31-
JDS was designed to avoid reflection, and its potential performance implications, as such mapping is used as oppossed to using Annotations .
31+
JDS was designed to avoid reflection and its potential performance pitfalls.
32+
As such mapping functions which are overridden, and invoked at least once at runtime, are used to enforce/validate typing as instead of annotations.
33+
This is discussed below in section 1.1.4 "Binding properties".
3234

3335
## Features
3436

@@ -50,14 +52,14 @@ Maven
5052
<dependency>
5153
<groupId>io.github.subiyacryolite</groupId>
5254
<artifactId>jds</artifactId>
53-
<version>20.4-SNAPSHOT</version>
55+
<version>20.4</version>
5456
</dependency>
5557
```
5658

5759
Gradle
5860

5961
```groovy
60-
compile 'io.github.subiyacryolite:jds:20.4-SNAPSHOT'
62+
compile 'io.github.subiyacryolite:jds:20.4'
6163
```
6264

6365
# Dependencies
@@ -100,22 +102,25 @@ public interface IAddress : IEntity
100102
public class Address : IAddress
101103
```
102104

103-
Following that the following steps need to be taken.
104-
105105
### 1.1.1 Annotating Classes
106106

107-
Every class that extends Entity must have its own unique Entity Id as well as an Entity Name. This is done by annotating the class, or its parent interface, in the following manner
107+
Every class/interface which extends Entity/IEntity must have its own unique Entity ID as well as an Entity Name.
108+
This is done by annotating the class, or its (parent) interface.
108109

109110
```kotlin
110111
@EntityAnnotation(id = 1, name = "address", description = "An entity representing address information")
111112
class Address : Entity()
112113
```
113114

114-
Entity IDs MUST be unique in your application, any value of type long is valid. Entity Names do not enforce unique constraints but its best to use a unique name regardless. These values can be referenced to mine data.
115+
Entity IDs MUST be unique in your application, any value of type long is valid.
116+
Entity Names do not enforce unique constraints but its best to use a unique name regardless.
117+
These values can be referenced to mine data.
115118

116119
### 1.1.2 Defining Fields
117120

118-
Fields are big part of the JDS framework. Each Field MUST have a unique Field Id. Field Names do not enforce unique constraints but its best to use a unique name regardless. These values can be referenced to mine data. Every Field that you define can be one of the following types.
121+
Fields are big part of the JDS framework.
122+
Each Field MUST have a unique Field Id. Field Names do not enforce unique constraints but its best to use a unique name
123+
regardless. These values can be referenced to mine data. Every Field that you define can be one of the following types.
119124

120125
| JDS Field Type | Java Type | Description |
121126
| -------------------- | ------------------------------------------ | --------------------------------------------------------------|
@@ -167,7 +172,7 @@ object Fields {
167172
}
168173
```
169174

170-
Furthermore you can add descriptions, of up to **256 characters**, to each field
175+
Furthermore, you can add descriptions, of up to **256 characters**, to each field
171176

172177
```kotlin
173178
import io.github.subiyacryolite.jds.Field;
@@ -181,7 +186,9 @@ object Fields {
181186
}
182187
```
183188

184-
JDS also supports **Tags** which can be applied to each **Field** and **Entity** definitions. Tags are implemented as a set of strings, there is no limit on how many tags a field can have. This can be useful for categorising certain kinds of information
189+
JDS also supports **Tags** which can be applied to each **Field** and **Entity** definitions. Tags can be defined as a
190+
set of strings, there is no limit on how many tags a field can have. This can be useful for categorising certain kinds
191+
of information
185192

186193
```kotlin
187194
import io.github.subiyacryolite.jds.Field;
@@ -195,9 +202,9 @@ object Fields {
195202

196203
### 1.1.3 Defining Enums
197204

198-
Enums are an extension of **Fields**. However, they are designed for cases where one or more constant values are required. Usually these values would be represented by Check Boxes, Radio Buttons or Combo Boxes in a UI. In this example we will define the type of an address as an enumerated value with the following options (YES, NO).
205+
JDS Enums are an extension of **Fields**. Usually these values would be represented by Check Boxes, Radio Buttons or Combo Boxes on the front-end.
199206

200-
First of all we'd have to define a standard Field of type **Enum**.
207+
First we'd define a standard JDS Field of type **Enum**.
201208

202209
```kotlin
203210
import io.github.subiyacryolite.jds.Field
@@ -217,6 +224,8 @@ enum class Direction {
217224
}
218225
```
219226

227+
Lastly, we create an instance of the JDS Field Enum type.
228+
220229
```kotlin
221230
import io.github.subiyacryolite.jds.FieldEnum
222231

@@ -311,15 +320,16 @@ To simplify the mapping Process Jds has the following helper classes defined:
311320

312321
**Note:** Collection types can be of any valid type e.g. ArrayList, LinkedList, HashSet etc
313322

314-
After your class and its properties have been defined you must map the property to its corresponding Field using the **map()** method. I recommend doing this in your primary constructor.
323+
After your class and its properties have been defined you must map the property to its corresponding Field using the **map()** method.
324+
I recommend doing this in your primary constructor.
315325

316326
The example below shows a class definition with valid properties and bindings. With this your class can be persisted.
317327

318328
Note that the example below has a 3rd parameter to the map method, this is the **Property Name**
319329

320330
The **Property Name** is used by the JDS **Field Dictionary** to know which **property** a particular **Field** is mapped to within an **Entity**.
321331

322-
This is necessary as one **Field** definition may be mapped to a different property amongst different **Entities**.
332+
This is necessary as one **Field** definition can be mapped to a different property amongst different **Entities**.
323333

324334
For example a **Field** called "FirstName" could be mapped to a property called "firstName" in one **Entity** and a property called "givenName" in another.
325335

0 commit comments

Comments
 (0)