Re: [jgroups-users] Getters and setters in 4.0
Questions/problems related to using JGroups <[email protected]>
| Newsgroups | gmane.comp.java.javagroups.general |
|---|---|
| Message-ID | <[email protected]> |
I added standard getters and setters this morning. This affects the public classes, e.g. JChannel, Message, RpcDispatcher etc. Take a look and let me know if this works for you. It will be a while until 4.0 is released, so let's get the API right! Cheers, and thx for the feedback, On 08/07/16 16:18, Questions/problems related to using JGroups wrote: > > > On Thu, Jul 7, 2016 at 11:11 PM, Questions/problems related to using > JGroups <[email protected] > <mailto:[email protected]>> wrote: > > > > On 07/07/16 19:36, Questions/problems related to using JGroups wrote: > > I think removing get/set is a bad idea for reasons expressed already. > > Furthermore it will reduce the effectiveness of code > > analysis/introspection tools which understand the concept of > > getters/setters that start with get/set. > > Which ones? It's not hard to identify methods which return a field as > getters and methods which take one parameter and set a field as setters. > There's actually code in JGroups which exposes such methods as managed > attributes if @ManagedAttribute is used on a method. > > > Example of a somewhat trivial case which I just confirmed on IntelliJ > and I think Eclipse is the same. There are code generation tools to > implement typical methods. If you want to generate a getter in a class > it will list all member variables that don't have one so you can choose > which ones to generate getters for. If you don't follow convention it > will include all member variables including those which have getters > because it assumes getters start with "get". Adding @ManagedAttribute > to the non-standard getter did not fix this. Now you can change the > template it follows to work with the non-standard convention but then it > won't work with standard convention. This is a widely used tool that is > designed to understand the code by following standard naming > conventions, not by higher order code analysis. > > While this specific case may not be a big deal for JGroups, my concern > is that there may be other tools that will be confused/diminished as > well. Tools I have used that I would be concerned about affecting are > ProGuard, ThreadSafe, and CodePro. Maybe they only do higher order code > analysis and now nothing about naming conventions, I don't know. > > > ------------------------------------------------------------------------------ > Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San > Francisco, CA to explore cutting-edge tech and listen to tech luminaries > present their vision of the future. This family event has something for > everyone, including kids. Get more information and register today. > http://sdm.link/attshape > > > > _______________________________________________ > javagroups-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/javagroups-users > -- Bela Ban, JGroups lead (http://www.jgroups.org) ------------------------------------------------------------------------------ Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San Francisco, CA to explore cutting-edge tech and listen to tech luminaries present their vision of the future. This family event has something for everyone, including kids. Get more information and register today. http://sdm.link/attshape