Follow up to my post about JAXB, BEA just released a beta version of XMLBeans, which, in marketing speak “.. is the first solution that successfully merges the power of the XML API approach with the simplicity of the XML marshalling approach to provide unprecedented levels of both robustness and ease-of-use.“
All posts by ajohnson
Google and innovation
Rael quotes a Fast Company article on google and innovation.
Reminds me of a quote I saw in Wired years ago by Thomas Watson that went something like this: “The fastest way to succeed is to double your failure rate.” (exact quote here)
SXSW festival by Heath
Heath Row blogged the SXSW festival. If you didn’t get to go, it looks like Heath has typed up every word spoken during the entire shindig. Especially interesting was his write up of Richard Stallman‘s discussion: “Copyright Vs. Community in the Age of the Computer Networks“.
“ In 1983, I reached the conclusion that for people to use computers freely, they needed to have access to free software and be able to use it freely. You should have the freedom to use software once you’ve got a copy. There are three freedoms. Freedom 0 is the freedom to run the program. Freedom 1 is the freedom to help yourself by studying the program and changing it to suit your needs. Freedom 2 is the freedom to help your neighbor by giving them a copy of the software. Freedom 3 is the freedom to help build your community by working together to build that software.“
Why the Web Matters
David Weinberger gave the opening presentation at SXSW a couple weeks ago, I didn’t get to go but I got the jist of his presentation via his email newsletter (which was packed w/ interesting btw, sign up now!). He called it “Why the Web Matters”:
“I have 10 times as many friends as I used to. I know 100 times more people. I have 1,000 times more people I can call upon for help, support or a well-deserved kick in the ass.
My friendships last longer. I’m still in touch with people I worked with in the ’80s even though
in the real world, I forget relationships the way I flick crumbs off a table.
Not only is there a gazillion times more information available, we expect the chain of information never to end. Whatever the topic, we expect to be able to browse indefinitely.
Every conceivable topic has its own site and its own cluster of people around it.
If I don’t trust the voice of authority, all I have to do is turn my head a quarter turn to hear the voices of those whose stories that voice is re-telling.
Our kids take it for granted that they can publish to the entire world without first having to get their writing accepted by a publisher.
Everyday I receive email from people I’ve never met pointing out amazing, funny, heart-breaking and sometimes merely amusing sites.
Those who we know by reputation are no longer inaccessible on their own private Olympus. It’s likely we can find their email address. And when we write, we may well get an answer.
The largest network of human creativity and history’s best operating system have both been created by distributed networks of people who never once have sat in on a weekly status meeting about the projects.
We are learning that the world consists of people joined by shared interests rather than simply countries divided by patrolled borders.“
re: The conversational enterprise
John writes that “… blogging is almost recreational — it’s hard to point to a solid return-on-investment for the time.” I don’t work at a large enterprise so I can’t comment on ROI at the business level, but personally, blogging is great way of saving and then reusing the knowledge you gain on a daily basis (how to use rsync, getting servlets to reload…). How many times do you think to yourself “I remember doing that once, but where did I write it down?” I used to use Outlook for this, but searching your Outlook hierarchy is excruciatingly s l o w. If you have a blog, you probably wrote about it in your blog, which you can then use full text searching to retrieve in a matter of seconds. I can get my job done faster. That’s ROI. Course, the same thing applies to people that I work with. I’ll get an email from someone about JSP Coding Standards and I can point them here because I remember writing about it. Other people get their job done faster.
Bluetooth-Controlled Micro Robot
Seiko Epson Develops Power-Saving, Bluetooth-Controlled Micro Robot in Palmtop Size [gizmodo.com]
XML to CFC Mapping Tool?
Ray asked during our developer meeting today if .NET had any tools like JAXB. The Soapsuds Tool looks to be similar, although it certainly doesn’t appear to have as many features. But I think Ray was asking the wrong question. A CFC is approximately equal to a JavaBean in structure, so where JAXB for ColdFusion? Who’s creating a CFC generation tool? CFCZone.org would be the reasonable place to start but they’re still in startup mode (ie: no content). XML parsing is certainly easier in CF than it is in Java, so maybe it’s a moot point, but nonetheless it could be helpful to have a XML to CFC generator.
JAXB
Thursday, developer meeting day at MINDSEYE. We all put our feet up on the conference table, sip on a Mike’s or a Guinness and ‘interface’. Today Maia did an impromptu presentation on JAXB, a Java technology from Sun “…automates the mapping between XML documents and Java objects.” Sounds pretty boring doesn’t it? Stop reading then.
So I’ve written a couple apps that use Java and alot of applications that use XML. IMNSHO, the most tedious programming I’ve ever done is the work I’ve done parsing, validating, and hacking at XML. XML is a boon to developers, but who really wants to write ‘lElements.item(0).text’ over and over again? Not many people I know. Anyway, JAXB. JAXB takes the tedium out of using XML and for that reason alone is a great tool. In short, you use JAXB to:
- unmarshal XML content into a Java representation
- access, update and validate the Java representation against schema constraint
- marshal the Java representation of the XML content into XML content
In non-geek, that means that you can hand an XML document to a Java system that uses JAXB, the developer writes about 3 lines of code to transform that XML document into a Java object, the developer can then pass that Java object around in his or her system, and then at some point in time easily transform that Java object back into XML. No messing with childNode() or GetElementsByTagName(). Beautiful. But it gets better. JAXB creates Java objects for you that represent the XML document you pass in. These Java objects are created by JAXB with accessor methods so that you can modify the contents of the XML document…without knowing any XML syntax. So if you had an xml document that looked like this:
<?xml version=”1.0″?>
<application>
<caching bCache=”false” objectttl=”0″>
</application>
you’d get a Java class called ‘caching’ with getters and setters for the bCache and objectttl properties. You could pass in the above XML document and modify the settings in 5 lines of code (pseudo code, not tested or compiled, use at your own risk):
JAXBContext jc = JAXBContext.newInstance( “primer.po” );
Unmarshaller u = jc.createUnmarshaller();
caching c = (caching)u.unmarshal( new FileInputStream( “config.xml” ) );
c.setBCache=”true”;
c.setObjectttl=”36000″;
not so bad is it? For the sake of getting you hooked, I neglected to mention the fact that for every type of XML document that you want to use, you first have to create an XML Schema Document, but hey, you’re lazy right? That’s what makes you a good programmer.
Related links:
Binding XML Schema to Java Classes with JAXB: java.sun.com tutorial
JAXB FAQ: [link]
The JAXB API: [xml.com article]
JAXB Mailing List [java.sun.com]
Developing with JAXB and Ant: [onjava.com]
Generate XML Mapping Code with JAXB: [devx.com]
Brett McLaughlin on JAXB: [newinstance.com], note: adding Brett to blogroll. Brett wrote Java & XML: Solutions to Real-World Problems, Building Java Enterprise Applications Vol. II: Web Applications, and Java and XML Data Binding.
Emerging Technology: Who Loves Ya, Baby?
Steven Johnson’s latest article is online @ discover.com: Emerging Technology: Who Loves Ya, Baby?
His thesis is based on Cat’s Cradle, which “… explains how the world is divided into two types of social organizations: the karass and the granfalloon.” I was thinking on the way home tonight how the exposure of massive amounts structured data via xml (web services, rss, xml-rpc…) will make it exponentially easier to create applications like the InFlow software mentioned in the article. Allconsuming.net is one great example of that. Erik Benson gets information from weblogs.com, pings amazon’s web service and voila, we have a social book circle. While I’m sure the availability of this information worries privacy advocates, you can’t help be get excited about the possibilities that lie ahead of us.
Cronlog
IIS makes it really easy to maintain your log files… in fact, you don’t have to do anything tricky besides checking the appropriate checkbox. Apache on the other hand is a bit more complicated… I did a couple googles tonight looking for the perfect, easy 5 minute solution. This is what I found. Download the source, unzip, run ./configure, run make, run make install and then change your log settings within the appropriate context of your httpd.conf (I put the following directive within each virtual host definition) to something like this:
CustomLog “|/usr/local/sbin/cronolog /etc/httpd/logs/yoursite.com/%Y%m.log” combined
Save httpd.conf and restart Apache.
That’ll create a log file that looks like this:
/etc/httpd/logs/yoursite.com/200303.log
Pretty handy.