dtolabs / yana2

Yet Another Node Authority ... because you wanted an agile Real-Time Service Model (RTSM)
8 stars 1 forks source link

Allow node types and instances to be loaded separately #168

Closed ashortland closed 12 years ago

ashortland commented 12 years ago

The yana.xsd currently requires that XML always include attributes, attributes and nodes (instances):

    <xs:element name="yana">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="attributes"  maxOccurs="1"/>
                <xs:element ref="nodetypes" maxOccurs="1"/>
                <xs:element ref="nodes"  maxOccurs="1"/>
                <xs:element ref="nodetyperelationships" minOccurs="0" maxOccurs="1"/>
                <xs:element ref="noderelationships" minOccurs="0" maxOccurs="1"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

... it would be much more flexible if these elements could be managed separately. For example managing the type model separately from the instance model.

orubel commented 12 years ago

How would you do a relationship check for them on import via XML? You effectively cant making it so you can't separate these. And if you are defining this, you need to define all related data because you cant define an import later on and be able to have XML be able to do the checks in a separate XML import; it all other nothing when checking the data relationships in XML.

You either are able to have XML do all the checks at once or you have to pass this functionlity on to the interface/API.

So what you are talking about is NOT doing this in XML but having an interface import instead and doing the checks programmatically rather than through XML so you can separate them. That would be about th only way you could do it.

ashortland commented 12 years ago

Well there's some value in allowing types to be loaded via XML (assuming node instances will be added via the UI or the web API). That's a quick fix I'm committing now.

Ultimately, though, the place to check node instances against is the runtime type model, not the XML type model.

Anthony.

On Jul 25, 2012, at 5:07 PM, foofoobar wrote:

How would you do a relationship check for them on import via XML? You effectively cant making it so you can't separate these. And if you are defining this, you need to define all related data because you can define an import later on and be able to have XML be able to do the checks.

You either are able to have XML do all the checks at once or you have to pass this functionlity on to the interface/API.


Reply to this email directly or view it on GitHub: https://github.com/dtolabs/yana2/issues/168#issuecomment-7266026

orubel commented 12 years ago

Oh ok well then this is added functionality then because you would want to be able to have an all inclusive import while at the same time doing what you are saying. This wouldn't be so much an issue with the XML but added functionality of moving this functionality and checking into a class so it can be more modular and called from within a service or api.