Friday 15 June 2012

Which interface/abstract class is for grails Domain class behaviour? -


I have a common method of doing common tasks on many domain classes

  static map GetNumberOfPropertyByTopicIds (def criterion class, list id) {criteriaClass.createCriteria () // some goram methods have been used}  

I used the criteria class It was to complete things automatically. But to do this, I need to change the def criterion class to the interfacefordadman classbehavik value class .

But what I do not know is InterfaceForDomainClassBehavior Which interface / abstract class implementation of class domain class?

Nobody is there. Grails use "conference on configuration", so unlike other frameworks where you extend a base class, apply one or more interfaces, use annotations, etc., You use the correct directory, appropriate class naming conventions (except domain classes) under your Artifact classes (domain classes, services, etc.) grails-app , and Grails mixes in the behavior for you you Of course, things can be configured, e.g. Before Greets 2, using Groove Runtime Metaprogramming and most behaviors in Grill 2 are added at compile time using ASTS. And runtime metaprogramming is mostly used for dynamic code like findAllByHeightAndWight and Higher Collar and ShowAgeSize , where it should be impractical and / or impossible in every combination.

More than 100 ways are added in the domain classes (some decompile - it is very surprising to see how much is expensive in your classes, how small the Groovy source is) and dozens of controllers added But all this is mixed, so although there is a significant overlap between your domain classes, unless you add them manually, any common base class or interface Congress does not.


No comments:

Post a Comment