Chandramouli Ram

Ranch Hand
+ Follow
since Mar 07, 2005
Merit badge: grant badges
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 Chandramouli Ram

Thank you Joe & Rob.

I'll try out what you suggested.
13 years ago
Is it possible to know - by any means- that an object is currently being serialized, may be by adding some print statements in getters etc?
13 years ago
Congrats Ben.
Good score , Great job

Originally posted by ankur rathi:


I am confused now. What's that made you say No.



As originally mentioned, my statements are based on Cade & Roberts' book. If you or Kishore feel otherwise, you can quote your references or put forth facts that substantiate what you guys say.
Also, I believe this discussion is about layered application architecture. And, merely layering the application can not certainly provide the whole list of niceties.
[ October 03, 2007: Message edited by: Chandramouli Ram ]

Originally posted by ankur rathi:


... and isn't layered architecture is Multi-tier architecture???



Yes it is!
You said it!

Originally posted by AnaB SuarezF:
you just make some assumptions and specify your assumptions cleary on your solution

Thanks very much in advance!
Ana.

Originally posted by ankur rathi:
One conclusion:

Everything (scalability, availability, reliability, maintainability, extensibility, security, performance) increases with the number of tier in an architecture except manageability.

Is it correct?



Hi Ankur,

A simple answer to your question IMHO is NO. You may read the first chapter from Sun Certified Enterprise Architect for J2EE Technology Study Guide
by Mark Cade, Simon Roberts - to get a better idea what all these terms really mean and how they relate to each other. It says that maintainability and extensibility can be enhanced by low coupling, interfaces, modularity, which is something a layered architecture can provide.

Originally posted by adam lui:


(it will throw NullPointerException but i just want it to compile)


I am not sure what you intend to do, but here are some points to ponder:

1. Your method has to return a List<E>, while it doesn't return anything.
2. If I presume that you return "output", it isn't valid if someone calls this program with say a List of Long. Though your method is recursive, it's also public and hence you must take into account all possible inputs.

Alternatively, you may make your code more specific, to make it compile:

Originally posted by Nitesh Kant:

I dont know, from where it found the magic figure of 2 though
All over, without a context, this code looks a little strange to me to say the least. Having said that, i think this code will be a result of *some* analysis.



Thanks again for your response Nitesh.

The context - while does not clarify the code intricacy that's being discussed- is (as mentioned in my first post): com.sun.grizzly.filter.ReadFilter.
Probably 2 consequent read of "zero" bytes is sufficient to quit the loop!
15 years ago

Originally posted by Nitesh Kant:
Hey i dont have any idea about the Grizzly framework. But most probably the code here is trying to handle a scenario, where select has returned a channel that either is not ready for a read(this should not be the case if the interest set entry is correct for this channel) or the data has been read and processed by some other worker. I am not sure whether this is the correct way of handling. I can understand this logic, if there is a delay between the instant Selector.select() returns and the channel is ready to read, but i dont think that is the case. Selector.select() assures that the channel will be ready to perform an operation for which an interest has been registered.



Thanks for your response Nitesh. While this code is extracted from grizzly, the logic is entirely NIO based.
The interest options are set appropriately, channel is ready for reading.
The code:
count = socketChannel.read(byteBuffer)

reads the input on this channel into the byteBuffer, returning the number of bytes read. This returns -1 if the channel has reached end-of-stream. Based on the code I provided earlier, the while loop breaks if count becomes zero twice. This is what I am trying to understand.
15 years ago

Originally posted by Elisabet Guldbrandsen:
Hi, a question re the component diagram:

Do I include the factories in it? Such as service locators etc. - they tends to clutter the diagram, especially with all associations drawn.


As component diagrams really represent a very high level of abstraction, they should not exhibit clutter - and your concern is very valid. On the same count, there should not be too many associations - may be you need to focus on the level of abstraction for the list of associations you want to show. As Cade & Simon's book has been the bible, I would suggest you go by that.

Alternatively, you may add supplementary diagrams to move the low-level associations out of your main diagram.
[ September 13, 2007: Message edited by: Chandramouli Ram ]
Hi,
I am reading throgh the Grizzly framework that uses NIO, and I have difficulty understanding the following code snippet extracted from:
com.sun.grizzly.filter.ReadFilter


While the code works just fine, why does it require the loop variable to be >2 to break the while loop?
15 years ago
Hi,

In the code you provided, the equals and hashCode method are not invoked as the Set you constructed is composed using String objects. Hence, only the String object's equals, hashCode methods would be invoked.

To illustrate the effect of your local equals and hashCode, you may create instances of the class that holds this code and then replace Strings everywhere in your code with this new class. You may optionally add print statements in equals and hashCode to verify that these methods are indeed invoked.
Thanks Marc, for correcting me and proving the concept with a nice piece of code.
Just one object, I believe.
int[][] array is an array of array objects and this statement just creates an array object that can refer to 2 int[] objects. Only when you do:
int array[0] = new int[2];
int array[1] = new int[2]; etc,

will the other objects be created. So, the max would be three objects-considering the fact that the elements are primitives.