Re: get**AsList/Map again ;-)

From: Andriy Shapochka (ashapochk..otmail.com)
Date: Thu Mar 13 2003 - 15:38:20 EST

  • Next message: Andrus Adamchik: "Re: get**AsList/Map again ;-)"

    My definite +1 for all immutables and elimination of all internal copying. I
    like the principle - "just return the best container you can get by wrapping
    the internal one into an immutable shell". +1 for DataContext self-cleaning.
    +1 for Collection as an argument type in the setters.
    Andriy.

    > --snip--
    >
    > List of action points:
    >
    > DataContext.getDataMapsAsList:
    > - could be renamed to getDataMaps (original name actually)
    > - just returns getDataMapsAsList from its parent (DataDomain, see next
    > item); IMHO a good idea to change both to return an immutable
    > write-through Collection reference. This better decouples the QueryEngine
    > method from the internal implementation (no implementation details in
    > interfaces!)
    >
    > DataDomain.getDataMapsAsList/getDataNodesAsList:
    > - probably should be renamed getDataMaps/getDataNodes and return immutable
    > read-through Collection references
    > - clients would have to make a copy themselves (NOT required for 99%!)
    > - not too many changes except for fixing get(0) in tests to use iterator
    > - returning immutable List would mean we have to maintain a cached List
    > somehwere
    > -> Collection better (as neutral as possible, see above)
    >
    > DataNode.get/setDataMapsAsList:
    > - rename to getDataMaps
    > - return immutable read-through Collection reference from EntityResolver
    > - setter takes any Collection and copies references; no other changes
    > necessary
    >
    > EntityResolver.getDataMapsList:
    > - rename to getDataMaps
    > - return immutable read-through Collection
    >
    > DataMap:
    > - rename to getDb/ObjEntities
    > - return immutable read-through Collection
    > - remove getDbEntityMap (not used elsewhere)
    > -or-
    > - remove *List methods completely
    > - rename getDb/ObjEntityMap to getDb/ObjEntities
    > - return immutable read-through Map
    >
    > Entity:
    > - get(Attribute|Relationship)(Map|List): either/or, just like with DataMap
    >
    > DataContext:
    > - instead of calling clearFlattenedUpdateQueries from ContextCommit make
    > DC clean up itself after commit; make method private or remove completely
    >
    > ObjRelationship:
    > - rename getDbRelationshipList to getDbRelationships
    > - return immutable List
    > - cache reverseRelationship
    >
    > DbRelationship:
    > - cache reverseRelationship
    >
    >
    >
    >
    >



    This archive was generated by hypermail 2.0.0 : Thu Mar 13 2003 - 15:38:21 EST