Best practice for working with separate GWT modules and their inheritance

77 views
Skip to first unread message

Alexander Orlov

unread,
Dec 8, 2011, 7:57:06 AM12/8/11
to google-we...@googlegroups.com
Assumed I've a Customer.gwt.xml and a Manager.gwt.xml module. Manager inherits Customer because I want to use Customer's functionality and RF's proxy classes in Manager. Ok, those proxy classes could be also put into a Common.gwt.xml but let's omit this option for the moment. Now the problem is when I call the Manager view/module, I also see the Customer widget in the same view. However I just want to see the Manager widget when I call the Manager view and not the Customer widget which I want to call separately. 

How should I handle this problem, how can I inherit functionality of Customer without being forced to explicitly hide Customer's widgets when I call Manager. How can I systematically choose/hide/override/specify the widgets which should be displayed when I call the Manager module.

Thomas Broyer

unread,
Dec 8, 2011, 8:27:46 AM12/8/11
to google-we...@googlegroups.com
You have to make an "intermediate" gwt.xml for Customer without the <entry-point/>. Both Customer and Manager would inherit that module, and Customer would be a 4-liner: inherit the CustomerBase module and add the <entry-point/>.

Alexander Orlov

unread,
Dec 8, 2011, 8:57:17 AM12/8/11
to google-we...@googlegroups.com
So I'll have a CustomerBase module (without an entry-point) that is inherited by both Customer and Manager (both with their specific entry-points)?

Jens

unread,
Dec 8, 2011, 9:44:49 AM12/8/11
to google-we...@googlegroups.com
Yes, you are effectively creating a "library" module from your Customer module by omitting the entry-point.

Copy everything except the entry-point definition from Customer.gwt.xml to CustomerBase.gwt.xml and then inherit CustomerBase.gwt.xml where you need it.

-- J.

Alexander Orlov

unread,
Dec 8, 2011, 10:09:50 AM12/8/11
to google-we...@googlegroups.com
Thanks again for the clarification!
Reply all
Reply to author
Forward
0 new messages