New JavaScript framework released: DAAJS

    The other day, the first release of the new promising open source JavaScript framework “DAAJS” was released. It may be of interest to front-end developers as a basis for creating web and mobile applications.



    The ideology of the framework is based on class-oriented and event-driven approaches. All functionality is implemented as classes. Presentation classes based on templates and algorithms generate user interface components and encapsulate directly related behavior (such as expanding branches of tree lists, expanding menu items, moving items, etc.). The event mechanism serves to organize both user interaction with interfaces - at the class level, and not individual DOM elements - and to implement complex behavior that requires the participation of many methods or other classes. Any events inside the framework are presented in a single, unified format.

    The framework implements its own class model that supports multiple inheritance and other interesting technological and syntactic mechanisms. The framework classes are platform independent and can equally well be executed both on the client side, in the browser, and on the server side under Node.js. That, in the future development of Node.js and its support by hosters as a server platform, opens up the possibility of using the same code for the client and server parts of projects. In addition, the code of DAAJS classes, using a minimum of JavaScript-specific features and "tricks", is quite easily displayed in the programming languages ​​that currently prevail as back-end development tools.

    The framework offers a standard for describing user interfaces based on JSON, natively understood JavaScript and no less easily understood by other software tools. This allows you to use the same descriptors to generate HTML on the server and on the client - as well as for dynamically rebuilding interfaces in AJAX and SPA projects. Descriptors are tree-like lists of presentation classes with parameters that allow you to customize the final views in a wide range, including, of course, binding to data models and specialized event handlers. In addition, the framework supports its own simple “JSON markup language” (DAA-script), which provides “syntactic sugar” for creating complex structured JSON descriptors.

    DAAJS is an MVC framework and, in addition to tools for working with presentations and events, provides a number of tools and patterns for working with data models. Unlike a number of other frameworks, DAAJS offers the use of a single model space and access to models using direct addressing (the "paths" interface) and an SQL-like query language, which allows in a sense to identify this model space with its own mini database on the client to the “living” side, however, only as long as the user remains on the web page. Moreover, this space includes not only models of the final displayed data, but also models of the interfaces themselves obtained from JSON descriptors. This is especially useful for Single Page Applications, but it can be widely used in multi-page projects,

    DAAJS also paid much attention to working with complex structured models, mainly with “trees” and “tree tables”. The framework tools allow you to add, insert, delete, move tree elements, sort the “tables” by many fields using, again, SQL-like syntax. DAAJS approach is aimed at the maximum unification of work with models between the server and client sides.

    The ideology of building interfaces using presentation classes and unifying descriptors involves the widespread use and flexible customization of CSS. To achieve unification, DAAJS implements the “Runtime CSS auto-prefixing” mechanism, in other words, based on CSS declarations that comply with CSS standards, it automatically selects working properties and values ​​“with vendor prefixes” if the current browser does not support standard CSS properties directly. This mechanism allows you to assign DOM elements “inline” CSS properties, and define and redefine CSS rules “on the fly”, without worrying about problems with supporting properties by browsers (unless, of course, we are talking about completely ancient instances).

    The current version of the framework is the first "public beta". He has yet to go through several important steps to finish, debug and publish a number of classes that are still being finalized. In particular, classes for working with dates and times, with animation, with “forms”, with asynchronous HTTP requests, and much more will appear or will be expanded in the next versions. Also, the documentation will be constantly expanded and supplemented, translation of all documentation into Russian is being prepared (at the moment it is available only in English).

    More detailed information, documentation, links to downloading and installing the framework using NPM are available on the official website of the project: daajs.org I

    invite those interested in testing, cooperation and, of course, communication!

    Also popular now: