brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: BROOKLYN-49: Catalogue persistenc...
Date Fri, 19 Sep 2014 15:20:12 GMT
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/175#discussion_r17790621
  
    --- Diff: core/src/main/java/brooklyn/catalog/internal/CatalogItemDtoAbstract.java ---
    @@ -18,67 +18,92 @@
      */
     package brooklyn.catalog.internal;
     
    +import java.util.Map;
    +import java.util.Set;
     import javax.annotation.Nonnull;
     import javax.annotation.Nullable;
     
    +import com.google.common.collect.ImmutableSet;
    +import com.google.common.collect.Iterables;
    +import com.google.common.collect.Sets;
    +
    +import brooklyn.basic.AbstractBrooklynObject;
     import brooklyn.catalog.CatalogItem;
     import brooklyn.catalog.internal.BasicBrooklynCatalog.BrooklynLoaderTracker;
    +import brooklyn.entity.rebind.BasicCatalogItemRebindSupport;
    +import brooklyn.entity.rebind.RebindSupport;
     import brooklyn.management.ManagementContext;
     import brooklyn.management.classloading.BrooklynClassLoadingContext;
     import brooklyn.management.classloading.BrooklynClassLoadingContextSequential;
     import brooklyn.management.classloading.JavaBrooklynClassLoadingContext;
     import brooklyn.management.classloading.OsgiBrooklynClassLoadingContext;
    +import brooklyn.mementos.CatalogItemMemento;
    +import brooklyn.util.flags.FlagUtils;
    +import brooklyn.util.flags.SetFromFlag;
     
    -public abstract class CatalogItemDtoAbstract<T,SpecT> implements CatalogItem<T,SpecT>
{
    +public abstract class CatalogItemDtoAbstract<T, SpecT> extends AbstractBrooklynObject
implements CatalogItem<T, SpecT> {
     
         // TODO are ID and registeredType the same?
    -    String id;
    -    String registeredType;
    -    
    -    String javaType;
    -    String name;
    -    String description;
    -    String iconUrl;
    -    String version;
    -    CatalogLibrariesDto libraries;
    -    
    -    String planYaml;
    -    
    +    @SetFromFlag Set<Object> tags = Sets.newLinkedHashSet();
    --- End diff --
    
    I question whether there is a benefit having `CatalogItemDto` extend `CatalogItem` - i.e.
should anyone accessing this code ever see the DTOs or only the domain objects (DOs)? So does
this just make it more complicated?
    
    I did wonder if `CatalogItemDtoAbstract` is serving almost the same purpose as `CatalogItemMemento`,
but I think it is different: the former is for deserializing/serializing the catalog.xml,
while the latter is for persisted state. Currently they have different formats but perhaps
they should converge!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message