Re: DbEntity Comments

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed Jan 31 2007 - 07:46:33 EST

  • Next message: Ahmed Mohombe: "Re: DbEntity Comments"

    Excellent! I am glad to see you stepping in to do that. We promised
    this feature so many times that I blush every time somebody asks for
    it again :-)

    As for the Modeler architecture, it is a bit eclectic, as we tried a
    number of approaches over time, not always fully cleaning up the
    deprecated stuff (Scope framework use is an example of a leftover).

    I can better comment on specifics if we decide on a visual solution
    first. Since comments can be added to almost any mapping element -
    [Obj|Db] [Entity|Attribute|Relationship] Query (?), my first thought
    is to add an info button (same as the one used on relationships
    panels) to the rest of the mapping elements. This button would pop a
    dialog showing comments editor. In case of relationships a dialog can
    have two tabs: one displaying the existing stuff, and another one
    displaying Comments.

    * Look under DbEntityRelationshipTab.java for how the dialog is started.
    * Look under 'org.apache.cayenne.modeler.dialog.codegen' for the
    latest examples of tabbed dialogs.

    Now specifically the implementation of panels:

    * View layout is done with JGoodies forms, usually on top of Swing
    BorderLayout, except for the most trivial cases where Swing layout
    managers can handle the entire view.

    * Model and Control layer of each panel is done using two approaches
    (ignoring deprecated Scope for a moment) that can be mixed in any
    proportion you'd like:

    - A "traditional way" via Swing listeners.

    - Via a custom bindings framework (org.apache.cayenne.swing -
    included in the Modeler sources). E.g. CodeGeneratorController.java
    and all preferences dialogs use bindings, separating each panel into
    two classes - controller and bound JComponent-based view.

    At the dialog and panel level that's basically it. For this task you
    won't have to deal with application-level wiring too much - that's a
    bit messy and is pending the switch to the plugin architecture.

    Andrus

    On Jan 31, 2007, at 12:07 PM, Malcolm Edgar wrote:
    > Hi All,
    >
    > We use Cayenne day in day out for a lot of our work, and the Cayenne
    > Modeler has a pretty central place in maintaining the database design,
    > and hence the application design.
    >
    > Being able to have comments associated with DbEntity attributes and
    > relationships would be an extremely useful feature, especially with
    > large teams, where a design is being shared with other members, or
    > even to simply come back and remember some of the original design
    > thinking.
    >
    > This issue has been raised before in:
    >
    > https://issues.apache.org/cayenne/browse/CAY-56
    > https://issues.apache.org/cayenne/browse/CAY-400
    > https://issues.apache.org/cayenne/browse/CAY-659
    >
    > I would like to contribute some time in moving this forward, before
    > the next JPA release of Cayenne. I am pretty good with Swing, but
    > would like some guidance in how this would best be done in the Cayenne
    > Modeler architecture.
    >
    > regards Malcolm Edgar
    >



    This archive was generated by hypermail 2.0.0 : Wed Jan 31 2007 - 07:47:19 EST