Hi,
In the tutorial, step 6, you are shown how to add a "Add a new entry" link to your viewMain. The added code looks like so: e addBreak. e addLinkTo: self text: 'Add a new entry' view: #add. When I did this, I was puzzled by the generated URL for the linked to page: http://localhost:8888/an%20ademoaddressbookapp.html?view=add
_______________________________________________ Aida mailing list [hidden email] http://lists.aidaweb.si/mailman/listinfo/aida |
Hi,
In AIDA/Web, domain objects have urls. In fact, the idea behing this is that each object has its own url. So, we create links between objects, never between applications. So, yes, it's : "e addLinkTo: self observee..." > > (It does seem wrong to me that the view for adding an address is in the AddressBook model, but I leave that to another post). No! View methods are always in the applications. The model doesn't deal with view and action methods. So, when you create a link to an object, what's going on? To keep it simple, it's similar to: Click on the link to the model -> Find an application for the model -> Display the view method of the application I hope this helps. Cheers! Nico -- Nicolas Petton http://nico.bioskop.fr ___ ooooooo OOOOOOOOO |Smalltalk| OOOOOOOOO ooooooo \ / [|] -------------------------------- Ma clé PGP est disponible ici : http://nico.bioskop.fr/pgp-key.html _______________________________________________ Aida mailing list [hidden email] http://lists.aidaweb.si/mailman/listinfo/aida signature.asc (196 bytes) Download Attachment |
Hi,
2008/9/22 nico <[hidden email]> Hi, So the tutorial should be corrected.
Sorry - I made a mistake in my comment and so my objection wasn't clear. The tutorial tells you to create a viewAdd method to the ADemoAddressBookApp class. I understand that it is on the "App" class - that's the "View" in my understanding of MVC.
But the viewAdd method has to know all about the insides of an "ADemoAddress". So its in the wrong place. The code that knows what's inside an ADemoAddress should ideally be in the ADemoAddress class, not so? Or, maybe the ADemoAddressApp.
Actually, the same objection stands for the viewMain method in ADemoAddressBookApp, which knows the names of the "columns" (instance variables) of the ADemoAddress. Am I picking nits?
Steve _______________________________________________ Aida mailing list [hidden email] http://lists.aidaweb.si/mailman/listinfo/aida |
Le lundi 22 septembre 2008 à 21:23 +0200, Stephen Davies a écrit :
> Hi, > > 2008/9/22 nico <[hidden email]> > Hi, > > In AIDA/Web, domain objects have urls. In fact, the idea > behing this is > that each object has its own url. So, we create links between > objects, > never between applications. > > So, yes, it's : > "e addLinkTo: self observee..." > > > > > So the tutorial should be corrected. > > > > > > > (It does seem wrong to me that the view for adding an > address is in the AddressBook model, but I leave that to > another post). > > > No! View methods are always in the applications. The model > doesn't deal > with view and action methods. > > > > > Sorry - I made a mistake in my comment and so my objection wasn't > clear. > > > The tutorial tells you to create a viewAdd method to the > ADemoAddressBookApp class. I understand that it is on the "App" class > - that's the "View" in my understanding of MVC. > > > But the viewAdd method has to know all about the insides of an > "ADemoAddress". So its in the wrong place. The code that knows > what's inside an ADemoAddress should ideally be in the ADemoAddress > class, not so? Or, maybe the ADemoAddressApp. do it this way. > > > Actually, the same objection stands for the viewMain method in > ADemoAddressBookApp, which knows the names of the "columns" (instance > variables) of the ADemoAddress. > > > Am I picking nits? Well, it's just a tutorial, but for real aida applications it's better to write views (#viewAdd in this case) in the right place :) Cheers! Nico -- Nicolas Petton http://nico.bioskop.fr ___ ooooooo OOOOOOOOO |Smalltalk| OOOOOOOOO ooooooo \ / [|] -------------------------------- Ma clé PGP est disponible ici : http://nico.bioskop.fr/pgp-key.html _______________________________________________ Aida mailing list [hidden email] http://lists.aidaweb.si/mailman/listinfo/aida signature.asc (196 bytes) Download Attachment |
In reply to this post by Stephen Davies-3
Hi Stephen,
Stephen Davies wrote: > So, yes, it's : > "e addLinkTo: self observee..." > > So the tutorial should be corrected. Yep, you are right, I just correct the tutorial in 6.Forms. Please if you see any other strange thing in tutorial, report it. I also corrected square brackets to be actually shown. In Scribo editor square brackets mean new page link, but you can escape it wit two opening brackets: [[. Best regards JAnko -- Janko Mivšek AIDA/Web Smalltalk Web Application Server http://www.aidaweb.si _______________________________________________ Aida mailing list [hidden email] http://lists.aidaweb.si/mailman/listinfo/aida |
In reply to this post by Stephen Davies-3
Stephen Davies wrote:
> > (It does seem wrong to me that the view for adding an address is > in the AddressBook model, but I leave that to another post). > > No! View methods are always in the applications. The model doesn't deal > with view and action methods. > > > > Sorry - I made a mistake in my comment and so my objection wasn't clear. > > The tutorial tells you to create a viewAdd method to the > ADemoAddressBookApp class. I understand that it is on the "App" class - > that's the "View" in my understanding of MVC. > > But the viewAdd method has to know all about the insides of an > "ADemoAddress". So its in the wrong place. The code that knows what's > inside an ADemoAddress should ideally be in the ADemoAddress class, not > so? Or, maybe the ADemoAddressApp. > > Actually, the same objection stands for the viewMain method in > ADemoAddressBookApp, which knows the names of the "columns" (instance > variables) of the ADemoAddress. > > Am I picking nits? You were confused by that missing addLinkTo: self observee. After that MVC separation is again as you expected. self observee namely provides that link between VC and M part of MVC. That way model stays responsible for his part of job while an App (VC) is responsible for web presentation of domain object (self observee). Janko -- Janko Mivšek AIDA/Web Smalltalk Web Application Server http://www.aidaweb.si _______________________________________________ Aida mailing list [hidden email] http://lists.aidaweb.si/mailman/listinfo/aida |
In reply to this post by Janko Mivšek
2008/9/22 Janko Mivšek <[hidden email]> I also corrected I used HTTPString decodedHTTPFrom: 'http://www.aidaweb.si/object/o7036622.html?view=add&title=%09%09%09(WebElement%20new)%20addLinkTo%3A%20each%20text%3A%20each%20surname.' to extract the rest of the code.
Steve _______________________________________________ Aida mailing list [hidden email] http://lists.aidaweb.si/mailman/listinfo/aida |
Stephen Davies wrote:
> 2008/9/22 Janko Mivšek <[hidden email] > I also corrected > square brackets to be actually shown. In Scribo editor square brackets > mean new page link, but you can escape it wit two opening brackets: [[. > > I used HTTPString decodedHTTPFrom: > 'http://www.aidaweb.si/object/o7036622.html?view=add&title=%09%09%09(WebElement%20new)%20addLinkTo%3A%20each%20text%3A%20each%20surname > <http://www.aidaweb.si/object/o7036622.html?view=add&title=%09%09%09(WebElement%20new)%20addLinkTo%3A%20each%20text%3A%20each%20surname>.' > to extract the rest of the code. If you open normally the tutorial, is code is now correct everywhere? It is important that the tutorial is actually valid and we need to be careful in the future, that it will be so, always. Janko -- Janko Mivšek AIDA/Web Smalltalk Web Application Server http://www.aidaweb.si _______________________________________________ Aida mailing list [hidden email] http://lists.aidaweb.si/mailman/listinfo/aida |
In reply to this post by Janko Mivšek
2008/9/22 Janko Mivšek <[hidden email]>
No - my issue is simpler really. Its just that I think that the function that creates the view that adds a new address should be associated with the AddressApp class, not the AddressBookApp. Cos we are making an address, not an addressBook.
Does that make sense? Steve _______________________________________________ Aida mailing list [hidden email] http://lists.aidaweb.si/mailman/listinfo/aida |
In reply to this post by Janko Mivšek
2008/9/23 Janko Mivšek <[hidden email]>
Yes, thanks Janko. Steve _______________________________________________ Aida mailing list [hidden email] http://lists.aidaweb.si/mailman/listinfo/aida |
Free forum by Nabble | Edit this page |