• 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

Custom annotations ?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
...hello ranchers

just recently received my assignment, and now i'm off making decisions.

My current design uses some custom annotations with a Runtime-RetentionPolicy (in order to be used with Refelction-API). Now I'm wondering if i could end up with an 'Auto-fail' by not paying attention to the 'SecurityManager not installed' restriction.

So, what are your suggestions...is it rather a "hands off" a "yes, but look out for ..." or "no problem"...

thanks in advance
pat

 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Patrick,

Welcome to the JavaRanch!

I think you are the first one who mentions the use of custom annotations for this assignment. I have never heard someone else talk about using them and I'm quiet closely monitoring this forum. I don't think you really need them at all and seems to me that using them (together with the reflection API) will end up in unnecessary overcomplicating your design (and code) where (according to the instructions) an easy, simple, understandable (by a junior programmer) approach is preferred above a complicated but more performant one.

Kind regards,
Roel
 
patrick kunert
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, Thanks...

..thats how it always ends up ;) ... complex (but simple at the same time)

But i agree, rethinking design and KISS is the better approach. Just have to discipline myself!

BTW pretty good work done here at coderanch, which really helped bypassing some pitfalls already...guess ther are quite more to come .

Thanks Pat
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy, Patrick. Welcome to JavaRanch!

You know, I've been working with a concept that is a type of custom annotations, which is called domain annotations. They are essentially annotations that make sense in your domain. If you are working with a Domain Model, then this concept helps isolating the domain objects from external concerns, such as infrastructure. However, a domain model is useful when you are dealing with a complex domain. The use of Transaction Scripts is more adequate when the business logic to be implemented is simple, or when the architecture does not include an ORM framework, which is our case. In conclusion, even though I really really like this idea, I'd say that there isn't really the necessity to create annotations in this project.

One question for you champion, have you thought about the annotations you would create and where you would use them?
 
patrick kunert
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
...well, i try to explain the basics of my concept (though its allways hard work to me ;))

first of all, the key to my approach is, that my Data (DBHandler) uses Proxies to verify manipulating access to proxied Beans (such as of type URLBirdBean) is valid. Locking Mechanisms for example, are therefore not mixed with Bean-Code and can easily be adopted to any Model following Bean-Coding restrictions.

Now, there is additional functionality to the InvocationHandler, such as checking constraints (like mandatory, formatting, length, ...). So, the easiest way to tell the InvocationHandler which constraints should be met, i thought of using annotations...

Yes, i know...it all sounds quite fuzzy : )

But i'll remodel it...
 
reply
    Bookmark Topic Watch Topic
  • New Topic