Hi Patrik, You asked: "Is it important to support multiple inheritance levels?"
I did not answer the question when this was first posted because it was before I started using Sculptor. My answer is "Yes!" Sculptor is very powerful, yet there is this limitation on inheritance that is quite bothersome. I know that creating a tree of inherited objects can be one of those anti-patterns, so I understand the desire to not support it. However, sometimes inheritance does make sense. And even if it is being abused, sometimes we have no choice but to stick with it because the costs of refactoring the client code is too high. Sculptor's support for inheritance is extremely important because it feeds into many other templates like the Hibernate template and other templates that I'm building. If Sculptor only supports single-level inheritance, then my tools are stuck with that as the lowest common denominator even if they (like Hibernate) do support multi-level. So it would be wonderful if this restriction can be removed. It is giving me a headache right now because I need to create a model with multi-level inheritance. ;) Is this something that is difficult to support? Is there a hack or a few that I can put in to make it work for me until you come up with an elegant solution? I am not using the CRUD generation part of Sculptor, which you mentioned before as being problematic for multi-level inheritance. Any help that you can give me would be greatly appreciated. Thanks! --Polly Patrik Nordwall wrote: > > I think I have answered a similar question here: > http://www.nabble.com/Multiple-inheritance-levels-td14117902s17564.html > > What do you (all) think? Is it important to support multiple inheritance > levels? > > /Patrik > > > cameroon wrote: >> >> Hi all, >> >> I am trying to model multi level class inheritance with the sculptor >> model, but the does not work. >> Here is the issue: I have three Entities (E_A, E_B and E_C) and the >> modelling looks like this >> >> Module MyModule { >> abstract Entity E_A { >> String a >> } >> abstract Entity E_B extends E_A { >> String b >> } >> Entity E_C extends E_B { >> String c >> } >> } >> >> and during the code generation I got this error: >> >> [INFO] [fornax-oaw-m2:run-workflow {execution: default}] >> [INFO] oAW Maven2 Plugin V2.0.0 >> 0 INFO WorkflowRunner - >> -------------------------------------------------------------------------------------- >> 10 INFO WorkflowRunner - openArchitectureWare 4.2.0, Build >> 200709162219NGT >> 10 INFO WorkflowRunner - (c) 2005-2007 openarchitectureware.org >> and contributors >> 10 INFO WorkflowRunner - >> -------------------------------------------------------------------------------------- >> 10 INFO WorkflowRunner - running workflow: workflow.oaw >> 10 INFO WorkflowRunner - >> 80 WARN WorkflowCustomization - Cannot resolve keyword class >> org.openarchitectureware.xpand2.Generator >> 80 WARN WorkflowCustomization - Cannot resolve keyword class >> org.openarchitectureware.xpand2.Generator >> 80 WARN WorkflowCustomization - Cannot resolve keyword class >> org.eclipse.mwe.emf.Reader >> 80 WARN WorkflowCustomization - Cannot resolve keyword class >> org.eclipse.mwe.emf.Writer >> 80 WARN WorkflowCustomization - Cannot resolve keyword class >> org.openarchitectureware.xtend.XtendComponent >> 80 WARN WorkflowCustomization - Cannot resolve keyword class >> org.openarchitectureware.xtend.XtendComponent >> 90 WARN WorkflowCustomization - Cannot resolve keyword class >> org.openarchitectureware.xpand2.GeneratorAdvice >> 90 WARN WorkflowCustomization - Cannot resolve keyword class >> org.openarchitectureware.xtend.XtendAdvice >> 110 WARN WorkflowCustomization - Cannot resolve keyword class >> org.openarchitectureware.check.CheckComponent >> 972 INFO CompositeComponent - Workflow: executing workflow >> sculptorworkflow.oaw in workflow.oaw:3 >> 972 INFO CompositeComponent - Workflow: executing workflow >> org/fornax/cartridges/sculptor/dsl/parser/Parser.oaw in >> sculptorworkflow.oaw:28 >> 972 INFO CompositeComponent - ParserComponent(sculptordsl-parser) >> 3034 INFO CompositeComponent - IfComponent: executing if >> org/fornax/cartridges/sculptor/dsl/parser/Parser.oaw in >> org/fornax/cartridges/sculptor/dsl/parser/Parser.oaw:9 >> 3034 INFO ConditionalComponent - CheckComponent(sculptordsl-checker): >> expression dslModel.eAllContents.union({dslModel}) check file(s): >> org::fornax::cartridges::sculptor::dsl::GenChecks >> org::fornax::cartridges::sculptor::dsl::Checks >> 3115 INFO CompositeComponent - XtendComponent(dslTransformation): >> executing 'transformation::DslTransformation' >> 3575 INFO CompositeComponent - CheckComponent: slot model check file(s): >> constraints/constraints >> 3655 ERROR WorkflowRunner - Workflow interrupted. Reason: Errors >> during validation. >> 3655 ERROR WorkflowRunner - Only one level of extension is supported >> E_C extends E_B extends E_A [EMAIL PROTECTED] >> (name: E_C, doc: null) (abstract: false, optimisticLocking: true, cache: >> false, package: null, databaseTable: null) (aggregateRoot: true, >> auditable: true)] >> [INFO] >> ------------------------------------------------------------------------ >> [ERROR] BUILD ERROR >> [INFO] >> ------------------------------------------------------------------------ >> [INFO] Generation failed >> [INFO] >> ------------------------------------------------------------------------ >> >> Is there or someone knows a best practices about this kind of multi >> levels mapping inheritance? >> >> Thanks, for advance. >> > > -- View this message in context: http://www.nabble.com/problem-with-multi-levels-class-inheritance%3A-Best-practices-tp17598981s17564p18971077.html Sent from the Fornax-Platform mailing list archive at Nabble.com. ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Fornax-developer mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/fornax-developer
