Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link

Carl Bradbury

Greenhorn
+ Follow
since Jul 24, 2003
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 Carl Bradbury

I'm trying to figure out the most elegant way to write a listener thread that constantly listens on a given Socket for incoming TCP/IP messages.

Each individual TCP/IP message is composed of 4 bytes followed an XML document. The first 4 bytes are an integer that tells how long the subsequent XML document is.

How would you write something that listens on a socket and can pick up and process a message like this?

What goes inside the while parentheses?


[ June 15, 2005: Message edited by: Carl Bradbury ]
16 years ago
Hi all,
I'm currrently working on a project in which we are pulling a set of value objects back from a data server and displaying the attributes of these objects in a JSP. The framework I am using is Struts 1.1.
The value object's attributes are mostly custom typesafe enums (see Effective Java, Bloch, p105) that Struts doesn't have a clue how to handle, as you'd expect.
Currently I am 'wrapping' the returned objects into a composite object that contains the returned value objects and provides me with accessor methods that convert the enums into Strings for displaying.
Although this is a quick and easy fix, does anyone have any suggestions on a more flexible approach? i.e. something that doesn't require me to write one wrapper class for each set of value objects returned. I've heard mention that a data dictionary might be useful, in which I map the contents of each value object within an XML file that defines the type of each field. I could then use a generic class to handle each object according to the definitions in the dictionary.
Can anyone point me to an example of this kind of solution?
18 years ago
BMP is also useful if you are using a non RDBMS data store like LDAP, for example, where a DAO is pretty essential.