User:Mjwitte/U++ Framework

Ultimate++ (U++) is a C++ cross-platform rapid application development framework that includes several libraries and a fully-featured integrated development environment (IDE), TheIDE. It is based on the C/C++ runtime; however, it is designed to be coded more like a scripting language, ensuring an increase in developer productivity.

History
Development of the U++ framework and toolset began in 1998 by authors Mirek Fídler, Koldo Ramirez, Tomáš Rylek, Daniel Kos, and Massimo Del Fedele. It has continued now for 17 years, with the latest stable release version released in March of 2015. Throughout the software development cycle, the authors and contributors used their own framework for other professional development to better analyze pitfalls or shortcomings. If they felt even a minor aspect of the framework could be improved upon, they "never hesitated to compromise [their] entire code-base." Because of their willingness to effect massive changes, the development process was slow but precise. After 17 years of development, U++ boasts that is a mature library with most interfaces fine-tuned to be optimal solutions. Though the framework appears to be in a solid state, the authors admit there is work to do in documentation and smoothing out the IDE.

Overview
The entire idea behind this framework is to enhance developer productivity by building on top of the already powerful and ubiquitous C/C++ runtime a layer that abstracts the more complicated aspects of application development, such as memory management and GUI design, and creates a simplified interface for working with these concepts.

Memory Management
The U++ interface binds objects to a logical scope, so once that object leaves its scope, U++ handles the destruction. The implication of this is a reduced need for the  and   operators. Raw pointers are still valid, but it is recommended to only use them to point to objects as opposed to managing resources. Because the framework manages the resources, it alleviates confusion regarding ownership of those resources. Smart pointers, like  are nonexistent in the U++ framework and their use is considered a bad practice.

Container Implementation
A common point of criticism for U++ is its overwhelming lack of the C++ standard library (STL) in its implementation. Their defense is that the STL's requirement that every container implement a copy-constructor is one that is difficult to use in GUI development. To solve this issue, U++ implements two general flavors of containers: vectors and arrays. The vector flavor is a container implementation for elements of a specific type, while the array flavor has no requirements for element types. The looser type restriction on the array flavor comes at a slight performance decrease.

GUI Widgets and Dialog Templates
A powerful consequence of the U++ memory management scheme is that widgets within the GUI are owned by client code as opposed to by the GUI itself. Because of this, the GUI neither creates nor destroys these widgets; it just references them. This implies that widgets are not created on the heap, and therefore do not require any cleanup after the GUI falls out of scope. So instead of struct MyDialog { Option *option; EditField *edit; Button *ok; };

we get

struct MyDialog { Option option; EditField edit; Button ok; };

Because the GUI only has references to the widgets, they persist beyond the creation or destruction of the GUI. Developers could reference the widgets within  even if   is closed or not yet open.

The GUI's themselves are defined by layout templates, which can be edited using TheIDE's Layout Designer. The Layout Designer will produce a C++ template that inherits from some other widget-based class complete with member variables and a matching function to spatially set up the GUI. An example template would look similar to:

template  struct WithMyDialogLayout : public T { Option option; EditField edit; Button ok; }; template  void InitLayout(WithMyDialogLayout *layout, ...); // implementation details omitted

The advantages here are that any widget type can act as a base class and the developer no longer needs to interact with widget IDs or names; they can simply interact with the instance variables.

Value and Null, Display and Convert
U++ defines a polymorphic Value type that can hold the values of any basic types and be queried for that type or value. The default "empty value" is Null, which is also defined for primitive types. This allows for a greater range of behaviors when working with primitive types. It also simplifies common operations on GUI windows, such as clearing widget values, which is as simple as setting all widget Values to Null.

Display and Convert based classes act as a way to extend the behavior of Value. Convert classes perform a bidirectional convert from one Value type to another. Commonly, this conversion takes the form of a logical Value type to it's textual representation. Display classes can be used to define how Values are to be displayed in the widget.

Callbacks
The framework utilizes function-pointer-like entities called Callbacks to define actions that should be performed after some sort of interaction with a widget. The developer simply needs to define the function that should be called when an interaction occurs and associate that function with a widget in the GUI. These functions are completely decoupled from classes; they are free to exist by themselves and can be invoked without constructing any owning class. This example defines a callback for switching the value of the input field to one or two depending on the button pressed. void MyDlg::SetEditorValue(int x) { editor <<= x; } MyDlg::MyDlg {   button1 <<= THISBACK1(SetEditorValue, 1); button2 <<= THISBACK1(SetEditorValue, 2);

SQL Programming
Another powerful feature of the U++ framework is its ability to interact with SQL databases effortlessly. The syntax for SQL expressions allows the developer to build them up like function calls: Select(NAME, SURNAME).From(PERSON).Where(PERSONID == personid); Where  is any arbitrary C++ variable. Because each piece of the SQL statement is more or less independent from the others, the subexpressions that make up the whole can be built up independently as such: SqlBool where; if(!IsNull(findname)) where = NAME == findname; if(!IsNull(findsurname)) where = where && SURNAME == findsurname; SqlExp exp = Select(PERSONID).From(PERSON).Where(where); Execution of SQL statements is taken care of through the Sql cursor object and an overloaded  operator: Sql sql; sql * exp; while(sql.Fetch) { Sql sqlu; sqlu * Update(PERSON)(SALARY, SALARY + 100).Where(PERSONID == sql[0]) }

Use
The framework is a powerful library for developers to use to rapidly build GUI implementations in C++. Its wide array of features beyond just the GUI side, such as efficient interaction with SQL databases makes it a viable alternative to the standard C++ libraries for building large-scale applications. Its ease of use, coupled with automatic resource management and TheIDE, brings great value to teams who use the Agile methodology and need to get a working product built quickly.

IDIS
A large municipal agenda system developed on for 9 years which uses more than 20 U++/Oracle client/server applications.

WebMap
An integrated desktop GIS/map server system. Contains a built-in editor used to create map presentations, charts, and descriptive web pages.

WinZPV
An information system used by the Czech Hydrological Institute to take river water measurements and any additional information used to analyze the river ecosystem.

Hydrocheck
An application used to analyze river flow.

Natural3D
A 3D engine and associated toolset.

TheIDE
TheIDE itself was created using the U++ framework.

Reception
The framework and IDE are free for use under the BSD license and have been downloaded from SourceForge almost 300,000 times since the framework was registered in 2003. It has a sterling 5.0 star average review on SourceForge. Developers appreciate its ease of use, snappy IDE performance, and, at just 44.5 MB, it's relatively lightweight memory footprint.

Competition
The framework itself is eclipsed by the ubiquity of its competitors, such as Microsoft Foundation Class Library (MFC) and Qt. This might be due, in part, to its being developed outside of the United States. There are stark differences between U++ and its competitors in that Qt is strictly for GUI development; it does not extend past the view of the application where U++ has full SQL integration and can reach as low as the model layer of the software. Qt and MFC are not designed for rapid development either, whereas U++ is specifically designed to get at least a presentable product quickly. Ultimately, because of U++'s lack of professional corporate support, it is rarely chosen as an alternative to the larger powerhouse GUI frameworks.