пятница, 21 февраля 2014 г.

Initial contents of jet framework

I have many candidates for inclusion into "foundation framework" but I need to round up initial stage of development and start using the library. So the most necessary facilities are:
1. Configuration;
2. Exceptions;
3. Logging;
4. Application initalization;
5. Singleton registry;

Whenever it's possible I will use existing solutions/libraries.
I couldn't find suitable configuraton library, so I implemented it by myself. In fact boost::property_tree is almost ideal for this purpose but it has some issues so I wrapped it in jet::config library.
Chained exceptions are not popular in C++ but I think they are esential for simple error diagnostics so I created jet::exception with chaining. I will also implement backtrace taken at the point where the first jet::exception in a chain was raised.
In the above list the logger is the most complex component. I compared several available log libraries and I found that it's very hard to choose despite the fact that logger is required in many applications and it should be very well developed area. One thing that I know for sure - it's impossible to use one logger for all cases. So maybe I have to split this task into two and use "general purpose logger" and "high performance tracer".
By "application initialisation" I mean that there are many questions that are not decided by traditional function main(), e.g. how to integrate application with its environment, that is command line, environment variables, configuration, etc... How to start application; how to properly destroy it. Of course all this tasks can be done without any framework but doing this tedios coding again and again is just boring. There is promising boost::application library in stage of approval by boost community. I'm going to use it with integration with other facilities.
Pattern Singleton is considered to be broken by many. In fact Singleton is very useful in some cases and it's hard to replace it with something else. But "classical definition" of Singleton has to be reviewed and there is good attempt to do it in Singularity library. I like this library but it's not complete solution. I will implement "Singleton registry" on top of Singularity.


Комментариев нет:

Отправить комментарий