UserControl used across business modules

Topics: Web Client Software Factory
Jan 12, 2008 at 7:00 AM
Edited Jan 12, 2008 at 1:32 PM
I'm a newbie for websf and would like to check out something.

I have created several business modules, namely Customers and Vendors modules.

Now I wish to design a "item form" user control (for general use) which will be used in the Customers and Vendors modules.
Where shall I add this new user control so that all other modules can use it? e.g.DevelopmentWebsite?

I tried adding usercontrol at developmentWebsite and drap and drop it in another business module's aspx form, the browser shows "Exception Details: System.MemberAccessException: Cannot create an abstract class."

I would like to find out the best place to handle these general functionalities such as my "Item Form" user control which i want it to be used across modules.

Thanks in advance,
Jan 12, 2008 at 8:06 PM
Please take a look at the Responsive Composite Web Client Reference Implementation.
One of the things covered in this application is:

Page composition: Creating composite Page Views that contain multiple User Control Views. The User Controls can be used across modules and can be independently developed, tested, versioned, and deployed.

Mariano Szklanny
Jan 13, 2008 at 12:27 PM
Edited Jan 13, 2008 at 3:33 PM

I have the same question.
I studied the above mentioned "Responsive Composite Web Client Reference Implementation" bundle (and a few others).
Although the documentation of this bundle says: "The User Controls can be used across modules and can be independently developed, tested, versioned, and deployed", i didn't find a usercontrol in the DevelopmentWebsite that was shared among the two modules Orders and Customers.

I will further describe the challenge i'm currently facing.

I have a module Companies and a module Contacts.
Both modules (also entities) have the requirement that Addresses can be added.
I have two usercontrols AddressGridView and AddressDetailsView.
I want both modules to be able to use these usercontrols.
If i would place the two usercontrols in (lets say) the Companies module, the presenters of these two views would be coupled to the CompanyController and it would then be difficult to supply the views with data from the CurrentContact (a StateValue) in the ContactsController.

We all know that common businesslogic that is used across businessmodules should be placed in a Foundational module.
The WCSF guidelines say that there is no place for UI Components there.
Therefore to solve this problem i'm thinking of creating a Common businessmodule which contains UI components and maybe some generic businesslogic and thereby creating a dependency between this new module and all modules that need to use generic UI components from it.
This Common module would not contain a ModuleController-class which normally suplies the presenters with data to be databound by the View.
To get data into and out of these UI Components you should implement a getter/setter for the business object each one deals with.

Has anybody else found a way to share common UI components between WCSF Business Modules?

(By the way, my compliments to all developers of WCSF for a great framework.)

Martijn Clarenbeek.
Jan 14, 2008 at 1:39 AM
Edited Jan 14, 2008 at 1:43 AM

Thanks for the reply.
In Responsive Composite Web Client Reference Implementation, I notice the SearchCustomer.ascx (in Customer module) is used across modules. It is used in Customer and Order modules (in OrderInformation.ascx).
I will study further about Page Composition. Still wondering what are the things that I have missed out in my code.

Thank a lot,
Jan 14, 2008 at 3:17 AM
I know how you feel, that was a question I've had in my head for long time, aditionally than the RI of the composite client I recommend the MVP bundle and check the MVPWithCWABQuickStart, specially in the Contacts/ContactList.aspx page, in this example both the control and page share the same controller and can intercept/use the controller events.

Good luck!