Vitosto JS - A new library in JavaScript for fast web development

Motives

Today even the simplest application will demand from developers to know a handful of technologies and languages. Rapid prototyping libraries were created to bridge this, taking care of much of the boiler plate code necessary to put a application online, like Rails. Moreover template engines are based on the assumption that it will exists a Designer to take care of the pages, also the business logic has to be isolated from the rest of the code like persistence. Patterns like MVC, MVP and MVVM are thought to achieve this, but the sad truth is, often times applications end up with logic everywhere in these layers making growing the application harder and harder.

Vitosto JS - a new way to think about web development

With these in mind, I joined a group of friends and we started to work in a new library, Vitosto JS. View To Storage in JavaScript. The idea is lower down the amount of different layers between the user interface and the storage where the data actually is. Developers can grow their application just controlling one layer of code and having some knowledge about databases, as for now, vitosto.js can only work with MySQL databases, support for Oracle is in progress. Enough talking, more code:

Hello World:

<html>
  <head>
    <title>Vitosto JS</title>
    <script src="vitosto.js"></script>
    <script src="vitosto_config.js"></script>
  </head>
  <body>
    <h1>
      <script>$db.select("text").from("my_table");</script>
    </h1>
  </body>
</html>

vitosto.js is the library it carries all code to actually connect to the database plus a fluent API to issue queries. `vitosto_config.js` holds the connection information, for security it is encrypted with ROT13 algorithm for security purposes.

All the power of JavaScript is at your hands and a simple WebServer like apache will be necessary to hold your application. Here's an example of a form submission.

<html>
  <head>
    <title>Vitosto JS Form</title>
    <script src="jquery.js"></script>
    <script src="vitosto.js"></script>
    <script src="vitosto_config.js"></script>
    <script>
      processForm() {
        var name = doSomeSanityCheck($("#name").text);
        $db.insert(name).into("table");
        rewriteDomForThankYou(name);
      }
    </script>
  </head>
  <body>
    <form>
      <input id="name" type="text" maxlength="50"><input type="submit"
onClick="processForm()">
    </form>
  </body>
</html>

As will can see we can mix JQuery and other libraries with Vitosto.js.

name

Next Steps

  • Oracle connection driver
  • Support for Oracle functions and procedures

Code and API information

Update: This was an April's joke, I decided remove the fake code from github.com just in case.

Published in Apr 01, 2012