zimplify/zimplier

This package is abandoned and no longer maintained. No replacement package was suggested.

Zimplier is a micro framework aims to simplify web application development to a declarative approach as much as possible

dev-master 2019-01-06 14:07 UTC

This package is auto-updated.

Last update: 2019-03-04 06:23:40 UTC


README

Welcome to the home of Zimplify, we design this nifty framework to enable development over REST API and backend application easier for everyone and not just the Geeks. On that note, we try to reduce the amount of work coders has to do the get a full set of code up and running so you focus on better designs, and less on writing elegant code :-)

Installation

If you have composer, the work is easy...

composer require "zimplify\zimplier"

Usage

Now to make use of the framework, we have to explain a few things like...

  • Metadata
  • Model
  • Controller
  • Providers

Metadata

The metadata is the setup of the instance you want to run in the application - like users, customers, and other entities that make your application work. In is in a form of an XML file so you can play with something easy to user.

A sample file will look something like this:

<?xml version="1.0" encoding="UTF-8"?>
<object inherit="zimplier.core">
  <metadata>
    <data name="name">
      <data name="first" type="text" default="'John'" />
      <data name="last" type="text" default="'John'" />
    </data>
  </metadata>
</data>

There are a few tags here:

  • <object> describes you are declaring a new entity in your application
  • <metadata> describes you are declaring properties for your new entity
  • <data> describes the name of the property you are declaring with a type of text and a default value of John.

The types valid (so far) are:

  • text
  • number
  • float
  • yesno
  • date
  • array
  • file
  • password

There are a bunch of options you can attach to the data itself, which will come in the API docs (todo)

Commands

Commands are a subsection under the metadata that contains data access procedures and here is an example:

<commands>
  <command name="save" source="default" method="ZDP_SYOB_SET" call="exec">
    <params>
      <param>id<param>
      <param>instance</param>
    </params>
  </command>
</commands>

It basically means:

  1. The save command will exec procedure ZDP_SYOB_SET from data source default.
  2. It will take 2 parameters, variable id and instance from the instance of the entity.

Workflow

Workflow plays an important part of the ecosystem of Zimplify as we can bundle a big set of actions together on a subject. Together they can transform data under a secure operating environment.

Here is an example of the workflow

<workflows>
  <workflow name="main>
    <tasks>
      <task id="0" type="state.change" target="document.completing" />
      <task id="1" type="workflow.close" />
    </tasks>
    <logic>
      <state id="document.creating" begin="true">
        <run id="creating.goto.completing" task="0" />
      </state>
      <state id="document.closing">
        <run id="closing.complete" task="1" />
      </state>
    </logic>
  </workflow>
</workflows>

This example actually translate to:

  1. At the beginning, the workflow will change to the state of documenting.completing.
  2. After that we will close the workflow.

Of couse there are a lot of actions you can do with the workflow, and we will cover that in the API (todo).

Model

The model is the actual main action you allow an entity to do work. It is subject to the code you write here but all classes you run the model needs to import the following libraries:

  1. Zimplify\Zimplier\Model for the basic model functions such as ownership cascades, metadata reading, etc.
  2. Zimplify\Zimplier\Application for easy function to create, load and ready system config.
  3. Zimplify\Zimplier\Support\Utilities a big batch of helper functions that will ease a lot of the pain when you build.
  4. Zimplify\Zimplier\Query for searching the database for instance similar to how NoSQL queries.

Apart from these, the work is only limit by your imagination!

Providers

Providers are a set of plugin elements that allows you to easily add functions to the application. We already prebuild a batch of these to help you out such as:

  • Crytography
  • SMTP
  • Workflow Controls
  • Batch File processing and queuing
  • JWT generations
  • ... and more

You can also create your own service providers, simply source the interface Zimplify\Zimplier\Features\Interfaces\IServiceProviderInterface and Zimplify\Zimplier\Features\Handlers\TServiceProviderHandler and starting coding away

Controllers

For writing MVC based apps, the controller is something you use to logic from Model and output View