Foreword: Nanogear: The C++ Web Framework
Foreword: Nanogear: The C++ Web Framework
Foreword: Nanogear: The C++ Web Framework
Foreword
This document is about nanogear an under-development C++ Web Framework. Ideas in this document came after developing a web application in C++ called Kexi Web Forms.
Introducing Nanogear
It's a matter of fact. There are no modern, open source, easy to use C++ web development frameworks around (with the notable exception of Wt1 which is not a framework but rather a library, but it has different scopes than the ones presented in this document).
Architectural details
The framework should be designed as a set of loosely-coupled, independent and highly reusable components, so that it can be used outside the Web-side context. It should allow the creation of resource-oriented applications out-of-the-box with ease. The framework should contain the following essential modules:
REST API: RESTful applications are a simple and smart way to provide web services. The framework should provide a module representing all REST concepts (Resource, Representation, Connectors, etc). REST HTTP Implementation: Implementation of the REST API above using HTTP as transport protocol Server: The server which can be used to deploy REST-based applications. CLI Shell: A command-line driven interface to initialize a project and create all the needed boilerplate just like the other major web application frameworks DB Library: A rather simple database abstraction library using Table Gateway Pattern and Row Gateway Pattern (investigate Active Record Pattern2). Template Engine: An easy-to-use template engine with a not-so-complex language supporting conditionals, looping and STL containers traversing. Wt (Web toolkit) adapter: A set of adapter classes to ease the development of Wt-based applications. Easy deployment: Solutions to ease the deployment on etherogeneous environments. Integration with Ajax toolkits: Provide integration with most used Ajax toolkits.
These are some useful tools which can be implemented after the first release:
1 http://www.webtoolkit.eu/wt 2 http://en.wikipedia.org/wiki/Active_record_pattern
Provide complete, exhaustive API documentation Provide a reference manual and examples Come with a comprehensive unit testing suite (either using boost's facilities, CppUnit or Google's testing framework) Look like an extension of the STL (no Java style camelCase function names, etc) Provide programs licensed under the GPL 3 and libraries licensed under LGPL 3
Depend on Boost: Boost is a comprehensive collection of peer-reviewed library. It contains all the stuff needed to develop the framework, it has a pretty liberal and GPL-Compatible license and it has strict requirements over code style and correctness thus ensuring maximum portability and compiler compatibility. It acts just like an extension of the STL with no extraneous style or coding conventions.
Depend on Qt: despite being an excellent framework for creating desktop, graphical, applications it is not suitable for this purpose. It uses custom, STL-incompatible, data types everywhere, it's not transparently integrated with the STL and the Qt STL conversion functions add some unneeded overhead, thread safety is not guaranteed and it doesn't make use of exceptions. It makes massive use of on-the-fly machine-generated code (an example of this is the Signals/Slot mechanism and the helper code generated by moc) which is an unneeded complication.
Provide components licensed under BSD-style licenses, these licenses kill the open source philosophy. The LGPL ensures that the application can be used in commercial environments for free and ensures that every contribution is kept open and gets in the upstream project. Be dual licensed: while I'm not against dual-licensing, I personally prefer to release the code for free even for commercial environment. A source of incomes could be selling services or getting investments from other companies.
Document History
Friday, 5 September 2008: Fourth revision 26 August 2008: Third revision Friday, 22 August 2008: Second revision Saturday, 17 August 2008: First revision
Tuesday,