|
From: <dar...@hs...> - 2003-11-12 09:15:52
|
<Alef> Darren, I've been implementing something like this before, using the reference data feature of the controllers, works like a charme. However, It's the problem still is that you end up using _one_ model, where - in e.g. a portlet - you would somehow want a per-portlet model, scoped, like in tiles... In your solution, what if one of the beans returns an entry in the model with the same key as the controller (or another bean). They override... </Alef> yeah, that's actually the way I understood the OP's request - as being a non-portal scenario, and in some (non-portal) apps it's definitely what you'd want I think. For portlets, you would of course need properly scoped models but I think what was outlined has some validity. <Alef> It would however be nice if we could come up with something that's not specific to views... </Alef> Do you not think that configuring some of this peripheral data should be at the view level? If not the view, then where..? In common scenarios I come across, the secondary model is quite specific to a view (though not of course the TYPE of view) Darren. _____________________________________________________ This transmission has been issued by a member of the HSBC Group "HSBC" for the information of the addressee only and should not be reproduced and / or distributed to any other person. Each page attached hereto must be read in conjunction with any disclaimer which forms part of it. Unless otherwise stated, this transmission is neither an offer nor the solicitation of an offer to sell or purchase any investment. Its contents are based on information obtained from sources believed to be reliable but HSBC makes no representation and accepts no responsibility or liability as to its completeness or accuracy. |
|
From: <jue...@we...> - 2003-11-12 10:02:38
|
Darren,
I don't know if you've noticed that I've added a related feature =
yesterday: AbstractView has now not only the standard =
setAttributes(Properties) and setAttributesCSV(String) but also =
setAttributesMap(Map). The latter allows not only for String values but =
also for refs, lists, maps, and props as static model attributes.
To make refs work, I've reworked XmlViewResolver and =
ResourceBundleViewResolver to create their view bean factories as =
children of the surrounding application context. Else, you would not be =
able to reference beans in the application context from view =
definitions.
To not put beans themselves as static attributes into the model but =
rather other objects, maybe use a FactoryBean that returns the model =
attribute? The name of the attribute would be determined by the map key =
in the view definition then. It might still make sense to support a =
special ModelReference bean that creates a whole map of attribute =
key/value pairs.
And BTW, <ref external=3D"..."/> is somewhat deprecated as there is no =
strict check for just referencing external beans. <ref bean=3D"..."/> is =
now the generic one that can reference any bean in any reachable =
context, while <ref local=3D"..."/> can just reference local beans in =
the same XML file (via XML ids).
Juergen
-----Original Message-----
From: spr...@li...
[mailto:spr...@li...]On Behalf
Of Darren Davison
Sent: Wednesday, November 12, 2003 2:50 AM
To: spr...@li...
Subject: [[W3-SPAM]] - Re: [Springframework-developer] About MVC - Email
found in subject
On Tuesday 11 November 2003 23:27, Darren Davison wrote:
> Is there something already in Spring MVC that lends itself to this =
kind
> of behaviour?
without really thinking this through much (since it's gone 1:30am and I =
have=20
to be up again in 4 hours)..
If an interface..
public interface ModelReference {
public Map getModel();
}
.. is implemented by some arbitrary business objects, then a view could =
be=20
defined as..
<bean id=3D"myVelocityView"
class=3D"org.springframework.web.servlet.view.velocity.VelocityView">
<property name=3D"templateName"><value>main.vm</value></property> =20
<!-- standard attribs -->
<property name=3D"attributes">
<props>
<prop key=3D"title">A Velocity Page</prop>
</props>
</property> =20
<!-- new property: list of ModelReference implementing bus. objects =
-->
<property name=3D"references">
<list>
<ref external=3D"myBean"/>
<ref external=3D"myOtherBean"/>
</list>
</property> =20
</bean>
AbstractView is amended with the following (part pseudo-code)..
public abstract class AbstractView extends WebApplicationObjectSupport=20
implements View {
//added
private Map referenceObjects =3D new HashMap();
...
//added
public final void setReferencesList(List references) { =20
for each list item
get bean from app context if exists
if bean instanceof ModelReference=20
call bean.getModel()=20
consolidate into referenceObjects field
end
end
}
//amended
public final void render(Map model, HttpServletRequest request,=20
HttpServletResponse response)
=20
...
Map mergedModel =3D new HashMap(this.staticAttributes);
mergedModel.putAll(referenceObjects);
mergedModel.putAll(model);
...
}
}
- The controller still has final say and can overwrite model values =
from=20
the static list or the reference list
- Arbitrary beans can now add to the model that a view renders on a per =
view basis taking advantage of whatever container resources or custom =
logic=20
is required
- multiple views can use the same ref objects via the hierarchical view =
structure
- It's a kind of half-way house between static attributes and model =
data=20
returned by the controller but as shown isn't parameterised so =
reasonably=20
rigid
- maybe the interface can be dropped and the actual method to call for =
any=20
given bean can be specified in the config too. One less dependency for =
the=20
business object
Goodnight.
--=20
Darren Davison
Public Key: http://www.davison.uk.net/key.jsp
-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|
|
From: <dar...@hs...> - 2003-11-12 10:31:26
|
<Juergen> I don't know if you've noticed that I've added a related feature yesterday: AbstractView has now not only the standard setAttributes(Properties) and setAttributesCSV(String) but also setAttributesMap(Map). The latter allows not only for String values but also for refs, lists, maps, and props as static model attributes. </Juergen> Actually I wasn't aware when I scribbled down my thoughts. Spooky! I'll familiarise myself with it all pronto. Regards, Darren _____________________________________________________ This transmission has been issued by a member of the HSBC Group "HSBC" for the information of the addressee only and should not be reproduced and / or distributed to any other person. Each page attached hereto must be read in conjunction with any disclaimer which forms part of it. Unless otherwise stated, this transmission is neither an offer nor the solicitation of an offer to sell or purchase any investment. Its contents are based on information obtained from sources believed to be reliable but HSBC makes no representation and accepts no responsibility or liability as to its completeness or accuracy. |
|
From: <dar...@hs...> - 2003-11-12 10:37:40
|
<Alef> From what I've seen there's three commons scenerio's 1. Reference data needed to render the view. This is the stuff we have already. 2. Data related to the view but not necessarily needed to render it (additional news in a sidebox, perhaps a menu). 3. Componentized views having corresponding controller (portlet) The first case can perfectly be implemented using our current reference data implementation (a list of elements in a select box of a form for instance). One controller, having reference data, specifically belonging to the controller The second case (sideboxes containing news, a menu that needs information not related to the main view) I consider to be a simple Tiles approach and I think a somewhat more advanced version of the reference data features we have now, would do. Something like you proposed maybe. Reference data, however, not in fact related to the controller! The third case however, is a completely different one and somewhat looks like the portlet approach. I think this is a bit too far-fetched to implement in Spring, although I'd like to offer view-tech independent stuff for this. Parallel controllers rendering views independent of eachother. It's just some rambling, but maybe we could brainstorm about this more in order to come with something brilliant :)... </Alef> Hi Alef, We're definitely on the same wavelength here, and you're right - it's the 2nd scenario that I was focusing on earlier. Portlets are indeed a very different kettle of fish. As Juergen just mentioned, some changes were made yesterday co-incidentally that I wasn't aware of, but which may facilitate efforts in this direction. I'll go and see what's different and gather some more thoughts. Cheers! Darren. _____________________________________________________ This transmission has been issued by a member of the HSBC Group "HSBC" for the information of the addressee only and should not be reproduced and / or distributed to any other person. Each page attached hereto must be read in conjunction with any disclaimer which forms part of it. Unless otherwise stated, this transmission is neither an offer nor the solicitation of an offer to sell or purchase any investment. Its contents are based on information obtained from sources believed to be reliable but HSBC makes no representation and accepts no responsibility or liability as to its completeness or accuracy. |
|
From: Yanger <yan...@ya...> - 2003-11-13 22:42:31
|
SSBhZ3JlZS4NCkkgY2l0ZSBwb3J0YWwganVzdCBhcyBhbiBleGFtcGxlIGZvciB0aG9zZSBhcHBs aWNhdGlvbnMgdGhhdCBoYXZlIHNvbWUgdW5yZWxhdGVkIGNvbnRlbnQgdG8gYmUgZGlzcGxheWVk IGluIGRpZmZlbmVudCBwYXJ0cyBvZiBTY3JlZW4uIA0KDQoJCQkNCg0KQmVzdCBSZWdhcmRzLA0K WWFuZ2VyDQp5YW5nZXIxOTk3QHlhaG9vLmNvbS5jbg0KCQkJCQkJCTIwMDMtMTEtMTQgMDY6NDE6 MzANCg0KPT09PT09PSAyMDAzLTExLTExIDIwOjUzOjU4IFlvdXIgbWFpbCBpc6O6PT09PT09PQ0K DQo+WW91IHNlZW0gdG8gYmUgZGVzY3JpYmluZyBhIFBvcnRhbCB3aGljaCBoYXMgdHdvIHBhcnRz LCAxKSBQb3J0YWwgDQo+QXBwbGljYXRpb24gd2hpY2ggaXMgcmVzcG9uc2libGUgZm9yIGFnZ3Jl Z2F0aW5nIFBvcnRsZXRzICh5b3VyIHNjcmVlbiANCj5wYXJ0cykgYW5kIHRhcmdldGluZyBhIHJl cXVlc3QgdG8gYSBQb3J0bGV0IGFuZCAyKSBQb3J0bGV0IENvbnRhaW5lciANCj53aGljaCBpcyBy ZXNwb25zaWJsZSBmb3IgdGhlIGxpZmVjeWxlIG9mIFBvcnRsZXRzLg0KPg0KPlNwcmluZyBjb3V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0cy5zb3VyY2Vmb3JnZS5uZXQNCj5odHRwczovL2xpc3RzLnNvdXJjZWZvcmdlLm5ldC9saXN0 cy9saXN0aW5mby9zcHJpbmdmcmFtZXdvcmstZGV2ZWxvcGVyDQo+Lg0KDQo9ID0gPSA9ID0gPSA9 ID0gPSA9ID0gPSA9ID0gPSA9ID0gPSA9ID0NCg0KDQo= |
|
From: Darren D. <dda...@kg...> - 2003-11-21 10:54:24
|
Resurrecting this from a few days back, and to recap; Views often need access to 'secondary level' model data to decorate the data returned by the controller, which is highly specific to the user gesture that triggered that controller. ie, a form post triggers a search controller to obtain and return a list of results based on the user's input criteria, but the view wants to wrap those results with a navigation menu and some latest news - all of which are dependent on different business data or logic, and none of which have anything to do with the search controller. This is not a portal, where the semantics are very different. Tiles solves it, but Tiles is view-technology specific. View decoration is specific to a view and should be configurable at the view definition level. Although in practice, many views may use the same 'decoration', this is solved already with parent view definitions. I took a look at Juergen's additions to the view classes that enable a Map of context objects to be added in the same way as static attributes. This helps go some way towards solving what I see the problem is, but it's not the whole answer. If the context object is itself not the secondary model data you wish to make available to the view, but rather is a business object capable of retreiving or generating that data, then something further needs to happen. While Velocity and JSP may be able to call a method on the object it's possibly not desirable for them to do so, and other view technologies can't. The options would be to make the object some sort of FactoryBean (? not sure about this) or implement another specific interface that the View can use to pull data from the object. Initially I mooted the other interface method but in fact neither of these may be desirable or even possible if it's an existing business component doing the work. Specifying the method name to call for each object in the Map is another option, but I guess this would break the current beans DTD for an XmlViewResolver and would be difficult to parameterise. Even so, this would be closest to a view-technology agnostic (but view specific) solution I think. Anyone else? -- Darren Davison Public Key: http://www.davison.uk.net/key.jsp |
|
From: Alef A. \(JTeam\) <al...@jt...> - 2003-11-12 10:06:43
|
> Do you not think that configuring some of this peripheral > data should be at the view level? If not the view, then > where..? In common scenarios I come across, the secondary > model is quite specific to a view (though not of course the > TYPE of view) From what I've seen there's three commons scenerio's 1. Reference data needed to render the view. This is the stuff we have already. 2. Data related to the view but not necessarily needed to render it (additional news in a sidebox, perhaps a menu). 3. Componentized views having corresponding controller (portlet) The first case can perfectly be implemented using our current reference data implementation (a list of elements in a select box of a form for instance). One controller, having reference data, specifically belonging to the controller The second case (sideboxes containing news, a menu that needs information not related to the main view) I consider to be a simple Tiles approach and I think a somewhat more advanced version of the reference data features we have now, would do. Something like you proposed maybe. Reference data, however, not in fact related to the controller! The third case however, is a completely different one and somewhat looks like the portlet approach. I think this is a bit too far-fetched to implement in Spring, although I'd like to offer view-tech independent stuff for this. Parallel controllers rendering views independent of eachother. It's just some rambling, but maybe we could brainstorm about this more in order to come with something brilliant :)... Alef |
|
From: Lars F. <lar...@gm...> - 2003-11-12 10:32:56
|
I think it would be a good idea to put a focus on WebWork 2 integration. WebWork is a very popular framework and I think Spring would gain further popularity when providing a way to integrate WebWork "out of the box". IMO the main advantage of WebWork is that it's very easy to understand even with missing documentation. Spring MVC maybe technically superior (I don't know) but it's too complicated to get started with. The combination of Spring as Container and WebWork 2 as MVC framework is very powerful. What do you think about this ? Regards, Lars > > Do you not think that configuring some of this peripheral > > data should be at the view level? If not the view, then > > where..? In common scenarios I come across, the secondary > > model is quite specific to a view (though not of course the > > TYPE of view) > > >From what I've seen there's three commons scenerio's > > 1. Reference data needed to render the view. This is the stuff we have > already. > 2. Data related to the view but not necessarily needed to render it > (additional news in a sidebox, perhaps a menu). > 3. Componentized views having corresponding controller (portlet) > > The first case can perfectly be implemented using our current reference > data implementation (a list of elements in a select box of a form for > instance). One controller, having reference data, specifically belonging > to the controller > > The second case (sideboxes containing news, a menu that needs > information not related to the main view) I consider to be a simple > Tiles approach and I think a somewhat more advanced version of the > reference data features we have now, would do. Something like you > proposed maybe. Reference data, however, not in fact related to the > controller! > > The third case however, is a completely different one and somewhat looks > like the portlet approach. I think this is a bit too far-fetched to > implement in Spring, although I'd like to offer view-tech independent > stuff for this. Parallel controllers rendering views independent of > eachother. > > It's just some rambling, but maybe we could brainstorm about this more > in order to come with something brilliant :)... > > Alef > > > > > > ------------------------------------------------------- > This SF.Net email sponsored by: ApacheCon 2003, > 16-19 November in Las Vegas. Learn firsthand the latest > developments in Apache, PHP, Perl, XML, Java, MySQL, > WebDAV, and more! http://www.apachecon.com/ > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > |
|
From: Mike Cannon-B. <mi...@at...> - 2003-11-12 12:47:26
|
Lars, For what it's worth we're working on some WW2 / Spring integration at the moment (along the lines of what Juergen, Cameron and others have suggested) - including minor modifications to XW to support external references, and then a Spring external reference resolver. I think it will work very nicely, we'll keep you posted :) Cheers, Mike ATLASSIAN - http://www.atlassian.com Expert J2EE Software, Services and Support On 12/11/03 9:32 PM, "Lars Fischer" (lar...@gm...) penned the words: > I think it would be a good idea to put a focus on WebWork 2 integration. > WebWork is a very popular framework and I think Spring would gain > further popularity when providing a way to integrate WebWork "out of the > box". > > IMO the main advantage of WebWork is that it's very easy to understand even > with missing documentation. Spring MVC maybe technically superior > (I don't know) but it's too complicated to get started with. > > The combination of Spring as Container and WebWork 2 as MVC framework > is very powerful. > > What do you think about this ? > > Regards, > Lars > >>> Do you not think that configuring some of this peripheral >>> data should be at the view level? If not the view, then >>> where..? In common scenarios I come across, the secondary >>> model is quite specific to a view (though not of course the >>> TYPE of view) >> >>> From what I've seen there's three commons scenerio's >> >> 1. Reference data needed to render the view. This is the stuff we have >> already. >> 2. Data related to the view but not necessarily needed to render it >> (additional news in a sidebox, perhaps a menu). >> 3. Componentized views having corresponding controller (portlet) >> >> The first case can perfectly be implemented using our current reference >> data implementation (a list of elements in a select box of a form for >> instance). One controller, having reference data, specifically belonging >> to the controller >> >> The second case (sideboxes containing news, a menu that needs >> information not related to the main view) I consider to be a simple >> Tiles approach and I think a somewhat more advanced version of the >> reference data features we have now, would do. Something like you >> proposed maybe. Reference data, however, not in fact related to the >> controller! >> >> The third case however, is a completely different one and somewhat looks >> like the portlet approach. I think this is a bit too far-fetched to >> implement in Spring, although I'd like to offer view-tech independent >> stuff for this. Parallel controllers rendering views independent of >> eachother. >> >> It's just some rambling, but maybe we could brainstorm about this more >> in order to come with something brilliant :)... >> >> Alef >> >> >> >> >> >> ------------------------------------------------------- >> This SF.Net email sponsored by: ApacheCon 2003, >> 16-19 November in Las Vegas. Learn firsthand the latest >> developments in Apache, PHP, Perl, XML, Java, MySQL, >> WebDAV, and more! http://www.apachecon.com/ >> _______________________________________________ >> Springframework-developer mailing list >> Spr...@li... >> https://lists.sourceforge.net/lists/listinfo/springframework-developer >> > > > > ------------------------------------------------------- > This SF.Net email sponsored by: ApacheCon 2003, > 16-19 November in Las Vegas. Learn firsthand the latest > developments in Apache, PHP, Perl, XML, Java, MySQL, > WebDAV, and more! http://www.apachecon.com/ > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer |