Our blog. We live and breathe this stuff. Here we write musings on the subjects that matter.
Wed 16th September 2009
Welcome to my little weekend project, two weekends so far and may not be many more. We will see.
The problem I was trying to solve:
The testers are my current contract are being required to test webServices and web services that have lots of information passed in as a object model.
The testers are not coders andThese testers are not coders and do not like xml so I wanted a simple and easy way of them being able to write to a values to a text file and for me to turn this into .net objects to send to the web service. Once I have the reply back from the the WebService I want to be able to put the response into the same format.
As these are webservices exposing already present business logic the pace of adding webserives is quick. trying to catch up with the 40 or so complex methods that are all ready being used. So I don't want to have to hand crank pretty print and parse for each of these messages and all the classes that are getting passed back and forth. After a conversation with the testers they are happy with a dot seperated text file e.g.
Example.Foo.Bar.RequestDate=2008-09-15 23:18:00 Example.Foo.Bar.NumberOfFish=12 Example.Foo.Bar.NameOfPet=George
Which reads as a programmer would read a dotty semi colon langauge (c++, java, c#) ordered age before beauty).
For each message I will hand crank the first example so I do allow my self lines of nonsense which the users can ignore . e.g.
A line with a colon in it is a type declaration and could read
Example.Foo.Barr = new uk.co.kakariki.ExampleClass();
Now this is not a complete serilizer nor do I intend it to ever be, but it should be good enough for the job at hand, useful enough to be a tool in the toolbox and complex enough not to write it many times.
Given an object graph of simple objects we will traverse serialize and print the entire graph, then we will reverse the process and be able to recreate an equivalent object graph.
There will be more limitations then this.
All of these limitation are fixable with a little codding effort, but as they are not need for my current task and I'm a little short of project time I will declare this good enough for my current purpose. I fI ever need it do address more of these cases i should be easy work to extend it.
The code is up on sourceforge as project name kakarikiserz
Have a happy day and drop me a note if you found this interesting or are using