ramesh maredu

Ranch Hand
+ Follow
since Mar 15, 2008
Merit badge: grant badges
For More
Bangalore India.
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by ramesh maredu

Hi Joe,

we don't want to have customer id in either session or cookies.

Thanks,
Ramesh.
12 years ago
Hi,

We have a application developed in struts 1.x, we are not using AJAX to POST/GET data from server, earlier this UI was serving data for only one customer, now we are updating our server to provide data for all customers based on 'customer id' ,now 'customer id' has to be passed in all requests to server and we need to achieve with minimal changes, is there any smart way to add 'customer id' in all requests to server.

Thanks,
Ramesh.
12 years ago
Currently we have web application built using struts 2, when user enters his credentials we fetch user information save it in session for further reference. Here cookies are used for session management, to continue using the same without any changes, cookie has to be set in mobile app every time when they invoke struts2 API which returns JSON response.

Well actual idea is to use RESTful API rather invoking web URL directly to get the response in JSON format, so same API can be used by web UI and mobile app, to check for API invoker identity I thought of using API key which is a UUID generated from his username and password.
12 years ago
Hi All,

Currently we have a web application, we want to extend the same for mobile, so we are planning to use a token to validate users to access API's, what is the best way to do it, I thought of using UUID generated based on user name, is it the right approach, how about using Oauth, could someone suggest.

Thanks,
Ramesh
12 years ago
Hi Vivek,

Welcome to java ranch.

I think the compiler treats the exceptions differently when they extend Exception directly. As the checked exceptions are meant to be handled you will be forced to catch them or let the caller method handle them. In case of run time exceptions then compiler don't enforce any rule because they are not meant to be handled (probably user may not be able to do anything if they occur, the better way would be make sure run time exceptions may not occur).
I read it long back,if I am correct, the book is comparing between inheritance and composition.

When you extend a class and make a subclass then you get the behavior of super class and the behavior is static (you can not change the behavior at runtime). But if you compose then the behavior you get with composed reference could be dynamic.







Hi,

In our application we use json to carry data from server, ajax calls are made using jquery, the json response is used to construct html dynamically.

The rendering logic varies according to attributes in json response, for example



I would like to know is there any elegant way there, not to hard code in java script, I mean can I read values 1 and 2 dynamically and use them in comparison.
Anyone knew about programming competitions happens online, where I can register and participate in same.

Thanks,
Ramesh.
13 years ago
A and B has their own and separate methodA(), the method in B is redefined, you are seeing out "in B" because you are calling methodA() in class B.

b.methodA() and B.methodA() both produces same output as after compilation reference would be replace with class name for static methods.
Because it is static method, overriding doesn't take place, when you say a.doStuff(), because doStuff() is static method compiler replaces reference with class name, so here after compiling code will be A.doStuff(), so it invokes A version of doStuff().
Your question is not clear, is it something related to SCJP first??
13 years ago
I think you are expecting to overriding take place and produce different output, remember overriding is applicable to "objects", static methods are class level.
I assume you are saying, why not have some utility classes rather than inheritance in place,so that when ever you need to use the same common code, you can invoke the utility method.

If we use inheritance we can take advantage of polymorphism, if we have common code in utility classes, we can not take advantage of polymorphism and how about inheriting the state, how do we do that if we don't have inheritance.

I read in an article that

facebook uses hiphop to convert PHP code to C++ code, to gain performance as scripting languages are slow



I searched in web to find out why scripting languages are slow compare to programming languages, I could not get convincing answer, could anyone explain?
13 years ago
I faced this interesting question in an interview.
We have several packages in java like lang, io etc, but why util package is called as framework (collection framework)?
13 years ago