I've yet to figure out if it's been a good idea or not but I've got a set of Struts2 (S2) actions for CRUD operations that work against a set of Entities, it currently picks up a single package and then allows CRUD access to all those Entities.
The value is to quickly provide JS developers with CRUD operations against the whole database. In that respect it's working reasonably well, in not so complicated situations. There are some supporting actions as well, which can list all named Entities, tools for paging. One challenge when listing records was to provide an ordinal object showing the expected column order, as determined by the order method declarations in the Entity file (it seemed very redundant to use annotations for this purpose when simply moving the method was more intuitive), reordering columns is easy on the client side but still a reasonable default should exist. There is still a way to go... one important feature still to add is to return a list of collections/associated entities so an Entity graph could be constructed client side. These inspection features are intended to help reduce the need to query back end developers and let the UI/Client side developers know what Entities are available, what fields they contain and associations. Over all it is quite simple, I wouldn't mind some help and think it could be useful to others. The down side is coupling is increased between Entities and Actions (Validation no longer makes sense in the action, the method needs to be pushed to the entity and S2s validate will then call the Entities validate method). Perhaps it is possible to use Struts XML validation... I have not thought about validation enough. The most obvious concern is that it is quite easy to protect these actions via an interceptor but a more complicated security system (looking into Shiro) needs to be layered on top because the front end developers are given a lot of power, too much power without proper validation and security in place. It would be nice to bundle this up into a S2 plugin... then it turns the problem of getting data to the client into "How do I restrict this user to their data requirements". Anyways I'd be happy to get this out there if anyone's interested. On Thu, Mar 7, 2013 at 12:19 AM, Lukasz Lenart <lukaszlen...@apache.org>wrote: > Hi Philip, > > I'm going to update your CRUD Demo [1] to the latest version of Struts > - I hope you don't mind? > > Another thing I would like to include such small examples into > codebase as part of [2] with UI tests. Are there any other small > examples which can be included? > > [1] https://cwiki.apache.org/confluence/display/WW/CRUD+Demo+I > [2] https://issues.apache.org/jira/browse/WW-3853 > > > Regards > -- > Ćukasz > + 48 606 323 122 http://www.lenart.org.pl/ > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@struts.apache.org > For additional commands, e-mail: dev-h...@struts.apache.org > >