This week's giveaway is in the JDBC forum.
We're giving away four copies of Java Database Connections & Transactions (e-book only) and have Marco Behler on-line!
See this thread for details.
Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!

raj malhotra

Ranch Hand
+ Follow
since Feb 22, 2007
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by raj malhotra

Thanks Jeanne,

Ok i got it. Does Annotation based configuration, as versatile as XML based Metadata?

Regards,
Raj
3 years ago
Hi ,

I want to learn Spring Framework. I want to know which is the preferred way of configuring IOC Container:-
1. XML based Metadata
2. Annotation based Configuration
3. Java based Configuration

I want to use the configuration later on in Enterprise application development.


Thanks,
Raj
3 years ago
Hi Guys,

I aim to become a Software architect in future. I want to select one out of the below books to study the Software architecture principles:-

1. Software Architecture: Foundations, Theory, and Practice
2. Software Architecture in Practice 3rd edition

I have gone through the Table of Contents. But i am still not able to decide, which one should i select.If anyone has read these , please suggest me.


Thanks,
Raj
4 years ago

i know that super keyword is used to call overridden method version of superclass but as universal truth we can't override static method then why it is working here, what is the wrong with java ?



It is not possible to override static method. But it is possible to hide the static method by defining another method with the same signature in the subclass. So actually we can call the supper class static method by invoking SUPER_CLASS.staticMethod() or superClassINstance.staticMethod() or super.staticMethod() in subclass.

Even if you write superClassINstance.staticMethod() , compiler will change it to SUPER_CLASS.staticMethod().

Thanks,
Raj
Yes there should not be setter methods for a derived field.This was just a dummy code since i didn't want to paste original source code from my project. And in a hurry i generated all setter and getters.
Thanks for looking into the code.

-Raj
Hi Mark,

I dont know much about WRML.May be it is far better then my thought.But just i want to know Does your book has strong coupling with WRML? Can i learn REST full webservices with/without WRML from this book? And who is your target audience- Beginner,Intermediate or Advanced users.


Thanks,
Raj
7 years ago
Hi James,

Thanks for reply.Yes you are correct.Then i have to recalculate the properties for other service.I noticed one more thing , even if only one service method is going to use this DAO but still the current code couples the userid with the derived properties.So unless you supply userid you cannot get the derived properties.

Thanks,
Raj
HI,
I have a sample code below.In which i fetch collection of half filled PrefixBeans from database.Then i use a service class to derive the remaining properties of the prefixbean and update the bean.My doubt is since the remaining bean properties are dervied from one or tow bean properties.Should i write the derivation logic in the bean getters or is it ok to calculate the remaining properties in the service class.?If i do in the service class, is it violating any OOP principle?Do you find any code smell here?

The PefixBean will contain the organizationPrefix and existingItemCount already filled by the DAO.



The below service method is used to calculate the remaing fields of the PrefixBean.


String objects which cannot be referenced once the 'for loop' executes are very likely garbage collected, which is why the profiler is unable to show them.



No i am adding all the objects to list using addObj method, so all the strings should not be garbage collectible.Also if I increase the for loop limit to 200000000000000 from current 2000, I will get out of memory exception. Profiler should be able to catch it as it is a memory leak. Is this behavior specific to this profiler only or is common in all the profilers?

Thanks,
Raj
8 years ago
HI
I am using TPTP eclipse plugin as profiler to find the memory leak.I have written one small program to profile my first program but profiler is not able to find the object creation .Here is my program:-



Profiler is only showing one object created in main method .But it not able to find the object creation in the run method.Am i doing anything wrong here?This is my first program which i am running using profiler.

Thanks,
Raj
8 years ago
Thanks Paul for your reply. so checked exception is the right choice.
8 years ago
Hi,

If i need to define a user-defined ApplicationException in my web application.Should i go for Checked or Unchecked exception?What are there advantages and disadvantages ?

Thanks,
Rajvinder
8 years ago
In Bunk house each book has Discuss book in the Saloon link but that is pointing to wrong threads.

Thanks,
Raj
8 years ago

I want to "engineer"
the solution, not "reverse-engineer" it.




Try Design Patterns Explained: 2nd Edition Design Patterns Explained: A New Perspective on Object-Oriented Design (Second Edition)
by Alan and James

This is very good book which emphasis on design the solution.

Another book which i liked very much is Head First Object Oriented analysis and design . Although i have finished just 2 chapters but i am already impressed with it.

Thanks,
Raj
Hi

The following text is form http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObjectAssembler.html


The Composite Entity pattern promotes a coarse-grained entity bean design, where entities can produce composite Transfer Objects similar to the one produced by the Transfer Object Assembler. However, the Transfer Object Assembler is more applicable when the composite Transfer Object constructed is derived from a number of components (session beans, entity beans, DAOs, and so forth), whereas the Composite Entity pattern constructs the Transfer Object from its own data (that is, a single entity bean).



Here what i understood is both Composite Entity and Transfer Object Assembler produces Composite Transfer Object.Transfer Object Assembler creates the composite TO using different datasources whereas composite entity build it using one datasource.

I am not sure about last line i mentioned above.Could anyone point me whats the exact difference if i am wrong?

Thanks,
Raj