36
Free & Open Source Solutions for Education (FLossEd BK 2009) Tequila Framework 3.2.1 Siwawong W. Project Director 2009.10.31

FLossEd-BK Tequila Framework3.2.1

Embed Size (px)

Citation preview

Page 1: FLossEd-BK Tequila Framework3.2.1

Free & Open Source Solutions for Education (FLossEd BK 2009)

Tequila Framework 3.2.1

Siwawong W.Project Director

2009.10.31

Page 2: FLossEd-BK Tequila Framework3.2.1

FLossEd BK 2009

Agenda

10:15 – 10:20 Self-Introduction

10:20 – 10:30 Introduction

10:30 – 10:45 Demonstrate the Framework

10:45 – 11:00 Case-study ~ Q&A

Page 3: FLossEd-BK Tequila Framework3.2.1

Free & Open Source Solutions for Education (FLossEd BK 2009)

SELF-INTRODUCTION

Page 4: FLossEd-BK Tequila Framework3.2.1

FLossEd BK 2009

About Me

• My Name: Siwawong Wuttipongprasert– Nick-name: Tae (You can call this name. it’s easier)

• My Background: – B.Eng (Computer Engineering), Chiang Mai University.

CPE#3, Gear25

• My Career Profile: – 10+ years in IT business– 5+ years with Blue Ball Co., Ltd.– Role: Programmer, System Analysis, Consultant & Project Manager– Working Area: ERP, MRP, Retailing, Banking, Financial, E-Commerce, etc.– Working with multi-cultures: Japanese, German and Vietnamese

• Know Me More..

Page 5: FLossEd-BK Tequila Framework3.2.1

FLossEd BK 2009

My Company: Blue Ball

Blue Ball Group is an Offshoring Company that focus totally in customer satisfaction. It takes advantage of western management combined with Asian human resources to provide high quality services

Thailand (Head Office)

Mexico (Special Developments)

Vietnam (Offshoring Center)

* Available in German on Jun,2010

Page 6: FLossEd-BK Tequila Framework3.2.1

FLossEd BK 2009

Services from My Company

Offshoring Programmers &Testers Blue Ball will get you ready to offshore successfully. No need to rush you into offshoring without you feeling confident on how to send, organize, receive, test and accept job confidently 

System Development & Embedded Solutions Solutions that combine technological expertise and deep business understanding. We only start coding once every single detail such as milestones, scheduling, contact point, communication, issue management and critical protocols are in place

Web design and E-commerce Premium web design, CMS, e-commerce solutions and SEO services. Website maintenance and copy content creation to develop marketing campaigns that SELL for discerning companies to increase the quality and reach of their marketing campaigns

Page 7: FLossEd-BK Tequila Framework3.2.1

FLossEd BK 2009

My Clients

Page 8: FLossEd-BK Tequila Framework3.2.1

Free & Open Source Solutions for Education (FLossEd BK 2009)

Tequila Framework - Introduction Based-on http://tequila.blueballgroup.com/

Page 9: FLossEd-BK Tequila Framework3.2.1

FLossEd BK 2009

What’s Tequila Framework

• H - ighly productive MVC PHP framework to code super fa st, clean applications

• More Than Framework– Generator Included– Mash up– Security– Managers & Designers– Packages and Libraries– Workflow integrated

Page 10: FLossEd-BK Tequila Framework3.2.1

FLossEd BK 2009

Features

• Lightweight

– 666KB, deploying is a breeze

• Full MVC pattern• View strategies• Easy to extend• Reusable code• Multiple database• Multilanguage applications• Templateable applications

• UTF-8 Support• 100% OOP• -Auto loading• Robust, advanced security• Code generator• Workflow engine• Ajax support• Validation• Thai calendar/language suppor

t

Page 11: FLossEd-BK Tequila Framework3.2.1

FLossEd BK 2009

Why We Needs Framework?

• Less code, clean, fast, powerful• Focusing on the real problems, let the framework sol

ve the res• Agile work!

Page 12: FLossEd-BK Tequila Framework3.2.1

FLossEd BK 2009

Tequila Framework Structure

Your Application Code

Your Application Language files

Your Application Template files

Tequila Framework(Core)

• Split Application folder from Framework folder • All application folders are access same Framework folder

• All application are independent but related to same Core of Framework

Page 13: FLossEd-BK Tequila Framework3.2.1

Free & Open Source Solutions for Education (FLossEd BK 2009)

Basic Concept of Tequila Framework

Page 14: FLossEd-BK Tequila Framework3.2.1

FLossEd BK 2009

Basic Concept in Tequila Framework

• OOP• MVC Pattern• DAO & VO• View Strategy

Page 15: FLossEd-BK Tequila Framework3.2.1

FLossEd BK 2009

OOP in Tequila Framework

• Offers many benefits:– V isibility protection, automatic class loading, overloading, interf

aces, abstracts, and singletons.– We implement follow PHP5 OOP feature.

• NOT implement ActiveRecord Pattern

– Implement on real OOP ways

Page 16: FLossEd-BK Tequila Framework3.2.1

FLossEd BK 2009

OOP : Automatic Class Loading

• Managed by c_square.php

Looking for new class automatically when calling itAnd path that we’ve looking for: -• /includes in core• /includes in application

Page 17: FLossEd-BK Tequila Framework3.2.1

FLossEd BK 2009

OOP : Singletons Class

• It provides a single method which will work for any and all classes and subclasses.

• It does not require a method to be duplicated within each class or subclass.

Code:

$dateobj = singleton::getInstance('DateClass');

Page 18: FLossEd-BK Tequila Framework3.2.1

FLossEd BK 2009

MVC Pattern in Tequila Framework

In Tequila the name of your controller is normally passed as a task: task=yourcontroller and the method as an action &action=Browse

Page 19: FLossEd-BK Tequila Framework3.2.1

FLossEd BK 2009

MVC Pattern : Sample Code

controller

model

We will explain DAO & VO in next section

Standard Class from Tequila Framework

Page 20: FLossEd-BK Tequila Framework3.2.1

FLossEd BK 2009

MVC Pattern : Sample Code (Cont’)

view

Related to HTML (template) and language file

Page 21: FLossEd-BK Tequila Framework3.2.1

FLossEd BK 2009

DAO & VO

• in Tequila 3.2, we call DAO & DTO – DAO : Data Access Object– DTO : Data Transfer Object (Formerly, we call VO (Value Object))

• DAO – Allow us to keep the database code out of the model and to avoid

repeating statements . They also help when switching database types.– The DAO will contain the methods and information to map the objects

to the DB.

• DTO– Design pattern used to transfer data between software applications or

layers.– Normally they represent a single row in the database but they can

contain any data structure

Page 22: FLossEd-BK Tequila Framework3.2.1

FLossEd BK 2009

DAO & DTO: Sample Code

DAO Code Standard DAO class in Tequila- DAO- DAO_Unquie- DAO_blob- DAO_service

DTO Code

Property are same field’s name in table

Page 23: FLossEd-BK Tequila Framework3.2.1

FLossEd BK 2009

View Strategy in Tequila

• Strategies are means to simplify and reduce the code used in the view layer.

• Strategies are a pattern for code reuse . Tequila implements strategies on validation a presentation layer. 

• The main idea is to avoid repetitive code and allow complex screens/controls to be done without too much work. 

•  Some basic strategies are provided: View VO, View Array, View editor, View object, View pagination, View Tree, etc. 

Page 24: FLossEd-BK Tequila Framework3.2.1

FLossEd BK 2009

Using strategies

• Strategies are like any other object . They follow a common interface ‘view’ and inherit methods from view_strategy class .

Code:

$v = new view_alternate_table($this->template, $vo_array, array('parent'=>'List'));$v->addlang('label','view');$v->addblocklang('label');$v->addbtn('addNew','?task=im_accounts&mode=addNew',true); $v->addfield("viewLink", "index.php?task=im_accounts&mode=View&I_IDACCOUNT={I_IDACCOUNT}");$v->getview();

Page 25: FLossEd-BK Tequila Framework3.2.1

Free & Open Source Solutions for Education (FLossEd BK 2009)

Advance Topic in Tequila Framework

Page 26: FLossEd-BK Tequila Framework3.2.1

FLossEd BK 2009

Advance Topic in Tequila Framework

• Security Module• Workflow Module• Built-in Libraries

Page 27: FLossEd-BK Tequila Framework3.2.1

FLossEd BK 2009

Security Module in Tequila Framework

Page 28: FLossEd-BK Tequila Framework3.2.1

FLossEd BK 2009

Security Module: Sample Configuration

Objects

ActionsSecurity Group

Security define in format : systems.yoursystem.tasks.taskname

Classifier

Page 29: FLossEd-BK Tequila Framework3.2.1

FLossEd BK 2009

Workflow Module in Tequila Framework

• Workflow engine and the designer will be release in version 3.2.

• We are currently working in the flash based designer which is delaying us, however the engine has been available since version 2.0

Page 30: FLossEd-BK Tequila Framework3.2.1

FLossEd BK 2009

Built-in Libraries in Tequila Framework

• Check built-in libraries under \includes\packages• Currently, we provide: -

– Benchmark– Keep-alive– Menu Builder– Notifier (via twitter)– Mail– Excel Export – Etc.

Page 31: FLossEd-BK Tequila Framework3.2.1

Free & Open Source Solutions for Education (FLossEd BK 2009)

Getting start with Tequila framework

Page 32: FLossEd-BK Tequila Framework3.2.1

FLossEd BK 2009

-Pre requisites

• Skill/Background– PHP– OOP Concept– Database (e.g. MySQL, Oracle, MS-SQL server, etc.)

• Software & OS– MS® Windows or Linux– Apache 2.2/IIS5.0 or higher– PHP5.0 or higher (recommend on 5.2.9)– Any Database Server (e.g. MySQL 5.0, Oracle, MS-SQL server)

• Recommended Software– LAMP or WAMP

Page 33: FLossEd-BK Tequila Framework3.2.1

FLossEd BK 2009

Installation

• Download from sourceforge• Unzip / Unrar the package in a directory inside your webserver,

i.e  . yourpath/tequila• Create new database and initialize tables with SQL script inside

• Create new folder for application by copy from initialize application• Configuration your application

Initialize application

Page 34: FLossEd-BK Tequila Framework3.2.1

FLossEd BK 2009

Start Coding!

• Create new tables in database• Start Page Generator (aka, Tequila Sunrise)

• Get application!

Page 35: FLossEd-BK Tequila Framework3.2.1

FLossEd BK 2009

Sample Code (from Sunrise)

Contained required objects e.g. controller, model, views, VO, DAO

Contained language for display in webpage (default by English)

Contained HTML files for display result (following template style in tequila)

Page 36: FLossEd-BK Tequila Framework3.2.1

Free & Open Source Solutions for Education (FLossEd BK 2009)

Thank you for your attention!

[email protected]