Kevin Menard commented on CAY-915:
----------------------------------
Correct. The interface would be generated based on the properties defined in the entity.
Unless I'm mistaken, there's one pass to generate super and subclasses for the server and another pass to generate for super and subclasses for the client. What I'm suggesting is a third pass that generates one set of interfaces that will be implemented by the super classes for both server and client. It would yield something like the following:
com.example.models.interfaces.IPainting
com.example.models.auto._Painting implements com.example.models.interfaces.IPainting
com.example.models.client.auto._Painting implements com.example.models.interfaces.IPainting
The subclasses would extend from the superclass as usual.
As per the other generation steps, this should be configurable.
If this sounds like a bad approach, we can discuss better design options on the dev list.
> Add ability to generate a common interface for client and server classes
> ------------------------------------------------------------------------
>
> Key: CAY-915
> URL: https://issues.apache.org/cayenne/browse/CAY-915
> Project: Cayenne
> Issue Type: New Feature
> Components: CayenneModeler GUI
> Affects Versions: 3.0
> Reporter: Kevin Menard
> Assignee: Kevin Menard
> Fix For: 3.0
>
>
> Currently there is a divide between ROP client and server classes. Ultimately, it'd be nice to see some unification of the two. In some applications, however, there is compelling reason to keep two hierarchies separate. In that case, it may still be beneficial to have a common interface that other code can use to interact with both client and server classes.
> Off hand, I'm thinking of two new fields to the class generation panel in the modeler:
> 1) Check box for indicating that the interfaces should be generated
> 2) A text field for specifying the package to use
> This also implies modifications to both the client and server superclass velocity templates.
-- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
This archive was generated by hypermail 2.0.0 : Tue Nov 06 2007 - 11:44:13 EST