• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Custom annotations ?

 
patrick kunert
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • 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

 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • 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
  • 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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic