But, all of them uses reflection API which is not acceptable by our project as it impacts performance.
Ulf Dittmer wrote:
But, all of them uses reflection API which is not acceptable by our project as it impacts performance.
Does this describe an actual problem that you experienced, or is it based just on rumors you heard/read? While it's true that using reflection is slower than performing the same operation directly in Java code, it's still very fast. You shouldn't make decisions based on that unless you have done extensive timings with all the available frameworks and determined that none meet your requirements.
Plus, using someone else's debugged and optimized code is a heck of a lot faster than writing and debugging your own.
Mandy Ram wrote:Thanks for your reply.Actually, I didn't face any problem but the project in which am working presently implemented some business logic using reflection API and faced performance degradation and so they are not giving a go ahead for reflection API for this implementation.
Mandy Ram wrote:So,we just want to create plain java code which sets the values from one object to another object.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:
Finally, you need to ask yourself whether Java is actually the right language for doing this. It sounds to me like the sort of thing I might do in a scripting language (or Smalltalk, for those that remember ); but personally, I wouldn't touch it with a bargepole in Java.
Ulf Dittmer wrote:
Mandy Ram wrote:the project in which am working presently implemented some business logic using reflection API and faced performance degradation
That doesn't make sense. Just because project A faces certain issues doesn't mean project B will face the same issues. You need to challenge such blanket assumptions. Using reflection for this purpose is done by lots of libraries and millions of users round the world without problems. It sounds a bit like one of these assumptions about Java performance that date from 1996, and have long since been addressed, yet are still being repeated like mantras by some folks to this day.
Jeff Verdegan wrote:What about a "scriptable Java," such as Groovy or Beanshell?
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:
@Mandy: Your basic problem is that you are trying to turn a Java class into a first-class object and, since the language doesn't support this, whatever solution you come up with will be a work-around. Personally, I wouldn't like to base an entire project on a kludge.
Jeff Verdegan wrote:Is she "basing the entire project" on it though?
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Jayesh A Lalwani wrote:A lot of the mapper libraries (and I believe Dozer does it too) have 2 phases...
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:
Jayesh A Lalwani wrote:A lot of the mapper libraries (and I believe Dozer does it too) have 2 phases...
I must be getting very old. I thought design was about using the right tool for the job; and surely that includes languages as well?
I can't imagine that a library, even one designed expressly for making classes first-class objects is likely to do it any better than a language (or script) which has it expressly built in;
Jeff Verdegan wrote:But then, I suspect you might already know that.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
I suggest huckleberry pie. But the only thing on the gluten free menu is this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|