Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [higgins-dev] Complex attr values as blank entities

Ok, how's this?: 

public interface IBlankEntity extends IHasAttributes { 
    public IEntityModel getModel() throws IdASException; 
} 

public interface IEntity extends IHasMetadata, IBlankEntity { 
    public IContext getContext() throws IdASException; 
    public String getEntityID() throws IdASException; 
    void remove() throws IdASException; 
} 

public interface IAttributeValue extends IHasMetadata { 
    public boolean isSimple() throws IdASException; 
    public void remove() throws IdASException; 
    public boolean equals(IAttributeValue value) throws IdASException; 
} 

public interface IComplexAttrValue extends IAttributeValue, IBlankEntity 
{} 

public interface ISimpleAttrValue extends ITypedValue, IAttributeValue { 
    public IAttributeSimpleValueModel getModel() throws IdASException; 
} 

That is to say:  An attribute can either be simple or complex.  When simple, getModel() returns IAttributeSimpleValueModel.  When complex, getModel() returns IEntityModel (same as what getModel() returns for an IEntity.  I *think* that's the crux of what's being asked for :) 

This means we can get rid of IAttributeComplexValueModel.  I also propose removing IAttributeValueModel, there's really nothing of use that it adds. 

Jim 


p.s. I really think all this stuff with I*Model will be much simpler if we just move to expressing model as first-class entities. 


>>> "Jim Sermersheim" <jimse@xxxxxxxxxx> 06/03/08 9:04 AM >>>

IBlankEntity does not have an entityID, nor is it directly associated with a context (like an IEntity does), so it didn't make sense for a blank entity to extend IEntity. 


> It looks we need just to remove the method getModel() from IAttributeValueModel interface. 
I think that's a typo?  There's no getModel() on that Interface. 


Anyway, I could simply *rename* IComplexAttrValue to IBlankEntity.  Is that all people want? 


Frankly, I'm still struggling with the actual requirement.  As it is, in my mind, IEntity and IComplexAttrValue (or IBlankEntity) have IHasAttributes in common.  I mean, the practical way they're both used in terms of enumerating "sub-elements" is already exactly the same.  It's just that right now IComplexAttrValue doesn't have the word "entity" in it anywhere. 


Has this issue been reduced to nothing more than a terminology thing?  Confused :( 


Jim

>>> "Sergey Lyakhov" <slyakhov@xxxxxxxxxxxxxx> 06/03/08 7:49 AM >>>

Jim, 

                  

1. >  Next I looked at somehow making this IBlankEntity the supertype for IComplexAttrValue.  

                  

Why we still need IComplexAttrValue? I think we should replace IComplexAttrValue with IBlankEntity. 

                  

2. > That doesn't work so well because of the getModel() method.  IAttributeValue already has getModel() which returns an IAttributeValueModel. 

                  

It looks we need just to remove the method getModel() from IAttributeValueModel interface. 

                  

3. I suppose it would be better for IBlankEntity to extend IEntity because IEntity should not extend IAttributeValue. So, we can do the following: 

                  

a) IEntity extends IHasAttributes 

b) IBlankEntity extends IEntity, IAttributeValue 

                  

In this case IBlankEntity.getEntityID() would return no value or some value which can not be used in the same way as a value of "entityID" attribute of Entty. 

                  

Thanks,
Sergey Lyakhov 

                  

----- Original Message ----- 


From: Jim Sermersheim ( mailto:jimse@xxxxxxxxxx ) 

To: <a title="Higgins dev Higgins dev <higgins-dev@xxxxxxxxxxx 

Sent: Tuesday, June 03, 2008 4:17 AM 

Subject: [higgins-dev] Complex attr values as blank entities 



I started playing around with creating an interface like this: 


public interface IBlankEntity extends IHasAttributes { 
    public IEntityModel getModel() throws IdASException; 
} 


and made IEntity extend that.  No real change there -- just injected another interface layer.   


Next I looked at somehow making this IBlankEntity the supertype for IComplexAttrValue.  That doesn't work so well because of the getModel() method.  IAttributeValue already has getModel() which returns an IAttributeValueModel. 


So, I need to re-gather the actual requirements for this.  Right now we have: 
public interface IComplexAttrValue extends IAttributeValue, IHasAttributes {} 


and we have 
public interface IEntity extends IHasAttributes { 
    public IContext getContext() throws IdASException; 
    public String getEntityID() throws IdASException; 
} 


So, in effect a complex attribute is the same as an entity today other than IEntity allows one to get its context and entity ID. 


Is it just a terminology thing?  I can continue on the path I was on and keep getModel on IEntity.  This would mean IBlankEntity is exactly the same as IHasAttributes, but maybe people like the name better? 


Let me know if you have an opinion. 


Jim 








_______________________________________________
higgins-dev mailing list
higgins-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/higgins-dev


Back to the top