From e7fb00f10b6315f5f5a89fbc3d9ed8107d6692f0 Mon Sep 17 00:00:00 2001 From: Laurent Date: Wed, 11 Apr 2018 17:23:35 +0200 Subject: [PATCH] Getting started kind of complete --- Chapters/GettingStarted.pillar | 48 +++++++++++++++++- .../figures/qcmagritte_todo_with_model.png | Bin 0 -> 13438 bytes 2 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 Chapters/figures/qcmagritte_todo_with_model.png diff --git a/Chapters/GettingStarted.pillar b/Chapters/GettingStarted.pillar index 04a2feb..772e68d 100644 --- a/Chapters/GettingStarted.pillar +++ b/Chapters/GettingStarted.pillar @@ -65,7 +65,7 @@ as shown in screenshot *@ToDoApplication*. -!!! Models definition +!!! Model definition QCMagritte applications are model driven. That means we will put some effort in describing models handled by the application. Then we expect QCMagritte to @@ -91,6 +91,9 @@ ToDoApplication>>model ^TodoListModel default ]]] + +!!!! ToDo items + For ToDoApplication, we need some ==ToDo items== that have a ==title==, a ==description== and a ==completion== status. Let's declare this class as a subclass of ==QCObject==: @@ -157,4 +160,45 @@ TodoItem>>descriptionCompleted label: 'Completed'; priority: 300; yourself -]]] \ No newline at end of file +]]] + + +!!!! Putting all together + +Finally, we need a way to store created Todo items. We will talk about Glorp +persistence in the next chapter. For now, let's use an +==OrderedCollection==. Add instance variable ==todoItems== in ==TodoListModel== +as follow: + +[[[ +QCBootstrapApplicationModel subclass: #TodoListModel + instanceVariableNames: 'todoItems' + classVariableNames: '' + category: 'Tutorial-Model' + + +TodoListModel>>todoItems + ^todoItems ifNil: [ todoItems := OrderedCollection new ] + +TodoListModel>>todoItems: aCollection + todoItems := aCollection +]]] + +Then describe this variable using Magritte description +==MAToMaManyRelationDescription==: + +[[[ +TodoListModel>>descriptionTodoItems + + ^MAToManyRelationDescription new + label: 'Todo'; + accessor: #todoItems; + priority: 200; + classes: { TodoItem }; + yourself +]]] + +Go back to your web browser, you should be able to create / update / delete some +items (see *@ToDoWithModel*) + ++ToDo application front page>file://figures/qcmagritte_todo_with_model.png|width=70|label=ToDoWithModel+ \ No newline at end of file diff --git a/Chapters/figures/qcmagritte_todo_with_model.png b/Chapters/figures/qcmagritte_todo_with_model.png new file mode 100644 index 0000000000000000000000000000000000000000..9e7eee401d17291c63609fa7cfed7ea2743a063b GIT binary patch literal 13438 zcmcJ0by!#F+U_ExQ&2iYMMXloK@dSC1*AKblx{(g5(Nsa*?2*QlW%SdT>B>Wop)Yhf}-zU@w);<}abI|;L}n>8$yAeI8AoG@Ba17x zw_a6|H~r1I%X2E@+(9zY^Hr*WJxHYe&p`p>x*-8B8 zaOc+dBykQNUzW7P(1-|GW#x$58B6o?!4G@WbzI{6zb$W;+6k21iVA8@PR=_@O8r$Qw?3*(&v(At z`29OTEwe8(^ z=7eub<#9qnLU+kSbxKM~?QC5cnHO(##3hi8ot;+r?x@$V&lnjQA@{2V#l^*YN^P`; zhK8n=`?EJTH!%=y?CcKfD(^kc$H$v;A2KrD*VNGe8Yyl59CfiL?KUCeubV3?Esfcg zBpzN$=~NHz)I>$^eEpA*6F8@swlCMG6kHYHMaXT9&;yZ6Y=t*txt z78GgN&!6V2qva|-e(Mvp`%4+gs`~oR{rwRldLgpi-CZHC?W-j8LI~n9_gZUeb(OtN zphdM3UdeW>g8bpbhj2u1!Uv<` z($$Gty84sD>xLfFXKH)l@ow4Ma~}Ws!)-q%}l?yx+V@W$&N|nf_Kx}PoyYmc00T!gmu=Q)b&XtvwnMUT_3LzoG#>mXf{M^xT z%h9p0an?INV|H|CsG+eD1F&SKK&RN!WNoZ+V|O>084s>%hMQt&{K6@Hnv=s0Yvl54 z#%Hmz z+}sW8d}zuYCS~v5B^W7p;7V#;nx1}Q*%?3m_4Rer&?V72+?y*EuO--C6V(6NrBhQ^ zkBW}QqN1WI0YKoqFYqZP1&N4=c=^SA=Ehq^99&%7u}bImDUYC_AS9)f?(8QKjL$ti z_iVVT=<4dK z@Z4hky|q=Uta>lIU!;A1StK$(ARyq;-kQPC@bKF$a;T+SiS|14)6*E<-rfm9j+l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