"The day Microsoft makes something that doesn't suck is probably the day they start making vacuum cleaners." -Ernst Jan Plugge
[found here - a useful page in its own right]
[found here - a useful page in its own right]
I mean, it is already the sad state of the typical American worker mentality that so many see Friday as a kind of Elysian Field , a reward for surviving the rigors of the work-week. I find that "work for the weekend" attitude very revealing and pretty pathetic; it says a lot about the typical worker's attitude towards his job, satisfaction with his work, and the typical company's treatment of employees, that so many people are so focused on the nearing reprieve (Friday) instead of on what they can accomplish during the week. So when I see Friday accentuated as a partial release of our workplace burdens (in the form of a relaxed dress policy), I can't help but think it is just reinforcing the "work for the weekend" attitude: "I can't wait until the weekend so much that getting to wear casual clothes on Friday is a big deal."
Thus, I wonder why companies don't use the carrot of Designated Casual Dress to entice workers to look forward to Monday or even Wednesday. Who among us does not regularly loathe Mondays, dreading the return to the drudgery of the work week? Alternatively, how far would Casual Wednesday go towards wiping out the thought of Wednesday as Hump Day ? If employers offered Casual Monday (or Wednesday), would that not make those otherwise barely tolerable days that much more palatable?
Imagine waking up on Monday morning and being able to slip into those old comfy jeans and tee-shirt. Doesn't that make Monday at least a little better? Wouldn't that help fend off those draining attacks of Mondayitis ? I think it would.
It's been inevitable for quite a while now, and this week Sun finally officially announced the open-source plan for Java. Let me take this opportunity to log my personal reaction to this "long time coming" news:
Yaaaaaaaawwwwwn
As far as I saw, the only people who complained about Java not being "open" were the frothing-at-the-mouth FOSS zealots (OK, I'm going to get some flames for that word choice - but I have a soft spot for the overly-dramatic, so it will stay).
Let's be honest: the critical parts of Java, the libraries and reference implementations and compatibility test kits, have been source-available from the beginning. I just don't see a lot of people caring that the JVM and compiler are open now.
Actually, now that I think about it, I take back the yawn. I am very interested, because I'm now concerned that Sun does not have enough influence any more to keep Java from fracturing. We have to hope that the community can restrain itself to keep that from happening - but I would not bet on that. Maybe some other big players like IBM will be able to police the renegades who want this or that little thing and, when they can't convince the rest of the community, go off and create MyJava.
The last thing Java needs right now is to become the next Linux, where binaries aren't compatible and users of one distro can barely find standard file locations on other distros.
Julian is 4 and 1/2 months now, and September was quite a busy month for him.
There were road trips:
He also had his first adventures into the swimming pool. He was skeptical at first but seemed to enjoy it after a while.
Last night he spent his first night away from Mom and Dad - Poppy and Nonni (Jerry and Marilynn) had babysitting duties for the night. We were lonely and wondered how he'd handle himself, but the report came back great.
There's lots of new pictures from September at http://www.rizzoweb.com/photos/Julian (including the road trips to Miami and Sanibel).
We have also uploaded all his photos to Walgreens web site so you can order prints and pick them up at any Walgreens store: click here to see them . You will have to create a free account at the Walgreens website in order to see them and order prints. Email us if you have any trouble.
Enjoy,
Eric and Jazmine
"Our company is interested in exposing some of our server java api as web services. 2 years ago that would have probably meant introducing an ejb framework and wrapping those as web services. I would be interested in hearing other approaches. Any ideas?"The first question to ask is whether you're interested in going down the WS-* path or the "Web 2.0" path. In other words, are you interested in being WS-Heavy or WS-Lite? (see http://weblog.infoworld.com/udell/2005/09/21.html and the links from that page).
public Map<String, List<String>> readFromSteam(InputStream is)
throws IOException, ClassNotFoundException {
ObjectInputStream ois = new ObjectInputStream(is);
Map<?, ?> currentLists = (Map<?, ?>) ois.readObject();
return this.copyToNewMap(currentLists);
}
private Map<String, List<String>> copyToNewMap(Map<?, ?> oldLists) {
Map<String, List<String>> newLists = new HashMap<String,
List<String>>();
for (Entry<?, ?> each : oldLists.entrySet()) {
String key = (String) each.getKey();
List<?> oldList = (List<?>) each.getValue();
List<String> value = this.copyToNewList(oldList);
newLists.put(key, value);
}
return newLists;
}
private List<String> copyToNewList(List<?> oldList) {
List<String> newList = new LinkedList<String>();
for (Object each : oldList) {
newList.add((String) each);
}
return newList;
}
Rob Diana recently wrote about Exceptions and APIs, some thoughts stemming from a thread on Test Driven Development he read. On the StraightTalking-Java mailing list this spawned a lengthy discussion about the usage of exceptions, when they should be internally handled vs. thrown (possibly wrapped). My thoughts on the subject are a bit more general, but still worth mentioning (especialy since I'm trying to utilize this blog on a more consistent basis, and this seemed like a good way to start - again...)
Any object or set of cohesive objects (in some cases, an API) should only throw exceptions that are at the same level of abstraction as the interface to the object(s)/API.
IOW, the abstraction level of the object's interface must be consistent - that is not negotiable - and the thrown exceptions are part of the interface. Thus, the exceptions must match the abstraction of the rest of the interface (parameter types, return types, etc.)
If we follow this rule (it is more than a guideline, IMO) the decision about what kinds of exceptions to throw becomes easy in 99% cases. An app's persistence layer does not throw JDBC errors or hibernate errors, because those are implementation details of that layer - it is written at a "higher" level of abstraction. However, it can reasonably trap those kinds of errors and perform whatever reasonable action the developer chooses (which might include, for example, retrying the operation an extra time), most of the time wrapping the underlying error and throwing some exception that matches it's interface.
Same for a "business logic" layer - it talks in terms like CustomerAccount, Product, BillingCycle - so it can also use notions like CustomerNotFoundException, ProductDiscontinuedException, and BillingCyclePassedException (if the designer so chooses). It would not, however, use notions like SQLException, IOException, EJBException, etc. Those are implementation details - you would not want to change your whole interface just because the implementation changed from using straight JDBC to something else, for example.
I'm surprised there would be any debate about this. APIs (or any objects/set of cohesive objects) are certainly capable of handling some kinds of errors internally, but many times the context of the call is best able to know what to do.