• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

FrontMan style: many @FrontmanCommand annotations per java class

 
Rancher
Posts: 4804
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it possible?
Is it good?

I can have either a bunch of commands, say

@FrontmanCommand("addfoo")
@FrontmanCommand("editfoo")
@FrontmanCommand("deletefoo")

in one class, or have three (or more) classes each with only one annotation.

Having the related "foo" CRUD functions in one class seems clean to me, but does FrontMan like it?

Thanks
Pat
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since you can only have one execute() method per class, what would you hope to accomplish with this? Or are you just trying to create synonyms?

And no, not expected or supported.

If you want to create synonyms, you can do so by defining them in a properties file.
 
Pat Farrell
Rancher
Posts: 4804
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Since you can only have one execute() method per class, what would you hope to accomplish with this? Or are you just trying to create synonyms?
If you want to create synonyms, you can do so by defining them in a properties file.



Oh no! Not properties files.

I tried it, and it won't compile with two annotations, so clearly I need CreateFoo, ReadFoo, UpdateFoo and DeleteFoo classes.

I'll use a base class, since a lot of the "locate a Foo" and "save the Foo" are common to all

Does the FrontMan control search algorithm look at subpackages for the @FrontmanCommand? Just trying to keep from having a zillion classes in a flat name space

Thanks
Pat
 
Bear Bibeault
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, it will search the hierarchy under where you tell it the commands root is. If you are using annotations it's pretty seamless. If you are using "by convention" the package hierarchy becomes part of the command verb.
 
Pat Farrell
Rancher
Posts: 4804
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Yes, it will search the hierarchy under where you tell it the commands root is. If you are using annotations it's pretty seamless.



That is exactly what I hoped to hear.

Thanks
 
reply
    Bookmark Topic Watch Topic
  • New Topic