brooklyn-dev mailing list archives

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

    https://github.com/apache/incubator-brooklyn/pull/175#discussion_r17798128
  
    --- 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 --
    
    Regarding comment 1, I made all of the fields flags so that `BasicCatalogItemRebindSupport`
could set them when `reconstruct` was called. Would you recommend any other method?
    
    Regarding comments 2, 3 and 4, I would really like the catalogue domain objects to be
reworked. They were quite a pain to work with! I came to the same conclusion as you regarding
`CatalogItemDtoAbstract` and `CatalogItemMemento`. I didn't consider whether `CatalogItemDto`
needed to extends `CatalogItem`.


---
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