Rajeshwari Natarajan

Ranch Hand
+ Follow
since Mar 05, 2003
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rajeshwari Natarajan

i understand the support for ORM by all the respondents, but my question is regarding the better of the 2 approaches, given the fact that i CANNOT use a ORM tool.

The database has grown to be a huge one..and cannot be changed now.
Most of the application screens to be developed are transactional in nature.
For a typical screen, i have to fetch data from multiple tables. The screen will udpate 1 or more tables.

It is not going to be a simple CRUD on one table - just fetching data from a table and updating back in the same table.

Given this scenario, what would be the best approach for coding the data access layer?
Usage of ORM tools is not the IT standard of the customer. So we really do not have a choice on this !

Regarding the nature of the application, it is going to be primarily transaction driven, and most of the screens will update 2 or more tables.

There are very few simple CRUD scenarios.
Just curious, would ORM tools prove advantageous in this scenario?
Hi all,

I need advice on using the DAO pattern.

We have to develop a J2EE application with Oracle as database. There are 300 odd tables. We would not be going for any ORM tools since the cusotmer does not favor them.

1) One approach is to use one DAO for each database table/View.

- For searching against multiple tables, Database View will be used.
- All the insert, update, delete operations for that table will be handled by the same DAO.

The downside of this approach are
- Large number of DAOs - there is a DAO for each table and view in the database
- When data has to be inserted/updated in multiple tables, multiple DAOs have to be called. A helper class has to be introduced to handle the multiple DAO calls

2) The second approach is to use a single DAO for all related operations. The number of DAOs will be driven by the business functionality.

The downside of this approach are
- Difficult to maintain code, since the same table maybe getting updated (for different attributes) by different DAOs

Which of these approaches would you recommend, based on your experience.
No object is garbage collected.
First off, there is only one object created at line 1.
Both the variables a and b refer to the same object. When u set a to null, b still refers to the object.
So the object can't be GC-ed.
Yes..its perfectly valid to have an abstract class without any abstract methods.
You can also bootstrap the JVM using main method in the abstract class.
However u can't instantiate an object of the class since its abstract.
Hi all,
How should we declare and use constants in a project?
Should constants (public static final variables) be declared in a class or in interface?
Many argue that we should not use interface since we are not implementing any behaviour. This is true if my class implements the interface containing constants.
But what if all I do is import the interface and make use of the constant?

In the above piece of code, what difference does it make if I use
CONSTANTS.CONST_UID or ICONSTANTS.CONST_UID? Is there any difference in performance?
Which is the correct approach?
[ November 23, 2003: Message edited by: Rajeshwari Natarajan ]
thanks for the solution Wayne. I'll try that out.
One way of maintaining association between orderNumber and productCode would be to have the orderNumber attribute in VO2 also. But that would make it reduntant data.
So possibly i should have a temporay Collection to store the association betwwn a lineItem and an orderNumber.
20 years ago
i'll explain the requirement more in detail..
i have 2 objects Order and LineItem like this.

I will get a collection of Order objects and i have to dispaly the deails on screen.
The user can choose to sort the details based on orderNumber or productCode.
If he chooses productCode, then all the lineItems should be sorted. This sorting should be done considering the lineItems of all the orders(outer collection).
For example, consider that i have 2 order with orderNumber 5 and 3.
For the first order, let the lineItems have productCode 2 and 7.
For the second order, let the lineItems have productCode 3 and 5.
If i sort in ascending order based on productCode, i should get the data as,

How do achieve this?
Should i have 2 different compartor classes for the inner and outer collection?
[ November 04, 2003: Message edited by: Rajeshwari Natarajan ]
20 years ago
I have a collection (ArrayList) of objects obj1.
Each object in the collection inturn contains an ArrayList of objects obj2.
Now i want to sort the entire collection based on an attribute in obj2.
Any ideas on how to implement the Comparable inteface for the same?
20 years ago
I a new to struts framework and having a difficulty coding the ActionForm form for the follwing scenario.
I hava a JSP using DHTML.
User can add one or more dynamic rows on the screen. Each row will have a few text boxes, check boxes and radio buttons. So there will be multiple rows with identical controls. How should the getters and setters in my ActionForm be for such a scenario?
20 years ago
The exam voucher costs Rs 7500 but Sun has discounted by 20% and the new voucher costs Rs 6000 but is valid only till september end.
thanx for the link Jessica..and more importantly thanx for the search tip..
sometime back Bert Bates had posted a topic which was something like
"Top 10 topics which are thought to be on the exam but are not"
i am unable to find that link thru the search.
can someone plz provide the link
Answer C is not valid.

The above code will give compile time error.
Using the keyword *this* like in the above example is wrong. It can only be in the first line of a constructor. this(a, b, c) will try to call a constructor with 3 args of compatible data type.
The primary reason for using the DAO pattern is to separate the business and the data access logic.
The datastore can be anything - database like Oracle, SQL Server, flat files, XML etc.