Post
Topic
Board Announcements (Altcoins)
Re: NXT :: descendant of Bitcoin - Updated Information
by
FrictionlessCoin
on 20/02/2014, 11:24:58 UTC
Will the interfaces for the major components (Account, Transaction, Peer etc..) stay roughly the same?
Also the listener interfaces, will they remain?
Some of them. There are two big changes. First, Nxt is no longer a servlet and does not need to follow the servlet init/destroy lifecycle anymore. It is initialized reading its properties from nxt.properties instead of web.xml. If needed, it will start a PeerServlet that accepts peer-to-peer requests, an APIServlet that serves http/json API requests, and a UserServlet that supports the current NRS javascript client. You can disable all of those in the properties file, so if you are only using the Java API, and don't have a public IP on which to accept incoming peer requests, you will not be running any servlets at all.

Second, I am making Block, Transaction, and Blockchain, interfaces. The current Blockchain class is a bunch of static methods, I am splitting those into BlockchainProcessor, TransactionProcessor, and Blockchain/BlockchainImpl classes. All those will be singletons instead of collections of static methods, which I believe is more flexible in the long term.

Peer has also been split into Peer (an interface), PeerImpl (package-local implementation), and Peers (static methods that handle the whole set of peers).

Account, Asset, Order, Alias, etc, will not change for now. In the future I will have to move them to the database, so I don't want to waste time refactoring them now only to change them again later.

I will try to keep the Listener interfaces, and see how I can use them to accommodate your request for monitoring the initialization steps too.


Finally some sanity on the codebase.   The original code base you couldn't make head or tails as to which request handled the client and which one handled the protocol.  

Finally removing all those static methods.  Hopefully you remove all those static variables too!  

Anyway,  I've seen the 0.7 code and I have to say that you've made good progress from the original horrible code.  

BTW, when will you folks release the source code?