Hi, I have created a subclass of WAComponent. Also, I have a class that represents a model and is a subclass of Object. Thus, I was wondering, what's the best way to connect the my model to my component? BTW, I have read the C. David Shaffer's tutorial, "Interlude: Cleaning up the PersonalInformationView" and I'm just trying to see what the best approach for this. Well, thanks in advance.
-Conrad _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
2007/8/29, Conrad Taylor <[hidden email]>:
> Hi, I have created a subclass of WAComponent. Also, I have a class that > represents a model and is a subclass of Object. Thus, I was wondering, > what's the best way to connect the my model to my component? BTW, I have > read the C. David Shaffer's tutorial, "Interlude: Cleaning up the > PersonalInformationView" and I'm just trying to see what the best approach > for this. Well, thanks in advance. In general the view components directly reference the model, e.g. from an instance variable. Cheers Philippe > -Conrad > > > > > > _______________________________________________ > Seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > > Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Hi Philipee, thanks for responding to my post. For example, in Shaffer's tutorial, he did something similar to the following:
WAComponent subclass: #PersonalInformationView
model ^model model model := anObject WAComponent subclass: #AddressBook
edit: aPerson |view| view := PersonalInformationView new. view model: aPerson self call: view. Thus, I take it that one needs to have accessors on the view if you're wanting to modify an instance of a model. Now, each renderContentOn: represents a single view. -Conrad On 8/29/07, Philippe Marschall <[hidden email]> wrote: 2007/8/29, Conrad Taylor <[hidden email]>: _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
2007/8/29, Conrad Taylor <[hidden email]>:
> Hi Philipee, thanks for responding to my post. For example, in Shaffer's > tutorial, he did something similar to the following: > > > WAComponent subclass: #PersonalInformationView > > > model > ^model > > model > model := anObject > > WAComponent subclass: #AddressBook > > edit: aPerson > |view| > view := PersonalInformationView new. > view model: aPerson > self call: view. > > > Thus, I take it that one needs to have accessors on the view if you're > wanting to modify an instance of a model. Not necessarily. It doesn't really matter where the view gets the model from but accessors are probably the most common way. > Now, each renderContentOn: > represents a single view. Each instance of a component class represents a single view. Cheers Philippe > -Conrad > > > On 8/29/07, Philippe Marschall <[hidden email]> wrote: > > > > > > 2007/8/29, Conrad Taylor <[hidden email]>: > > > Hi, I have created a subclass of WAComponent. Also, I have a class that > > > represents a model and is a subclass of Object. Thus, I was wondering, > > > what's the best way to connect the my model to my component? BTW, I > have > > > read the C. David Shaffer's tutorial, "Interlude: Cleaning up the > > > PersonalInformationView" and I'm just trying to see what the best > approach > > > for this. Well, thanks in advance. > > > > In general the view components directly reference the model, e.g. from > > an instance variable. > > > > Cheers > > Philippe > > > > > -Conrad > > > > > > > > > > > > > > > > > > _______________________________________________ > > > Seaside mailing list > > > [hidden email] > > > > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > > > > > > > > _______________________________________________ > > Seaside mailing list > > [hidden email] > > > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > > > > > _______________________________________________ > Seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > > Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Hi, is there a better way than having accessors on the view? If so, please explain.
Thanks, -Conrad
On 8/29/07, Philippe Marschall <[hidden email]> wrote: 2007/8/29, Conrad Taylor <[hidden email]>: _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
2007/8/29, Conrad Taylor <[hidden email]>:
> Hi, is there a better way than having accessors on the view? If so, please > explain. That depends on your requirements. In general accessors are fine unless you have special requirements or believe that accessors break encapsulation. Cheers Philippe > Thanks, > > -Conrad > > > On 8/29/07, Philippe Marschall <[hidden email] > wrote: > > 2007/8/29, Conrad Taylor < [hidden email]>: > > > Hi Philipee, thanks for responding to my post. For example, in > Shaffer's > > > tutorial, he did something similar to the following: > > > > > > > > > WAComponent subclass: #PersonalInformationView > > > > > > > > > model > > > ^model > > > > > > model > > > model := anObject > > > > > > WAComponent subclass: #AddressBook > > > > > > edit: aPerson > > > |view| > > > view := PersonalInformationView new. > > > view model: aPerson > > > self call: view. > > > > > > > > > Thus, I take it that one needs to have accessors on the view if you're > > > wanting to modify an instance of a model. > > > > Not necessarily. It doesn't really matter where the view gets the > > model from but accessors are probably the most common way. > > > > > Now, each renderContentOn: > > > represents a single view. > > > > Each instance of a component class represents a single view. > > > > Cheers > > Philippe > > > > > -Conrad > > > > > > > > > On 8/29/07, Philippe Marschall <[hidden email] > wrote: > > > > > > > > > > > > > > 2007/8/29, Conrad Taylor < [hidden email]>: > > > > > Hi, I have created a subclass of WAComponent. Also, I have a class > that > > > > > represents a model and is a subclass of Object. Thus, I was > wondering, > > > > > what's the best way to connect the my model to my component? BTW, I > > > have > > > > > read the C. David Shaffer's tutorial, "Interlude: Cleaning up the > > > > > PersonalInformationView" and I'm just trying to see what the best > > > approach > > > > > for this. Well, thanks in advance. > > > > > > > > In general the view components directly reference the model, e.g. from > > > > an instance variable. > > > > > > > > Cheers > > > > Philippe > > > > > > > > > -Conrad > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > Seaside mailing list > > > > > [hidden email] > > > > > > > > http://lists.squeakfoundation > .org/cgi-bin/mailman/listinfo/seaside > > > > > > > > > > > > > > _______________________________________________ > > > > Seaside mailing list > > > > [hidden email] > > > > > > > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo /seaside > > > > > > > > > > > > > ______________________________ _________________ > > > Seaside mailing list > > > [hidden email] > > > http://lists.squeakfoundation > .org/cgi-bin/mailman/listinfo/seaside > > > > > > > > _______________________________________________ > > Seaside mailing list > > [hidden email] > > > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > > > > > _______________________________________________ > Seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > > Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Free forum by Nabble | Edit this page |