-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfactoryDemo.p
45 lines (32 loc) · 1.52 KB
/
factoryDemo.p
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*------------------------------------------------------------------------
File : factoryDemo.p
Purpose :
Syntax :
Description :
Author(s) : Lutz Fechner
Created : Fri Sep 15 16:31:23 CEST 2023
Notes :
----------------------------------------------------------------------*/
/* *************************** Definitions ************************** */
BLOCK-LEVEL ON ERROR UNDO, THROW.
USING Consultingwerk.Demo.Decorator.*.
USING Consultingwerk.Demo.Factory.*.
DEFINE VARIABLE oHouse AS IHouse NO-UNDO.
/* *************************** Main Block *************************** */
oHouse = HouseBuilder:Build(""):House. //you don't see who build the object for you
DISPLAY "Basic House Energy Consuption: " oHouse:GetEndEnergyConsumption() SKIP.
oHouse = HouseBuilder:Build("modern"):House. //you don't see who build the object for you
DISPLAY "Modern House Energy Consuption: " oHouse:GetEndEnergyConsumption().
oHouse = NEW ClassWithUglyConstructor(FALSE,
FALSE,
"",
5,
12.0,
6,
TRUE,
TRUE,
5,
6,
"WTF",
FALSE,
FALSE).