Skip to content

Mamba

What is Mamba?


It is impossible to build a high-quality Application without defining any execution logic. For this, zAppDev uses Mamba: a powerful, yet extremely simple, C-like, Object Oriented Programming Language created exclusively for zAppDev.

Created exclusively for zAppDev, Mamba is designed for development of large web-applications as a strongly typed, null-safe Object Oriented programming language that hides unneeded technical details, allowing even junior developers to safely handle every aspect of a Web Application (e.g. Data persistence, WebSocket communication, User Interaction, Security etc.) in a few lines of code.

Console

More specifically, Mamba is a programming-language residing higher than the high-level programming languages, that provides an abstraction level to the latter in order to:

  • hide their implementation details
  • omit the dependency between frameworks and technologies
  • minimize the lines of code required for common tasks
  • lessen the necessity to excel in and apply Best Practices, Patterns, logic decisions etc.
  • unify the Business Logic programming across all layers (front-end, back-end, database, security etc) into one single point of coding

Language Agnostic


Mamba can be described as a transpiled programming-language that the language-agnostic zAppDev uses to transpile it to the target language selected via the Implementation Strategy Settings.

Think of it as a vocabulary and a set of grammatical rules, looking a lot like the C Programming Language, that, together with a comprehensive set of commands and libraries, are finally generated into another programming language using the most optimal and efficient decisions, rules and patterns.

The following table shows you just a few of the questions and decisions we programmers stumble upon all the time and the way that Mamba addresses them, requiring almost no action or lines of code:

Question Answer Benefit
Can the block be generated in the Front-End? If yes, is this optimal in terms of speed and memory? Generate it as TypeScript Less repetitive tasks and models maintenance
Does the block of code use the Database? Should it be generated solely on the Back-End? Is it optimal in terms of security, speed and transmitted data? Generate it as C# One coding-place, zero maintenance
Can the data be stored in cache? Generate cache-optimized code No need to write caching mechanisms, migrations (i.e. from a local cache to a Redis Server)
Does the Application run with Forms or with OS Authentication? Generate codes for registration and login using the preferred type of Authentication No need to write your Authentication mechanisms from scratch or migrate from one type to another re-creating the whole procedure
Are the transmitted data too large? Compress them No need for the developer to check the size of the data, decide on whether to compress them, write the whole code doing just that, repeat it in another step if necessary

Of course, aside from making the best decisions for us, Mamba also helps write the minimum lines of code required for a task. All known and commonly used tasks (e.g. Authentication, Persistence, Data Transformations, Events, Caching and so on and so forth) that usually require tens - and sometimes hundreds or thousands - lines of code (depending on the Programming Language and Framework used), have been pushed into one Mamba command thanks to its comprehensive Libraries.

Just imagine what would you need to do if you wanted to create a plain Form Authentication for your Application, using cookies, an Identity Server and some AES encryption. Only in ASP.Net this task would require hundreds of lines of code, endless checks, exception handlings, redirection logics etc. In Mamba, all that is hidden - compressed into simple commands; you type a command, zAppDev transpiles it to those hundreds lines of code we mentioned earlier.

function bool RegisterUser(bool login)
{
    //Encrypt Password
    string encryptedPassword = AppLib.Security.AESEncrypt(Model.PasswordTextBox, "B374A26A71490437AA024E4FADD5B497");

    //Create User
    var userToRegister = Domain.ApplicationUser.Create();
    userToRegister.Username = Model.UserName;
    userToRegister.Email = Model.Email;
    userToRegister.Password = encryptedPassword;

    //Registrer User
    string error =  AppLib.Security.RegisterUser(userToRegister, encryptedPassword);
    if(!string.IsNullOrWhiteSpace(error)){
        DebugLib.Logger.WriteErrorLine("Failed to Register User: "+ userToRegister.UserName+"! Error: " + error);
        ShowMessage("Your registation failed. Please, try again later.", AppLib.MessageType.Error);
        return false;
    }

    //Cache user, just for fun
    Applib.ApplicationCache.Set(Model.UserName, userToRegister);

    //Send an E-Mail
    CommonLib.Utilities.SendEmail("Registration Complete!", "You have been successfully Registered. Thanx!", userToRegister.Email);

    if(login){
        //Log in
        bool loggedIn = AppLib.Security.SignInUser(Model.UserName, encryptedPassword, Model.RememberMe);
        if(!loggedIn){
            //Resources with multiple languages for messaging
            ShowMessage(LocalResources.SignInFailed, AppLib.MessageType.Error);
            return false;
        }
    }

    return true;
}

The previous example shows exactly what Mamba does: hides all implementation logic behind a few maintainable lines of code. And here, I did not use the word "maintainable" by mistake. 'Cause it's scary out there. Programming life is not as books and trainings describe it. Be sure that no matter how organized your team is, no matter how "set in stone" the requirements are, no matter how approved and signed the designs are, your code will change. At the worst possible moment. Days before you have to wrap up and deliver your Forms-Authenticated Application, your boss will come smiling and say he/she wants a Windows Authentication in place. Or throw you something like "great job on the caching! It really sped up the app! You know, I was out with my friends yesterday and they said something about Redis...". Or the even better "hey, heard about that GDPR thing? Looks like we'll have to redefine a few things".

In any other language, the scenarios described would end with you in an ICU (or your boss, depending on your temper). Mamba, however, changes it. Whatever your choice of generated language (C# or Java), whatever your choice of frameworks and technologies (Identity Authentication or Google Authentication, internal Cache or an external Redis Server, SQL or Mongo DB), your code will remain the same.

Platform Agnostic


As far as the Platforms and Technologies used are concerned, Mamba depends solely on the Implementation Strategy selected in zAppDev. In other words, your Mamba Code, together with your designed Models and the Configuration you apply in zAppDev, will be generated into a a web-application for and with the frameworks and technologies of your choice with all the additional items that may be required.

For example, the MVC (Model-View-Controller) Implementation Strategy will generate you:

  • An ASP.Net Web-Application using the Model-View-Controller pattern
  • With Typescript as the Front-End language
  • C# as its Back-End language
  • MS-SQL as the Database
  • IIS as the Deployment Server