Skip to content

Commit 46d5653

Browse files
author
bobgarner
committed
Fixed some issues with Module 6
1 parent b5092c2 commit 46d5653

File tree

9 files changed

+54
-80
lines changed

9 files changed

+54
-80
lines changed

EntityCompiler/Module6/README.md

Lines changed: 14 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ The `path` is either an absolute path or a relative path. If you specify a relat
5151

5252
For a git repository on **Github**, there are more parameters you need to set:
5353

54-
|Parameter|Description|
55-
| ------- | --------- |
56-
| `organization`|The name of the github organization owning the repository.|
57-
| `name`| The name of the repository. |
58-
| `path`| An optional path inside the git repository where you would like this repository declaration to be rooted. |
59-
| `tag`|An optional tag from which to pull the files from the git repository. This is how you can implement revision control.|
54+
|Parameter| Description |
55+
| ------- |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
56+
| `organization`| The name of the github organization owning the repository. |
57+
| `name`| The name of the repository. |
58+
| `path`| An optional path inside the git repository where you would like this repository declaration to be rooted. |
59+
| `tag`| An optional tag from which to pull the files from the git repository. This is how you can implement revision control. It can also be a branch name which would allow you to control a release of files with git. |
6060

6161
For example:
6262

@@ -172,7 +172,7 @@ This specialized domain definition assumes you import the original domain defini
172172

173173
Here we will use the same github repository that manages this tutorial from which to import model elements.
174174

175-
We will start with the solution of Module 5 Session 3 and transform it to use repositories and imports. The `repo` folder is already populated with the files you will need to import.
175+
We will start with the solution of Module 4 Session 3 and transform it to use repositories and imports. The `repo` folder is already populated with the files you will need to import.
176176

177177
#### Step 1
178178

@@ -185,14 +185,12 @@ Inside the `space Space {}` block we'll first define a repository for importing
185185
type github
186186
organization "entityc"
187187
name "ec-tutorials"
188-
path "Module7/Session2/repo/entities"
189-
tag "e1.0.0"
188+
path "Module6/Session3/repo/entities"
189+
tag "main"
190190
}
191191
```
192192

193-
Notice the `path` takes us not just to the `repo` folder but also to the `entities` subfolder inside it.
194-
195-
> Instead of prefixing our tag with a `v` for version, we will use `e` for entity (version). This way we can have tags for entity versions independent of the other model elements.
193+
Notice the `path` takes us not just to the `repo` folder but also to the `entities` subfolder inside it. Also note we use the tag "main" so that we are always pulling from the official released version of these files.
196194

197195
Now we want to import the files. Each module was placed into its own `.edl` file so we will import three files as follows:
198196

@@ -231,15 +229,13 @@ The parts that we deleted will instead be imported. Edit `Spaces.edl` again and
231229
type github
232230
organization "entityc"
233231
name "ec-tutorials"
234-
path "Module7/Session2/repo/domains"
235-
tag "d1.0.0"
232+
path "Module6/Session2/repo/domains"
233+
tag "main"
236234
}
237235
```
238236

239237
This time we are pointing to the `domains` subfolder of the `repo` folder.
240238

241-
> Again, note that our `tag` starts with a `d` for domain (version).
242-
243239
Each of the domains have been placed into their own files so we will import each one as follows:
244240

245241
```
@@ -256,14 +252,12 @@ Since we will be importing all of what is contained in the `Units.edl` file you
256252
organization "entityc"
257253
name "ec-tutorials"
258254
path "Module7/Session2/repo/standards"
259-
tag "s1.0.0"
255+
tag "main"
260256
}
261257
```
262258

263259
Again, it points to a `standards` subfolder of the `repo` folder. This repository can be used for more than units, it can also be used to store language definitions.
264260

265-
> Again, note that our `tag` starts with a `s` for standards (version).
266-
267261
Below this we can import the units as follows:
268262

269263
```
@@ -284,7 +278,7 @@ Now its time to run:
284278
./run.sh
285279
```
286280

287-
The output should be identical to that of Module 5 Session 3.
281+
The output should be identical to that of Module 4 Session 3.
288282

289283
#### Step 5
290284

@@ -422,15 +416,3 @@ It's time to run:
422416
```
423417

424418
The output should look the same as the previous session (with the repository tags being the same).
425-
426-
#### Step 5
427-
428-
As in the last session, lets change the tag in our repository definition to use upgraded templates. Edit `Space.edl` and for `TemplatesRepository` change its `tag` to `t1.1.0`.
429-
430-
Run the compiler again:
431-
432-
```
433-
./run.sh
434-
```
435-
436-
The difference in the template code is just minor, the output should basically have the same information but slight changes in the formatting.

EntityCompiler/Module6/Session2/solution/ec/Space.edl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ space Space
44
type github
55
organization "entityc"
66
name "ec-tutorials"
7-
path "Module7/Session2/repo/entities"
8-
tag "e1.0.0" // "e1.1.0" // "e1.2.0"
7+
path "EntityCompiler/Module6/Session2/repo/entities"
8+
tag "main"
99
}
1010

1111
import Graphics, Accessories, User from EntityRepository
@@ -14,8 +14,8 @@ space Space
1414
type github
1515
organization "entityc"
1616
name "ec-tutorials"
17-
path "Module7/Session2/repo/domains"
18-
tag "d1.0.0" // "d1.1.0"
17+
path "EntityCompiler/Module6/Session2/repo/domains"
18+
tag "main"
1919
}
2020

2121
import Database, Model, DTO, API from DomainRepository
@@ -24,8 +24,8 @@ space Space
2424
type github
2525
organization "entityc"
2626
name "ec-tutorials"
27-
path "Module7/Session2/repo/standards"
28-
tag "s1.0.0" // "s1.1.0"
27+
path "EntityCompiler/Module6/Session2/repo/standards"
28+
tag "main"
2929
}
3030

3131
import Units from StandardsRepository

EntityCompiler/Module6/Session3/ec/Space.edl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ space Space
44
type github
55
organization "entityc"
66
name "ec-tutorials"
7-
path "Module7/Session2/repo/entities"
8-
tag "e1.0.0" // "e1.1.0" // "e1.2.0"
7+
path "EntityCompiler/Module6/Session2/repo/entities"
8+
tag "main"
99
}
1010

1111
import Graphics, Accessories, User from EntityRepository
@@ -14,8 +14,8 @@ space Space
1414
type github
1515
organization "entityc"
1616
name "ec-tutorials"
17-
path "Module7/Session2/repo/domains"
18-
tag "d1.0.0" // "d1.1.0"
17+
path "EntityCompiler/Module6/Session2/repo/domains"
18+
tag "main"
1919
}
2020

2121
import Database, Model, DTO, API from DomainRepository
@@ -24,8 +24,8 @@ space Space
2424
type github
2525
organization "entityc"
2626
name "ec-tutorials"
27-
path "Module7/Session2/repo/standards"
28-
tag "s1.0.0" // "s1.1.0"
27+
path "EntityCompiler/Module6/Session2/repo/standards"
28+
tag "main"
2929
}
3030

3131
import Units from StandardsRepository
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
$[domain APICode]
22
$[log]
3-
===========
4-
API
5-
===========
3+
=========== API ===========
64
$[foreach entity in space.entities]
75
$[if entity.isSecondary]$[continue]$[/if]
86

97
API Class> ${entity|domain|name}
10-
Get ${entity.name|title} List> GET /api/${entity|domain:APIPath|name}
11-
Returns objects of class> ${entity|domain:DTO|name}
8+
Get ${entity.name|title} List: GET /api/${entity|domain:APIPath|name}
9+
Returns objects of class ${entity|domain:DTO|name}
1210
$[/foreach]
1311
$[/log]
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
$[domain Database]
22
$[log]
3-
===========
4-
DATABASE
5-
===========
3+
=========== DATABASE ===========
64
$[foreach entity in space.entities]
75

8-
Table> ${entity|domain|name}
6+
Table: ${entity|domain|name}
97
$[if entity.hasPrimaryKey]
10-
PK> ${entity.primaryKeyAttribute|domain|name}
8+
PK: ${entity.primaryKeyAttribute|domain|name}
119
$[/if]
1210
$[foreach attribute in (entity|domain).attributes]
13-
Column> ${attribute|name}
11+
Column: ${attribute|name}
1412
$[/foreach]
1513
$[/foreach]
1614
$[/log]
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
$[domain DTO]
22
$[log]
3-
===========
4-
DTO
5-
===========
3+
=========== DTO ===========
64
$[foreach entity in space.entities]
75

8-
Class> ${entity|domain|fullname}
6+
Class: ${entity|domain|fullname}
97
$[if entity.hasPrimaryKey]
10-
PK> ${entity.primaryKeyAttribute|domain|name}
8+
PK: ${entity.primaryKeyAttribute|domain|name}
119
$[/if]
1210
$[foreach attribute in (entity|domain).attributes]
13-
Member> ${attribute|name}
11+
Member: ${attribute|name}
1412
$[/foreach]
1513
$[/foreach]
1614
$[/log]

EntityCompiler/Module6/Session3/repo/templates/data/ModelTemplate.eml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,28 @@
11
$[domain Model]
22
$[log]
3-
===========
4-
MODEL
5-
===========
3+
=========== MODEL ===========
64
$[foreach module in space.modules]
75

8-
MODULE> ${module|domain|name}
6+
MODULE: ${module|domain|name}
97
$[foreach typedef in module.typedefs]
108

11-
Typedef> ${typedef|domain|name}
9+
Typedef: ${typedef|domain|name}
1210
$[/foreach]
1311
$[foreach enum in module.enums]
1412

15-
Enum> ${enum|domain|name}
13+
Enum: ${enum|domain|name}
1614
$[foreach item in enum.items]
1715
${item.value}) ${item|domain|name}
1816
$[/foreach]
1917
$[/foreach]
2018
$[foreach entity in module.entities]
2119

22-
Class> ${entity|domain|fullname:("::")}
20+
Class: ${entity|domain|fullname:("::")}
2321
$[if entity.hasPrimaryKey]
24-
PK> ${entity.primaryKeyAttribute|domain|name}
22+
PK: ${entity.primaryKeyAttribute|domain|name}
2523
$[/if]
2624
$[foreach attribute in entity.attributes]
27-
Member> ${attribute|domain|name}
25+
Member: ${attribute|domain|name}
2826
$[/foreach]
2927
$[/foreach]
3028
$[/foreach]

EntityCompiler/Module6/Session3/solution/ec/Configuration.edl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ configuration Tutorial
33
templates {
44
import from TemplatesRepository
55
template DatabaseTemplate {}
6-
template DTOTemplate in "data/DTOTemplate" {}
7-
template ModelTemplate in "data/ModelTemplate" {}
6+
template DTOTemplate in "data" {}
7+
template ModelTemplate in "data" {}
88
template APITemplate {}
99
}
1010
}

EntityCompiler/Module6/Session3/solution/ec/Space.edl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ space Space
44
type github
55
organization "entityc"
66
name "ec-tutorials"
7-
path "Module7/Session2/repo/entities"
8-
tag "e1.0.0" // "e1.1.0" // "e1.2.0"
7+
path "EntityCompiler/Module6/Session2/repo/entities"
8+
tag "main"
99
}
1010

1111
import Graphics, Accessories, User from EntityRepository
@@ -14,8 +14,8 @@ space Space
1414
type github
1515
organization "entityc"
1616
name "ec-tutorials"
17-
path "Module7/Session2/repo/domains"
18-
tag "d1.0.0" // "d1.1.0"
17+
path "EntityCompiler/Module6/Session2/repo/domains"
18+
tag "main"
1919
}
2020

2121
import Database, Model, DTO, API from DomainRepository
@@ -24,8 +24,8 @@ space Space
2424
type github
2525
organization "entityc"
2626
name "ec-tutorials"
27-
path "Module7/Session2/repo/standards"
28-
tag "s1.0.0" // "s1.1.0"
27+
path "EntityCompiler/Module6/Session2/repo/standards"
28+
tag "main"
2929
}
3030

3131
import Units from StandardsRepository
@@ -34,7 +34,7 @@ space Space
3434
type github
3535
organization "entityc"
3636
name "ec-tutorials"
37-
path "Module7/Session3/repo/templates"
38-
tag "t1.0.0" // "t1.1.0"
37+
path "EntityCompiler/Module6/Session3/repo/templates"
38+
tag "main"
3939
}
4040
}

0 commit comments

Comments
 (0)