Joshua Antony

Ranch Hand
+ Follow
since Jun 05, 2006
Merit badge: grant badges
For More
India
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Joshua Antony

Sorry, I should have been more specific, reset method resets MOST of the fields and not all fields.

Thank you
Joshua
Basically the reset method just resets all the fields in the object to default value. With "object that is most intimate with the data" , having the method in VO makes more sense.

Joshua
Hi,

I have a value object which has some attributes. In one scenario, all the values in the object needs to be reset. I am caught between 2 options, one to reset all the values (one by one) in the VO from another Form Handler or have a reset method in the VO itself and then invoke the reset method from Form Handler.

Pattern wise, I feel that having reset method in the VO is better, but am just not 100% sure if attaching reset to VO makes sense.

Joshua
Hi,

I am doing a Technical Design for a project, which interacts with webservice to fetch particular set of data. The problem here is that the maximum expected SOAP response size is 5MB. In order to simulate this behaviour, I created a Mock Service to return approx 5MB of data & tested the performance through SOAP-UI. However, to my surprise the SOAP-UI says that the response was 11MB! Just to make sure, I copied the response & saved as XML - validated the size , it was same 5MB. So, I started testing on different clients & I get inconsistent behaviour regarding the data returned and the performance by SOAP-UI. For the same 5MB of actual data, different SOAP-UI instances in different boxes have different response times (from 500ms - 5 sec) & different data size (5MB - 11MB). Thus, I assume that this is something to do with the network & hence the question -
What is the network overhead of sending 5MB of data as part of SOAP response? Will the response time be less than 1sec (assuming standard production app network configuration)?

Any inputs on this will be highly appreciated since its always better to find these gotchas before starting development :-)

Joshua
11 years ago
Hi All,

While running security scan for an application, we got error like The test successfully embedded a script in the response, which will be executed once the user activates the OnMouseOver function However, in the response we can see that the script embedded looks like


I cannot see any security threat here, do we need to worry about this? since we already have a filter which filters out < > symbols , thus <script> can never be injected.
Please provide your valuable suggestions.


13 years ago
Hi All,

I want to change the session id of the user when he logs in to the application to prevent against session fixation . I have tried below with no luck -

1. Invalidate the session before log in by session.invalidate()- this results in side effects since we have many session scoped components which cannot be ignored on log in
2. Use valve to invalidate session - again this resulted in lot of side effects due to session scoped components


So, just looking for a way to change the session id instead of invalidate the old session. I think this can be achieved in latest tomcat version by calling ManagerBase.changeSesionId() , but unfortunately I am running with old JBoss

Any help is highly appreciated.

Regards,
Joshua
13 years ago
I have never seen some of the DTO change (in one of the maintanance project ) and do not feel like that may change in future too, so in that case would it not be appropriate to choose data structure over OOP


I have seen many bean classes like above which has private variables and getter/setter for encapsulation.

My question is that isin't this too much over engineering? Would it not be better to just have the class with the properties declared as public (assuming that the class has no behaviours/methods and the setter/getter do not perform any validation or any other operation on the data)

Cheers-
Joshua


Above code gets executed successfully

Answer is 1 because a2.a=null frees an object therby making it eligible for GC. I am sure you can find out if you try a bit harder

Cheers-
Joshua
You have to analyse this using pen and paper, find out how many objects are created in total and then check out how many gets derefrenced.
I guess 4 new objects are created in this scenario and finally 1 becomes eligible for GC

Cheers-
Joshua
I have a situation here, below is the extract


I want to get rid of the switch statement, reading through one of Martin Fowler's book found that this can be replaced by adding appropriate subclass (for each case condition) and using the same polymorphically in this method.

However, as can be seen by the method getting invoked, they dont seem to be doing similar work, so subclassing them with a common parent would not yeild a common behavior(method) to be abstracted out in the parent class.

Is there any way to get around this situation, or am I better off creating different methods for each case statement?

Cheers-
Joshua
Say I need to add some new methods for java.util.Date. Which of the below are better options

1. Subclass Date and provide additional behaviors in the subclass
2. Decorate the date objects with wrapper
3. Add utility DateUtil and provide additional behaviors.

What I feel is that using wrapper would result in too much of delegated methods and subclass would be the best option.
Need an opinion if my assumption is correct

Cheers-
Joshua

Hi All

I have the below code in a JSP


As part of moving this to JSTL, is there a better apporach than below?

14 years ago
JSP