cancel
Showing results for 
Search instead for 
Did you mean: 

Aspects in Content Modelling

ashwinis
Champ in-the-making
Champ in-the-making
Hi,

Everywhere in the online it has been mentioned like, Aspect is the closest equivalent in the object-oriented
world is the notion of multiple inheritance.
Can anyone please explain how the multiple inheritance is supported by Aspects in content modelling with example?
3 REPLIES 3

mlagneaux
Champ on-the-rise
Champ on-the-rise
Hi,

An aspect represents a set of properties and associations related to the same technical or functional domain. For example, with "versionable" aspect, you can add all properties to manage versioning on your node. Another example, "EXIF" aspect adds properties to manage images metadata.

You can add several aspects on a node. For example, you can add "EXIF" aspect and "geographic" (to localize where the photo was taken) aspect on a photo.

ashwinis
Champ in-the-making
Champ in-the-making
Hi,

Can you explain more why "multiple inheritance" is mentioned for Aspects, what ever u explained is the concept of inheritance.
Can u give some code example in modelling?

mrogers
Star Contributor
Star Contributor
Big claim here but Multiple inheritance was a mistake ….    For example in  c++ you spend an awful lot of time disambiguating which properties/operations/methods should apply to your many parents.   In the real world whether its people or cars you don't have multiple parents of different types.    You can contrive examples where it may seem a good idea but they lead to misery.

So in java ( and several other earlier languages )  they did away with multiple inheretance,  there is only a single inheritance.    But how to do the multiple thing?   Well objects may only be a single type but they can also expose other interfaces.   And those interfaces can be added and removed at compile or runtime which is sort of multiple inheritance lite,  without the ambiguity or complexity.

In java they are called interfaces,  in alfresco models aspects and in cmis secondary types.


So if you are modelling documents what is it that is essential to all documents?   And what only applies to some documents.     You may have a system that says a document is just a stream of information with a name. In which case your base type is something like alfresco's cm:content type.    You may then have something like engineering drawing that must have a drawing number,  client code and version number otherwise it's not an engineering drawing.     You create a subtype for that,   That,s what inheritance is for.   However say you also have a legal department that looks at some of your documents.    Your documents are still engineering drawings but your legal department could add their own stuff to say that they have looked at a document, approved it,  that's what you use an aspect for.      Now also imagine that you have a base type for all your hr documents with a bunch of functionality associated with hr documents such as who approves the policy and to whom the policy applies.     At this point if the legal department also needs to approve the hr document then they can do so easily with their aspect.

Another example is alfresco's versionable aspect that says a document should be versioned.     That may or may not be essential for your engineering drawing, but expressing it as an aspect gives you the choice.  

I've given this advice on these forums before but when content modelling things should be easy and express your business case.    If things get complicated or difficult then it's probably a sign that there is a mistake somewhere in your model.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.