The PhpManteiga framework aims to simplify web application development using PHP and UML. It uses MDA and design patterns like MVC, FrontController, and AbstractFactory. Key classes include Entity for database objects, MQL for queries, and Actions as commands. The framework was used successfully for projects like a virtual police station and governor's agenda. More information is available on its website and GitHub page.
Developing MDA Applications with the PhpManteiga Framework
1. Rafael Santos dos Reis & Luiz Guilherme Cruz
PhpManteiga Framework
Developing MDA Applications with the
2. Rafael Santos dos Reis
rafaelsreis@gmail.com
https://www.linkedin.com/in/rafael-santos-dos-reis-2790ab52/
Graduated in Technology in Analysis and Development of
Systems and Post graduated in the MBA course in Project
Management. Extensive experience in systems
development with the focus in the areas of Project
Management, Software Architecture, Databases and agile
methodologies.
Luiz Guilherme Cruz
lgfcruz@gmail.com
http://br.linkedin.com/in/luizguilhermecruz
Graduated in Data Processing by UNAMA, Specialization
in Web Technology by CESUPA, MBA in Project
Management by FGV - Fundação Getúlio Vargas,
PRODEPA (Data Processing of the Pará State) employee
in the area of systems development in Technology
Management and Innovation, Web Accessibility
Consultant and Assistive Software of the ACESSAR -
UFRA Nucleus.
4. Objective
The PhpManteiga Framework has as the
main objective make the development of
web applications with the use of PHP and
UML language easily and quickly by anyone
with the minimum knowledge required.
Developing MDA Applications with the PhpManteiga Framework
5. What is the PhpManteiga?
Developing MDA Applications with the PhpManteiga Framework
6. What is the PhpManteiga?
It is a framework for web development using the main
design patterns of the market, aimed at increased
productivity focused on MDA technology using UML
resources.
Developing MDA Applications with the PhpManteiga Framework
8. Why PhpManteiga?
After we thought a lot about a name for our new
framework we came up with what most represented what
we wanted for this tool. Hence we call it PhpManteiga.
PHP because it is a framework in PHP and "Manteiga"
(Butter in English) that for us is a cinch (a piece of cake!),
which allows anyone can program without a deep
knowledge of the PHP language.
Developing MDA Applications with the PhpManteiga Framework
10. ● It is a systems development approach that allows project and
construction independent of programming language.
● It is a conceptual architecture for software development
defined by the OMG (Object Management Group);
● It is not a development process;
● Portability, Reuse and Productivity;
MDA (Model Driven Architecture)
Developing MDA Applications with the PhpManteiga Framework
11. MDA (Model Driven Architecture)
Developing MDA Applications with the PhpManteiga Framework
PIM
Platform
Independent
Model
PSM
Platform
Specific
Model
MDA
Transformation
Artifacts and Codes
13. Developing MDA Applications with the PhpManteiga Framework
Used Technologies
PHP
DB
(DatabaseFactory)
View
(Smarty)
Model
(Entity)
Controller
(Action)
XML
(Config Files)
UML
(Conceptual
Model)
14. PHP (Hypertext Preprocessor) is a
widely-used open source
general-purpose scripting language that
is especially suited for web development
and can be embedded into HTML.
Source: php.net
PHP
Developing MDA Applications with the PhpManteiga Framework
15. It is a software architecture standard that separates the
representation of information from user interaction with it.
The model consists of application data, business rules, logic,
and functions. A view can be any output representation of
the data, such as a table or a diagram. The controller
mediates the input, converting it to commands for the
model or view. The core ideas behind MVC are code reuse
and concept separation.
Source: Wikipedia
MVC
Developing MDA Applications with the PhpManteiga Framework
16. MVC
Developing MDA Applications with the PhpManteiga Framework
Clients
Internet FrontController Controller
1 2
43
Model
5
View
6
17. ● Access interface of a Database of the PHP;
● Abstraction of the database layer;
● Independence of database;
● It is Object Oriented;
PDO (PHP Data Object)
Developing MDA Applications with the PhpManteiga Framework
18. ● Independence of the DBMS;
● Access to own structures for systems oriented to objects;
● Ability to execute a specific program of application in
different systems such as the minimum of changes in the
program;
OQL Support
Developing MDA Applications with the PhpManteiga Framework
19. ● Add metadata to classes, properties, and methods;
● Does not directly affect the application;
● Can be parameterized by simple tags;
● Facility in the code maintenance;
Annotation
Developing MDA Applications with the PhpManteiga Framework
20. Annotations in PHP?
Developing MDA Applications with the PhpManteiga Framework
Probably you may have already used some kind of
annotation in your code!
/**
* Class Hello World
*
* @author Ausla
* @see http://www.ausla.com.br
*/
Class Hello {}
21. ● The use of PhpDoc;
● Launch of release 5 of PHP;
● Some frameworks access PhpDoc tags;
● Some frameworks have started using specific tags;
Historic of Annotations on PHP
Developing MDA Applications with the PhpManteiga Framework
22. Extending the API Reflection of PHP 5
● Provides access to PhpDoc tags;
● Used to get information about types of parameter or
properties;
● It has no real support the annotation;
And how does it work then?
Developing MDA Applications with the PhpManteiga Framework
23. Generic Frameworks
● Allows you to create your own annotations;
● Provides generic parsing in annotations;
● Provides access at runtime;
● No standard norm for the annotations;
And how does it work then?
Developing MDA Applications with the PhpManteiga Framework
25. AbstractDao
SingletonPDO
Internal Architecture of PhpManteiga
Developing MDA Applications with the PhpManteiga Framework
Clients
Internet FrontController
Action
(Controller)
1 2
107
DB
(Oracle,
PostgreSQL,
MySQL, etc.)
15
Smarty
(View)
16
Facade
Entity
(Model)
MBO
MQL
116
8
9
12
5
13
4
3 14
26. They are responsible for mapping all
classes through autoload calls, enabling
rapid development without the need for
previous statements. The mapping is
done through an XML file named
context-config.xml.
Classes, Context and MappingClass
Developing MDA Applications with the PhpManteiga Framework
27. It is responsible for instantiating initial session
variables in the architecture through an XML
file named init-config.xml, where each XML tag
described in this file will be instantiated only the
first time the system is called with the values
entered in the respective file.
Initialization
Developing MDA Applications with the PhpManteiga Framework
28. They are responsible for handling all the
exceptions and alerts that have occurred in the
architecture, and all exceptions are logged in
the Log4Php folder, where this folder is defined
in the Context classes through an XML file
named context-config.xml in the Log tag.
ErrorHandler and Error
Developing MDA Applications with the PhpManteiga Framework
29. It is responsible for the control of the processing
flow of the entire architecture since the request
is received by it and then it is checked if the
action (command) can be executed. It is in this
class that the access permissions to the Actions
that are being called are checked.
FrontController
Developing MDA Applications with the PhpManteiga Framework
30. The abstract class of access to data through
independent SQL commands of the database, in
this class all methods of manipulation of data
through the SingletonPDO class are described.
AbstractDAO
Developing MDA Applications with the PhpManteiga Framework
31. This class implements a pool of connections to
the database through the PDO, being
performed by the configuration XML file, called
database-config.xml. This class uses an
AbstractFactory project pattern, through the
DatabaseFactory class, to access the various
databases supported by the PDO drivers.
SingletonPDO
Developing MDA Applications with the PhpManteiga Framework
32. This class implements the
AbstractFactory design pattern of all
connection classes of various types of
databases.
DatabaseFactory
Developing MDA Applications with the PhpManteiga Framework
33. They are responsible for the PDO
connection to the various types of
databases on the market, where
connections to MySQL, PostgreSQL,
Oracle, and MSSQL were used through a
single interface called IDatabase.
IDatabase, MySQL, PgSQL, Oracle and MSSQL
Developing MDA Applications with the PhpManteiga Framework
34. This class implements the standard OQL (Object
Query Language), among its main features allows
to retrieve and manipulate objects stored in the
database. The MQL class was developed based on
the hibernate HQL (Hibernate Query Language)
pattern, using the hibernate LAZY technique.
MQL (Manteiga Query Language)
Developing MDA Applications with the PhpManteiga Framework
35. This class implements the annotation on the Entity
object and the overhead of the GET and SET
methods, using internally in its methods (find, save
and delete) a call to MQL without the developer
having specific knowledge of SQL.
MBO (Manteiga Business Object)
Developing MDA Applications with the PhpManteiga Framework
36. This class implements the objects that represent
the tables in the database, extending the MBO
class. It is in this class that all the annotations will
be described to describe the correct form of the
object.
Entity
Developing MDA Applications with the PhpManteiga Framework
37. It is responsible for grouping all the Entity class
functionalities of a given package, organizing it by
features with similar characteristics.
Facade
Developing MDA Applications with the PhpManteiga Framework
38. This class implements the interaction between
presentation (Smarty) and business (Facade)
layers, having 3 minimal methods (show, form and
submit). The Actions correspond to the Command
project pattern that will be validated by the
FrontController.
Actions
Developing MDA Applications with the PhpManteiga Framework
39. This class is responsible for interacting directly
with the presentation layer (Smarty).
ActionForm
Developing MDA Applications with the PhpManteiga Framework
48. ● Gerador de formulários e pesquisa online chamado eForms;
● Internal Control of the Management Unit of the State;
● Payment Control of the prefectures by automatic debit of the
IGEPREV;
● Health Plan Company Management System;
● Modules of the integrated management system of the
Secretariat of Education of the Pará State;
Other Success Cases
Developing MDA Applications with the PhpManteiga Framework
50. A1Br - First Accessible News Portal in Brazil
More information
http://phpmanteiga.sourceforge.net/
https://github.com/lgfcruz/PhpManteiga
Luiz Guilherme Cruz