+1 571-297-6383 | info@sonjara.com

Chapter 1. Introduction

Fakoli is a lightweight, entity-based framework designed to simplify development of web applications. The framework is open source (under the MIT License). Currently somewhat dissimilar versions exist for PHP and .NET. This document relates to the PHP version only.

Fakoli Architecture Diagram

Fakoli Design Principles

The framework tries to adhere to the following principles:

Lightweight Design

The framework has primarily been shaped by the philosophy of lightweight design. We believe that the less code and the fewer independent sub-systems there are in a software solution, the fewer the bugs, and the higher the quality. We also firmly believe that when a customer's needs are not an exact match for an off-the-shelf application, there needs to be a way to implement a more targeted solution without either building from scratch or working with expensive, difficult to configure applications or application frameworks. Thus, Fakoli is conceived as a lightweight framework that will provide you with the basic common functionality required to build a web application. However, there are no complicated configuration files, or interpreted XML data mappings. Everything is in code with an emphasis on re-usability, maintainability and conciseness.

Promoting a Rich Data Model

Fakoli is an entity-based framework. Tables in the relational data store are modeled directly with classes in the application's data model. Rows in the data store are then instantiated as objects (or entities) for manipulation by the application. The definition of these entities is handled in a declarative fashion, making the data model classes easy to write (or generate), easy to read, and directly executable (rather than having the structure defined in a configuration file that needs to be parsed with each access or held in shared memory by the application server). These data model objects provide a rich set of functionality that encapsulates the common operations required of them:

  • Querying from the relational data store

  • Persistence to the relational data store

  • Traversal of relationships within the data model

  • Formatting for text manipulation and output

  • Serialization to XML and JSON, for network interoperability

Promoting a Clear Programming Style

One of the key benefits of having an underlying rich data model for your application is that it reduces the semantic gap between the code you are writing and the requirements you are writing against. Using Fakoli, most of the minutiae of working with the database are handled for you. The code you write is in terms of the data model objects you have defined and the relationships between them, making the body of your PHP code much more readable and maintainable.

Fakoli is structured in such a way that if you follow best practices with your database design (meaningful field names, well-normalized data schema, etc.) then most of the drudge work of your day-to-day programming will simply disappear. For instance, if in the database you name a field "employee_salary" then this field name will be used in the data model object and further, Fakoli will automatically reformat the field name to "Employee Salary" when displaying in forms on your site. If, however, you named that field "s" you would need to explicitly set up field aliases for this field to have them display in a readable fashion. This is the key to Fakoli's design philosophy–we try to make it easier for the programmer to do the right thing.

Chapter 2. The Data Model » « Back to Contents Page