MyFrameworkAnnotation registeredInstances
Ok, I'm back from vacations so I'll give a comment other than what I did :P.First I like it.Second, how does it work with respect to inheritance? I mean, if I have for example:ClassAnnotation subclass: MyFrameworkAnnotation.And thenMyFrameworkAnnotation subclass: MyConcreteAnnotation1.MyFrameworkAnnotation subclass: MyConcreteAnnotation2.Can I query all my annotations or should do an isKindOf: by hand?On Fri, Sep 29, 2017 at 1:10 PM, Stephane Ducasse <[hidden email]> wrote:tx!On Fri, Sep 29, 2017 at 9:58 AM, Denis Kudriashov <[hidden email]> wrote:2017-09-28 21:12 GMT+02:00 Stephane Ducasse <[hidden email]>:I would not use meta because you would not write annotationAnnotations :)and annotations is meta by its name.classAnnotation is much better than metaAnnotationDone.StefOn Thu, Sep 28, 2017 at 5:40 PM, Denis Kudriashov <[hidden email]> wrote:So I renamed it to ClassAnnotation with all related names.But I keep meta prefix in #metaAnnotations Class extension to avoid general name:MyClass metaAnnotationsYou can check updated readme for details https://github.com/dionisiydk/ClassAnnotation 2017-09-26 17:31 GMT+02:00 Stephane Ducasse <[hidden email]>:;)On Tue, Sep 26, 2017 at 1:28 PM, Ben Coman <[hidden email]> wrote:Shhh... The first rule of meta-club is we don't talk about meta-club.cheers -benOn Mon, Sep 25, 2017 at 11:09 PM, Guillermo Polito <[hidden email]> wrote:Why calling them meta-annotation and not just annotation? Annotations are in general already meta :)On Mon, Sep 25, 2017 at 5:01 PM, Denis Kudriashov <[hidden email]> wrote:Hi.I glad to present one class package which introduces reusable mechanism for first class annotations.The project can be found on github https://github.com/dionisiydk/ClassMetaAnnotation .And I tried to describe why it is needed in my blog http://dionisiydk.blogspot.fr/2017/09/class-meta-annotations ..html And here is overview:Every annotation should be subclass of ClassMetaAnnotation. To attach it to class you create new class side method which will return an instance of the annotation. Method should be marked with pragma #classMetaAnnotation:MyClass class>>specialAnnotation<classMetaAnnotation>^MySpecialAnnotation newTo query annotations from system there are two methods:1) You can ask concrete annotation class for all declared instances:MySpecialAnnotation declaredInstances2) You can ask given class for all attached annotations:Every annotation includes information about annotated class and the selector of declaring method.MyClass metaAnnotationsAll annotations are cached. So it is cheap to query them. There are extra messages to enumerate annotations using block.Now let's discuss it. I think it can be good addition for the Pharo 7. Especially that it is very small code.Also I would like to thank Marcus who helps me realize this concept in Commander and Calypso which I start simplify with this library.Best regards,Denis--
Guille Polito
Research Engineer
Centre de Recherche en Informatique, Signal et Automatique de Lille
CRIStAL - UMR 9189
French National Center for Scientific Research - http://www.cnrs.fr
Phone: <a href="tel:+33%206%2052%2070%2066%2013" value="+33652706613" target="_blank">+33 06 52 70 66 13
--
Guille Polito
Research Engineer
Centre de Recherche en Informatique, Signal et Automatique de Lille
CRIStAL - UMR 9189
French National Center for Scientific Research - http://www.cnrs.fr
Phone: <a href="tel:+33%206%2052%2070%2066%2013" value="+33652706613" target="_blank">+33 06 52 70 66 13
Free forum by Nabble | Edit this page |