Samstag, 20. Oktober 2007

XML API's

The two most common XML API's are DOM and SAX. Now there is a third 'major' API evolving: StAX.


Concepts
Push - SAX
The API 'pushes' data to the application. The data is sequentially processed.
Pull - DOM
The API offers to 'pull' data out. Full random access to the data is available.


SAX uses a hierarchical event handler and DOM uses a nested iterators. Finally StAX uses a hierarchical iterator. So while SAX is very fast and efficient the API is a little bit difficult to use. You have to maintain  where you are in your document yourself on the other hand an iterator gives you a common control abstraction. In most cases you don't need access to the complete XML data tree but to a distinct subset and right here StAX fits in. 
So I think this illustrates pretty nicely that it's not only important to look at the 'speed' of your XML processing application but also about maintainability and extensibility. If it's really hard for you to implement your solution with SAX and performance is not a problem StAX  is a nice alternative.  
This is the first time where I realized what huge impact the design of an API has on code. Or to be more precise, on the actual result of what you had intended to code. 

Dienstag, 13. März 2007

Guice - Dependency Injection

Today this was released:
http://code.google.com/p/google-guice/
Minimizing dependencies in OOP projects sounds nice. Spring uses XML files for configuration while guice uses Java 5 Annotations. So far i only have experience with picocontainer and it's nice and simple to use.
further read

Freitag, 9. März 2007

trac(ing)

Today i stumbled across this:
http://trac.edgewall.org/
This seems like a really good idea for project management since it integrates a lot of features that do seem use full in that context like:  a wiki or timeline features.

Montag, 20. November 2006

Sorting algorithms

Wikipedia (as usual) has very nice material on this[1]. Here are also some[2][3] graphical representations of sorting algorithims.

EDIT 2010: found [4] this on topic, you never know when there is a new search algorithm appearing.  

[1]http://en.wikipedia.org/wiki/Sorting_algorithm
[2]http://www.cs.rit.edu/~atk/Java/Sorting/sorting.html
[3]http://cg.scs.carleton.ca/~morin/misc/sortalg/
[4]http://www.drmaciver.com/2010/01/understanding-timsort-1adaptive-mergesort/

Mittwoch, 25. Oktober 2006

Webservices - Ménage à trois

Here I want to write down a little reminder to myself about current Webservices techniques.

RPC - Remote Procedure Call
Uses XML encoded Data types for communication.


WSDL - Webservices
So this is powering all the SOA(P?!) Hype. I have only some limited experience with some WSDL Webservices build using .NET 1.0 / 2.0.
Visual Studio holds your hand very nicely (as expected) for simple stuff. But to deal with more complex and custom Objects it would be very interesting i guess. I tried a "quick" example to get a Java client to interact with a .NET Webservice and it failed miserably.


REST - Representational State Transfer
Usually it goes like this: You have some kind of data and then you think about API's, how to access or manipulate this data. REST turns things a little upside down. There is a well defined set of operations : GET, PUT, DELETE. The concept is focused on the interaction of state full resources.


It will be interesting to see how these will develop in the future.

Montag, 9. Oktober 2006

Java operating system

Beside the boot loader, which is written using assembly,  the whole system only uses java. Thats quite impressive.
news
wikipedia

Donnerstag, 5. Oktober 2006

Google Code Search

Recently I  found Google Code Search (via Labs) and its pretty amazing!
If you usually "google" for some code you end up on some blog, forum, mailing list or such. But It seems there are some (open source!)  repository's connected to GCS  and this is interesting because it allow you to look for specific API's or usage of the same. I was looking for some advanced JFace Viewer examples which provided custom column editing. The user interface of GCS is really nice and let you explore e.g. a complete SVN repository so you can find the you file with your desired snippet. Additionally it enables you  to see how the class containing your snippet is actually used with other classes.
In my opinion GCS is a very powerful tool which enables you to search for code from a very different perspective.