Results 1 to 4 of 4

Thread: 'new' command with enums and @Service

  1. #1
    Join Date
    Mar 2007
    Posts
    113

    Default 'new' command with enums and @Service

    hi all..

    am I able to generate a class that has the @Service annotation? using the 'new' command, i don't see a path that has this capability.

    also, same question for enums. is there a way to generate enums?

    thx

  2. #2
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    At this stage we do not have Roo commands to create @Service types nor enums. You can create an empty Java source file, though, with "new java file" and "new test file", depending whether you prefer the created file to be in the SRC_MAIN_JAVA or SRC_TEST_JAVA directories respectively.

    You're invited to add new enhancement requests to our Jira issue tracker if you'd like inbuilt support for creating @Service classes and enums. You can add issues at http://jira.springframework.org/browse/ROO.

    One of the considerations with a "new java enum" command is the likelihood of an associated request for an "add enum constant" command so that people can build their enums via Roo scripts. In this case there will also likely need to be an "add field enum jpa" so you end up with an @Enumerated(EnumType.ORDINAL) or @Enumerated(EnumType.ORDINAL) or @Enumerated(EnumType.STRING) annotated on that field.

    There are fewer considerations for the "new java service" command. We have recently added JMS and email support and these seem logical commands to be used in combination with "new java service".
    Ben Alex
    Project Founder, Spring UAA, Spring Roo and Spring Security

  3. #3
    Join Date
    Mar 2007
    Posts
    113

    Default

    thanks Ben...

    great work on the jms and email. looking forward to those feature. i like your thinking in regards to enum support. right now, i'd prefer web flow support before service/emum. i noticed there's a jira for that.

    i'll add the enum and service features to jira...mainly for tracking purposes..

    appreciate the hard work..looking forward to the next release...

    thanks

  4. #4
    Join Date
    Aug 2004
    Location
    San Mateo, CA
    Posts
    1,265

    Default

    Thanks for the suggestions.

    Personally I would create an @Service by hand and wouldn't see much value unless there were value adds like JMS.

    I see more value in Enums because they are so verbose.

    In general, a consideration is whether Roo should be duplicating functionality that exists satisfactorily in the IDE, like one-way generation of Java constructs.
    Rod Johnson - GM, SpringSource Division, VMware
    http://www.springsource.com
    Spring From the Source

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •