Design question for Seaside applications

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Design question for Seaside applications

Damien Cassou-3
Hi,

I would like to guide to reader of my Seaside Book through the creation
of a blog application. I need the clearest design possible and something
that is usually found in Seaside applications to make the reader a good
Seaside developer.

So, the application has a title bar, a menu and a content. I would like
to change the content component depending on what the user is currently
doing (editing or viewing a blog). What is the best design for this ?

Currently, I have the root application that renders the title bar, the
menu and the content. The menu and the content know about the root
application. When a user click on the menu ('Create a new blog' for
example), the application change the content component to an editor
component. But, this component is just rendered as a sub-component of
the application, it is not called. So, to answer the modified blog
message, the editor can't use #answer: and directly sends a message to
the application : #editingDoneWithMessage:

Is it a good design ? What are you advices ?

Please, this is really important to teach good designed application and
I'm waiting for your advice. I'm sure you want this book to be a good
entry point to our world.

Thank you
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Design question for Seaside applications

Romain Robbes
Hello Damien,

Is there something preventing you to have the content calling the editor?
It would seem simpler to me, plus it enforces using call/answer.

Romain

Il giorno Jul 10, 2006, alle ore 11:33 AM, Damien Cassou ha scritto:

Hi,

I would like to guide to reader of my Seaside Book through the creation of a blog application. I need the clearest design possible and something that is usually found in Seaside applications to make the reader a good Seaside developer.

So, the application has a title bar, a menu and a content. I would like to change the content component depending on what the user is currently doing (editing or viewing a blog). What is the best design for this ?

Currently, I have the root application that renders the title bar, the menu and the content. The menu and the content know about the root application. When a user click on the menu ('Create a new blog' for example), the application change the content component to an editor component. But, this component is just rendered as a sub-component of the application, it is not called. So, to answer the modified blog message, the editor can't use #answer: and directly sends a message to the application : #editingDoneWithMessage:

Is it a good design ? What are you advices ?

Please, this is really important to teach good designed application and I'm waiting for your advice. I'm sure you want this book to be a good entry point to our world.

Thank you
_______________________________________________
Seaside mailing list

--
Romain Robbes




_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Design question for Seaside applications

Damien Cassou-3
Hello Romain,

Romain Robbes wrote:
> Is there something preventing you to have the content calling the editor?
> It would seem simpler to me, plus it enforces using call/answer.

What would be the content component then ? How do I use it from the
application ? This can be a Task that I pass messages to from the
application and then it changes it states and call different kind of
components. Is it what you are talking about ?


Thanks

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Design question for Seaside applications

Romain Robbes


Il giorno Jul 10, 2006, alle ore 12:22 PM, Damien Cassou ha scritto:

Hello Romain,

Romain Robbes wrote:
Is there something preventing you to have the content calling the editor?
It would seem simpler to me, plus it enforces using call/answer.

What would be the content component then ? How do I use it from the application ? This can be a Task that I pass messages to from the application and then it changes it states and call different kind of components. Is it what you are talking about ?



The content could be anything. It could be something like this:

MenuComponent>>#renderContentOn: html
"render stuff"
html anchorWithAction: [application menuCallBackForEditor] text: 'edit blog'.
"renter stuff"

menuCallBackForEditor
result := content call: BlogEditor new.
"do whatever with result"

It seems easier to proceed like this rather than manually modifying the structure of the page, 
and having the editor call a method on the application.
This way, not every content component has to know everything about the application, thus increasing reusablity.
That might not be a very important in that case, but it shows the general mindset of having component decoupled as much as possible
so that they can be reused afterwards. 

Romain


Thanks

_______________________________________________
Seaside mailing list

--
Romain Robbes




_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Design question for Seaside applications

Damien Cassou-3
Hi Romain,

> The content could be anything. It could be something like this:
>
> menuCallBackForEditor
> result := content call: BlogEditor new.
> "do whatever with result"


I really like it. This solution is really elegant.


> It seems easier to proceed like this rather than manually modifying the
> structure of the page,
> and having the editor call a method on the application.
> This way, not every content component has to know everything about the
> application, thus increasing reusablity.


That was one of my problems and you solve it.


> That might not be a very important in that case, but it shows the
> general mindset of having component decoupled as much as possible
> so that they can be reused afterwards.


This is important because I'm not writing a blog application, but an
application to teach concepts.


Thank you very much for this
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside