Mahesh Asrani

Greenhorn
+ Follow
since Mar 03, 2005
Merit badge: grant badges
For More
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 Mahesh Asrani

Hi All

In our current application we have used the Data Access Object (DAO) j2ee design pattern.

I have been asked to evaluate the use of O/R mapping framework HIBERNATE to replace the traditional DAO approach.

I want to know what are the advantages we derive out of a O/R mapping framework like Hibernate or say
How does Hibernate score over DAO

Kindly give your suggestions

Bye
MA
Hi All

Thanks for your prompt response. By cons what I intended to ask is when would Xdoclet be an overkill i.e. Which sort of applications should not use Xdoclet at all.


Bye
MA
Hi All

I have been assigned the task of evaluating XDoclet for our current project. The project which I am evaluating this for is a 3 tier application involving EJB's , web components etc.

we are using Eclipse as the IDE & Weblogic as the app server.
Can somebody with past experience in Xdoclet post the advantages & disadvantages of using the same


Bye
MA
Hi All

I am currently having some methods which have java objects as input parameters.

say if i have an object called Service (which is an input parameter to a method)

This Service object comprises of 3 member variables -
uri, payload & principal.

All these 3 member variables will be extracted in the above mentioned method & then inserted into the database.
In the database, uri & principal are not null columns so I am checking in the method if the 2 are null in the method itself before invoking the database operation. If they are null I throw a custom exception stating the nullness of mandatory parameters as the reason & do not invoke the database operation at all.

This is with null. I want to build a comprehensive sort of validator which can comprise of null checks, empty string validations etc .

Can someone list some pointers to documents or links where I can find more info on the same

Bye
Mahesh
19 years ago
Hi All

How to acheive this in a java program.

Normally when in a java program an exception is raised the program comes to an abrupt halt.

How to avoid this & proceed even if the exception is raised i.e. not to break the further execution of the program

Bye
19 years ago
Hi All

I am not much conversant with design patterns.
In the architecture of our current project which is a colocated architecture (all business elements in the same box).

The client which calls the business components is also on the same box.
i.e all business classes are avilable to me for instantiation.

With this scenario do I need to use the Factory pattern which return me an object wrapped in an interface variable.

Cant i just instantiate my business classes in my calling client. Rather than having a factory , invoke a method on the factory to get a reference of the business object.

Do ellaborate

Bye
Mahesh
Hi All

I hope my doubt is quiet valid. Forgive me if this question sounds frivolous.

The advantage of local interfaces (local home & local component) is if we have the calling entity & the ejb on the same box we can avoid a remote call (ie. no need for call by value) & we can leverage call by reference.

Does this mean that when we have local EJBHome & local EJBObject the stubs & skeletons for the same are not generated as stubs & skeletons are only required in a remote invocation

Do put in your thoughts

Thnks
Mahesh
Hi All

Need your comments on this.

What would be the pros & cons of Having the Data Access Object as a Singleton.
The Data Access Object would be a class which has methods whcih are invoked by Java service layer.
The DAO layer methods basically obtain a connection (database connection ) from the ConnectionFactory class & invoke underlying SQL statements or database stored procedures

Would it be a good idea to make this DAO singelton


Bye
Mahesh
Hi All

In a huge application comprising of numerous packages how do we selectively enable logging for a few packages & disable logging for those packages where logging is not required.
What parameter settings i need to make to my log4j.properties file to achieve the same.

It would be really helpful if someone provided an illustration for the same

Bye
Mahesh
Hi All

I have to access some helper objects in my enterprise beans.
I would like to know where it would be most appropriate to create instances of these helper classes inside the EJB i.e. exactly in which method.

Should i create all the instances in the business method or should it go in the ejbcreate() method or would it be in other ejb methods like setSessionContext or ejbactivate.

I am using SLSB which invokes these plain Java classes.

Bye
Mahesh
Hi Mehul

think you forgot to paste your reply

Bye
Hi All

I need your thoughts on the placement of log4j files

We have a remote architecture involving 2 enterprise servers. Each of these servers
will host different ejbs comprised of varied business logic.

I want to know for the above what sort of logging mechanism should we adopt.


Should we have a central file where all the logging would take place for
all the components on the 2 app servers.

In this case i would need to do a remote call everytime i need to do a log

or

should we keep a single logging file for each ejb app server so that all
business components in 1 particular app server will have one log file for them


Do post your thoughts on the trade off between the 2 approaches & which 1 will be
ideal for our situation


Thanks
Hi All

we have to call a database stored procedure from java which inserts data into a table which has few columns as mandatory

In the tech spec it is said that we have to check whether all these mandatory columns
are being passed with appropriate values at the Java side itself
i.e. if the mandatory values are not being passed the insert database operation
would fail so if these values are not available then do not call the
database stored proc at all

Is this a good idea to introduce checks at the java code itself or would it be better to
rely on the checks that database provides


Do provide your thoughts on the same


Rgrds
Mahesh
Hi All

While designing our current application (using EJB) we have decided to have a
few Business case exception

I am new to EJB & was going through the container's way of handling exception & found that
in case of CMT the container will rollback the Runtime Exceptions

Would it be a good idea to make all our business case exceptions extend to the Runtime Excpetion.

Are there any perils of this approach

Kindly ellaborate on the same


Rgrds
Mahesh
Hi All

Hope I can explain my problem clearly.

I have to post a XML payload to a JMS Topic.

This will be done from one of our POJO class after it performs some business validation.
In this class I have the content in a Java Object which has a big Object tree.
I have to convert this Java Object into XML.

My question to you all is

Should i perform this Java Object to XML conversion logic in the POJO class itself. Because the Java object can vary depending upon situation to situation.

As the JMS Topic takes in a XML content
I would want to know what would be the most effecient way of converting this Java object into XML & sending the XML to the JMS topic.

Kindly respond

Mahesh