The "Composite" in CompositeWeb - on inter-presenter communications

Topics: Web Client Software Factory
Sep 16, 2008 at 4:11 PM
Edited Sep 17, 2008 at 3:37 PM
Could someone elaborate on what "Composite" refers to in CompositeWeb.

Is it the ability to divide the application into independent modules?

Or is it the ability to have many moving parts on one single screen work together?

The reason I am asking this is because we are facing some architectural/design decisions in regard to the later. Here is the business case:

We have a page that contains a bunch of user controls that all work (some of them in synch, some of them independently) on the same business object. My question is what is the best practice to keep those moving parts loosely coupled but work together. To illustrate this with an example - how do we initialize every user control with a reference to the same business object (remember, we are in the MVP world in a web scenario). Or how does a user control notify the others that the business object got changed. Or how does the container (root) view instructs all moving parts to Save the data to the model? Stuff like that.

Working on a project that is a convert from desktop/winforms Smart Client Software Factory, I kinda make a parallel with the EventBroker that's available there and all the nice ways of keeping moving parts somewhat unaware, but working together.
Sep 19, 2008 at 9:46 PM
Edited Sep 19, 2008 at 9:53 PM

Hi,

From WCSF's documentation:

"A composite Web client application is an application that is composed of discrete, functionally complete pieces. These modules are integrated within a Web server environment to create the application.

[…]

Composite Web applications are based on the Composite pattern. This pattern is popular because it provides a flexible and scalable architecture that has several benefits, including the following:

·         It allows a higher degree of separation between the application infrastructure and the business logic.

·         It allows independent development of the individual business logic components.

·         It provides flexibility because business logic components can be quickly combined to yield a specific solution.

·         It promotes code re-use because it allows business logic components and the application infrastructure to be re-used across multiple solutions.

·         It provides an excellent architecture for the front-end integration of line-of-business systems or service-oriented systems into a task-oriented user experience."

 You can use WCSF to both develop applications dividing it into independent modules (Modularity) and also have moving parts on a single screen (UI Composition).

You can use StateDependency attribute to get an instance of an object from the session in the different users controls. In this way, you can share objects between user controls or classes in different modules but in the same Session. For more information, see: 

 

However, there is no EventBroker-like implementation in WCSF, as there are many things to consider which can be very different for different scenarios, having in mind that a web-site constructs all the user controls every time a page is requested.

Please, let me know if you find it useful.

Ezequiel Sculli

http://blogs.southworks.net/esculli

 

 

Oct 1, 2008 at 9:56 PM

Hi gstoy,

 

In WCSFContrib, you can find a possible solution for your issue with the events using the CreateShared Attribute. With this for example, you can inject the same controller instance in your users controls’ presenters, publish the events in the shared controller and be able communicates the different presenters using those.

Let me know if you find this useful.

 

Ezequiel Sculli

http://blogs.southworks.net/esculli/

Oct 2, 2008 at 3:11 AM

Ezequiel,
Thank you for your posts. I've been meaning to reply to this thread once I revisited the issue in one of the next iterations of our project.
Meanwhile I have been looking at the EventBroker implementation in the wcsf contrib section.

I also noticed the post a few days ago about the shared controller in another post on the board and thought the same thing.

I appreciate your help - thank you.