<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    敬的世界

    常用鏈接

    統(tǒng)計

    最新評論

    The PathProxy pattern : Persisting complex associations

    PathProxy is a design pattern for persisting complex relationships without cluttering up your database.

    When your class relationships require pathing knowledge, that is , knowledge about a number of related objects, then the standard "many - to" associations wont cut it, The PathProxy class is an abstraction of such relationships, allowing you to manage, persist, and extend them without complicating the classes themselves, and without a proliferation of lookup tables.

    The fundamental idea is this?: create class that can point to any entity in the system, and that also can reference its own class as a parent, With this class, you create a tree structure that maintains the interrelationships outside of the referenced objects. Building a JPA mapping around this class requires some though, but is quite powerful.

    Path-Specific relationships

    The
    PathProxy solution applies in any situation where an entity can appear as an association of another entity type, but only for a specific path. I refer to such relationships as path specific. E is a child of D, but only for the path A-->B-->C-->D-->E.On another path, D might have no children (A-->B-->Q-->D) or might have a different child or children(A-->B-->X-->D-->Z)

    As an example, imagine a development team consisting of a project manager named Johnie and two developers, Robert and Mukunda. On project A, Johnie leads Robert and on Project B, Johnie leads Mukunda. This is a somewhat contrived example, but not an uncommon scenario in the world of corporate structures. In the real world, you might have the efficiency of the same process in different business locations, or the actions taken in response to the same event by different teams

    PathProxy.jpg

    When to use PathProxy?

    You have many entities whose interrelationships are complex and require knowledge of other relationships. Creating explicit objects to represent these types of? relationships becomes burdensome. This is expecially true if the objects must be persisted, creating a proliferation of database tables.

    Consider PathProxy if , Your system design calls for a number of casses whose sole or primary function is to model the relationships between other objects.

    Using PathProxy is more complicated than using? simple objects to represent relationships, so consider your particular situation. If you have few relationships to store and they are not too complicated, PathProxy may not be the right choice. On the other hand, once you reach a certain level of relationship complexity, using PathProxy will greatly simplify your overall system design. Beijng able to reuse the same machnaism over and over again is also a huge time-saver.


    來自 : http://www.javaworld.com/javaworld/jw-07-2008/jw-07-pathproxy.html?page=1

    posted on 2008-10-04 19:09 picture talk 閱讀(203) 評論(0)  編輯  收藏 所屬分類: 框架

    主站蜘蛛池模板: 国产伦一区二区三区免费| 久久久精品免费视频| 免费观看成人毛片a片2008| 亚洲AV无码码潮喷在线观看| 久久一区二区免费播放| 相泽亚洲一区中文字幕| 中文在线观看国语高清免费| 亚洲AV伊人久久青青草原| 深夜a级毛片免费无码| 婷婷亚洲天堂影院| 久久久精品视频免费观看| 亚洲中文字幕无码一区二区三区| 亚洲1区2区3区精华液| 四虎免费永久在线播放| 男人j进女人p免费视频| 久久久无码精品亚洲日韩软件 | 亚洲国产精品无码久久98| 丁香花免费高清视频完整版| 91在线亚洲综合在线| 四色在线精品免费观看| 国产成人综合久久精品亚洲| 在线观看永久免费视频网站| 猫咪免费人成在线网站 | 日韩免费视频观看| 黄色免费在线网址| 久久亚洲色一区二区三区| 美女视频黄a视频全免费网站色窝| 亚洲高清在线视频| 最新中文字幕电影免费观看| 美女黄频免费网站| 亚洲国产精品无码专区在线观看| 6080午夜一级毛片免费看| 亚洲日韩精品无码专区| 亚洲国产精品成人| 先锋影音资源片午夜在线观看视频免费播放 | 亚洲精品国产字幕久久不卡| 99ee6热久久免费精品6| 亚洲Aⅴ在线无码播放毛片一线天| 亚洲国产综合久久天堂| 亚洲一级毛片免费看| 特级毛片全部免费播放|