Elements nesting/composition

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

Elements nesting/composition

Esteban A. Maringolo
Hello,

I have some assorted questions about the WebElement hierarchy and how
to use it properly.

As far as I understand, every domain object that want to be displayed
through a RESTful URI must have a corresponding WebApplication
subclass (e.g. MyModelApp).

But what happens if I want to factorize my views, so I can have an
"embeddable" view of MyModelApp?
Can I do this?

Should I build a subclass of WebElement, and then use such WebElement
in MyModelApp?

Eg.
Models:
ContainerModel
ElementModel

Applications:
ContainerModelApp
ElementModelApp

Each object will have a RESTful URI, and will end being redirected to
its corresponding App, let's say ContainerModelApp, which will include
a site navigation bar, other stuff, and the ContainerModel view
itself.

What I want to do is:
A. Factorize the raw view of the ContainerModel, in order to be able
to embed it in another App.
B. Embed a small/different view of ElementModelApp in
ContainerModelApp (e.g. a table row view, or some tile-like view).

I don't see a clear distinction between WebElement and WebApplication,
except for the fact that WebApplication includes some methods to
define page title and stuff at a "page" level.


Best regards,

--
Esteban

















Esteban A. Maringolo
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Elements nesting/composition

Janko Mivšek
Hi Esteban,

I hope you didn't give up waiting for an answer so long. Sorry!
Answers are below.

Esteban A. Maringolo wrote:

> I have some assorted questions about the WebElement hierarchy and how
> to use it properly.
>
> As far as I understand, every domain object that want to be displayed
> through a RESTful URI must have a corresponding WebApplication
> subclass (e.g. MyModelApp).

Exactly

> But what happens if I want to factorize my views, so I can have an
> "embeddable" view of MyModelApp?
> Can I do this?

Not a view embeddable into another view, but any element can of course
be embedded into another element, on the same App.

For reusable cross-app elements you subclass a WebComponent. Prime
example for such reusable, standalone, highly useful component is WebGrid.

> Should I build a subclass of WebElement, and then use such WebElement
> in MyModelApp?

Exactly. Even better: subclass a WebComponent, because you'll get even
more standalone and Ajax-ified component at the end. And WebComponents
will be greatly enhanced in the future. See again WebGrid for example.

> Eg.
> Models:
> ContainerModel
> ElementModel
>
> Applications:
> ContainerModelApp
> ElementModelApp
>
> Each object will have a RESTful URI, and will end being redirected to
> its corresponding App, let's say ContainerModelApp, which will include
> a site navigation bar, other stuff, and the ContainerModel view
> itself.

In this case you better make an App class hierarchy accordingly:

WebApplication
   ContainerModelApp
     ElementModelApp


> What I want to do is:
> A. Factorize the raw view of the ContainerModel, in order to be able
> to embed it in another App.
> B. Embed a small/different view of ElementModelApp in
> ContainerModelApp (e.g. a table row view, or some tile-like view).
>
> I don't see a clear distinction between WebElement and WebApplication,
> except for the fact that WebApplication includes some methods to
> define page title and stuff at a "page" level.

This is the distinction, yes. WebApplication is for a whole web page, it
is therefore a root of a whole element hierarchy of that page. You
couldn't therefore embed a whole page in another page (but even that
works:). As said the standalone subclasses of WebElement/WebComponent
are meant for such embedding as you'd like to achieve. Another way is
WebApp subclass hierarchy. Yet another way is iframe inside a page, but
this sounds a bit hacky for your case.

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
Reply | Threaded
Open this post in threaded view
|

Re: Elements nesting/composition

Esteban A. Maringolo
Janko:

On Mon, Jan 5, 2009 at 17:10, Janko Mivšek <[hidden email]> wrote:
> Hi Esteban,
>
> I hope you didn't give up waiting for an answer so long. Sorry!
> Answers are below.

No prob, it has been holidays season here too. Didn't touch a computer
for a while :-)

Everything is as I understood it. Now let's code.

Thanks for your support.

Best regards,

Esteban A. Maringolo
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida