For a long time I have been meaning to add somesort of data abstraction layer to the NeuClear Ledger which is the core book entry library used in NeuClear Pay.
What I wanted from this primarily is to:
I liked the looks of Hibernate and OfBiz’s Entity Engine, but everytime I wanted to start integrate one of them, it became a nightmare of dependencies and unwanted xml configuration files.
So I came to the conclusion that I dont mind writing sql, for my purposes it’s actually quite simple. So I simply want something now where I can maintain my schema with a minimum of fuss.
Which is why I have now added my own lightweight Entity Engine. It is currently in CVS as part of NeuClear Commons
My idea is to generate Entities using a simple programatic interface that suits my purposes.
The following is an example schema:
EntityModel ledgerModel=new EntityModel("ledger",true);
ledgerModel.addTitle();
ledgerModel.addTimeStamp();
EntityModel bookModel=new EntityModel("book",true);
bookModel.addTitle();
bookModel.addTimeStamp();
EntityModel xactModel=new EntityModel("transaction",true);
xactModel.addComment();
xactModel.addValueTime();
xactModel.addReference(ledgerModel);
EntityModel entryModel=new EntityModel("entry",false);
entryModel.addMoney();
entryModel.addReference(bookModel);
entryModel.addReference(xactModel);
entryModel.create(connection);To create a table I simply instantiate a new EntityModel. The boolean field in the constructor allows me to pick one of two general primary key models that I use A large number or String URI. This model now contains the primary key and nothing more. I then simply add columns using the addXXX methods.
Several of these column methods define standard column names as well, such as id, comment, amount etc., to alleviate boring repetition.
Table relations are added by the addReference(org.neuclear.commons.sql.entities.EntityModel) method, which takes another EntityModel as a parameter.
Finally I just call the create(java.sql.Connection) method on one of the EntityModel’s which generates the table and any dependencies on the given JDBC Connection.
So the current status is development and unstable. I have the beginnings of an insert row method, which takes an object array. But to be honest, I dont see much point in that at the moment. I will do all inserts and selects manually for now.
Walking home from work today felt so good. The hot sun in my face, the blue sky, the gentle breeze. Summer time is definitely here now. In Panama, while we are just barely in the northern hemisphere, Summer is January to March, the non rainy season. Our rainy season (or winter) is so long and so wet that it really chears you up now when the sun is out, the same way that first sunny day in Spring time up north does.
On another similar note. While everyone up North is busy hoping for a white christmas, here people do the same about a dry christmas. The meterologists claim it will be sunny, or at least that it wont rain. Here is hoping.
Over the weekend I released several NeuClear modules. The API is pretty much stable at the moment and is ready for people to start working with.
NeuClear is an attempt at creating a new internet based clearing system (read payment system). It has its own PKI system NeuClear ID at its foundation and various other support packages.
The actual clearing system itself: NeuClear Pay will be released in a stable version within the next week or to.
The NeuClear ID system currently has support for adding user authentication to standard J2EE based web applications. There is also built in support for a whole bunch of digital signing applications within.
If a Swedish anti-Danish terrorist cell had wanted to get rid of Panama’s Danish community, they would have been successfull hitting Saturdays Danish julefrokost at an undisclosed location in the former canal zone.
Julefrokost is the Danish variant of the christmas party, which traditionally is sit down and with vasts amounts of traditional Danish food as well as vast amounts of Akvavit and beer.
The Danish community is growing here and our Danish Consul does a good job not only keeping us and Panama supplied in Danish food, but also in keeping the community close.
The shipping industry is obviously well represented in the community, but there are quite a few Danish engineers stationed here for various infrastructure projects, including the new bridge over the Canal.
Today or tomorrow I will be releasing NeuClear ID 0.8
which is a major milestone release for the NeuClear framework. The focus on this release has been on freezing and stabilizing the API. The next release will have its main focus on user tools.
If you are interested plese read the Busy Developers Guide to NeuClear ID, which includes a java executable to get you started creating your own ID’s.
Btw. Thanks to Java Memory Profiler for helping me find out why my original UberJar based java executable was dog slow. Basically UberJar is dog slow. I was wondering if there was some weird loop in the inititialization of the crypto classes. I am now using maven javaapp which is incredibly faster.
Basically its approach is not to create a new fancy assed class loader like UberJar’s Classworlds it simply unzips all of the dependencies and jars them up with your own code. Not elegant, but it works like a charm.
Eric was hit by the flu for a week and couldnt provide me with my morning java links. To make the matters worse JavaBlogs the unfiltered alternative has been down most of that time as well. ;-) I’ve been forced into unchartered territories such as Meercat and Java.net
Seriously, Eric I’m happy youre feeling better, just dont get the flu again, OK!
Update: Spoke to soon. Javablogs is back in action again.
Just saw Brad GNUbergs article on O’Reilly’s OnJava about P2PSockets
P2PSockets is a socket layer ontop of JXTA, Sun’s Open Source P2P infrastructure. What this means is that you can convert just about any TCP based application into a distributed P2P application, with very little work. I like it. The author has an example using Jetty and JSPWiki
Essentially all you have to do is add one line to log in to a JXTA Peer Group and then replace your Socket constructors with P2PSockets inerhited variants.
This is a very simple elegant approach. I have always had planned a JXTA based plumbing infrastructure for NeuClear somewhere around version 1.1, with this I should be able to get it implemented more arount 1.0. Thus decentrelizing it a lot quicker than I had originally hoped for.
Thomas Fischerman from Die Zeit one of Germany’s most respected papers flew down to visit us at out company VERAX a month or so ago.
He has been working on an article about CypherPunks which has now been published under the name Pirates of the 21st Century .
The mention of us and NeuClear is down towards the bottom. While I do unerstand most of it with my now very rusty school German, I hope to get someone to translate it at some point.
This begs the question, am I a Pirate? If so, cool. I do like Rum (as Thomas discovered late one night) and I have a beard! However while I am trying to shake some things in the world of trade and finance, I guess I prefer to think of NeuClear more as a 21st century version of Statia famous in the time of the Pirates of the Caribbean.
BTW. I am misquoted in the article as saying “If you want, you can construct a Cyber-currency, that is based on gold as a security. Or better yet on opium.”
I have to say before the DEA drop in on me, that I didnt actually say “better yet”. I quoted and old joke within the digital currency comunity about Digital Opium backed Bearer Certificates. I always thought it was originally from Bob Hettinga but it appears that the originater is Perry Metzger and not Bob nor me.
Also I in no way condone or agree with issuance of such instruments. At VERAX we are actually building a NeuClear based payment system, with anti moneylaundering funtionality built in, that performs way beyound the required facilities of the FATF and the patriot act. Panama where we are based have anti moneylaundering rules that are much more stringent than those in the US or Europe. They have had to make them stringent due to a very liberal attitude eariler.
Anyway while researching this I found Bob Hettingah and Vincent Moscaritolo’s classic
e$: Digital Commerce for the Rest of Us which is always an inspiration.