Lotus Framework

30
MVC Framework over WordPress Todi Adiyatmo Wijoyo for WordCamp Indonesia 2013

description

MVC framework over WordPress

Transcript of Lotus Framework

Page 1: Lotus Framework

MVC Framework over WordPress

Todi Adiyatmo Wijoyo for WordCamp Indonesia 2013

Page 2: Lotus Framework

Introduction Name

Todi Adiyatmo Wijoyo Role

Developer Company

Tonjoo.com Twitter

@todiadiyatmo

Page 3: Lotus Framework

Disclaimer

This is a very technical presentation

Page 4: Lotus Framework

WordPress Very popular CMS

Used by TONS of Website Easy to learn

Newcomers can learn how to use WordPress quickly

Deploying WordPress is fast Many theme to choose from Various plugin to extend functionality Can be developed pararel by using plugin Reducing development cost significantly

Strong community support

Page 5: Lotus Framework

Deploy Strategy – “The WordPress way”

Select Theme

Plugin

Modify

Page 6: Lotus Framework

Classic WordPress Question..

How to add complex functionality ?? Ex : Add complex front end

Page 7: Lotus Framework

Theme Hacking - Diggity

Page 8: Lotus Framework

Theme Hacking – Diggity ( User Follow)

Page 9: Lotus Framework

Development Strategy – “The WordPress way”

Limitation : “Inject” new functionality to themes or plugin

is painful, we must dig into the source code Not so “Time Efficient” ~ Against WP Philosophy

This lead to difficulty in developing complex application

Page 10: Lotus Framework

Other Limitation Loss of parallel development

Front end Dev and Back End Dev cannot work on the same theme on the same time

Non standard-code Lost of custom page template Different routing scheme Different file placement scheme

Page 11: Lotus Framework

MVC Framework Model – View – Controller Pattern Generally accepted style to build complex

(web) application Used by most framework

Most developer learn how to code in MVC during their collage time

Page 12: Lotus Framework

MVC Framework - disadvantages Not easy to learn

Take a lot of time to master one framework Plugin does not extend functionality as WordPress

(not click and go) Developing web with minimum developer is

not so fast Getting skilful developer is hard !

Page 13: Lotus Framework

MVC

Page 14: Lotus Framework

Comparison – WordPress and MVCFeatures WordPress MVC Framework

Easy to learn Yes Relative

Plugin and theme (1) Yes Mostly no

Fast deployment (2) Yes No

Develop complex application

Hard The General accepted way

1. Some Framework do have plugin2. Fast development with MVC framework means Senior

developer which equal extra cost

Page 15: Lotus Framework

Open Source MVC Framework for WordPress

Solution : Running MVC Framework over WordPress

Page 16: Lotus Framework

Lotus Framework Philosophy Easy to learn

Adopting Codeigniter Syntax Integration

Easy to deploy – Come with plugin Seamless integration into theme Using “native” WordPress code

Some serious documentation Current solution is not so well documented We want to make clear documentation

Well tested Already run on 3 project

Page 17: Lotus Framework

Lotus Framework - Architecture

Index Archive Single Page Hooked Page

Your chosen theme, any theme

WordPress

Page 18: Lotus Framework

Benefit of Using Lotus Framework Parallel development

Front end dev on theme, Backend developer on the LF

MVC Convention Every action done in correct part of apps

Database action done on model UI done on View Routing done on Controller

Easier development Develop complex web application with lower

senior programmer

Page 19: Lotus Framework

Simple case study

Develop a custom front end for a multi-site WordPress network

Page 20: Lotus Framework

Case Study Scenario

Indonesia Kreatif

5 Websites , Single User Dashboard Custom Business process

User role Fast Development

NEWSDIREKTO

RI EVENT

SHOWCASE

PORTAL

Page 21: Lotus Framework

Development Strategy WordPress

(+) Theme and Plugin ( - ) Way… tooo… dificult.. The user role, the

dashboard, the integration Framework

( + ) Easy to develop custom web apps with custom user role

( - ) Just not enough time ( - ) High cost, how many senior programmer you

would hire ? :p

Page 22: Lotus Framework

Other bizarre strategy Build Front end with WordPress Use framework to “inject data directly to the

database”

WordPress Database

Page 23: Lotus Framework

With the help of Lotus Framework Front end dev working on theme

5 Site -> 5 Theme Use any theme and plugin you want Do as usual, it just other ordinary day developing

WordPress theme

Back end developer Working on custom front end user dashboard Use native WordPress code to :

Login Register Post new article

Page 24: Lotus Framework

Native Code - Login

 wp_signon( $credentials, $secure_cookie )  http://codex.WordPress.org/Function_Reference/wp_signon

Page 25: Lotus Framework

Post List

Page 26: Lotus Framework

Native Code – Edit / Post new Article

wp_insert_post()

Page 27: Lotus Framework

Quick Demo

Page 28: Lotus Framework

Other Case Study - RSVP

Page 29: Lotus Framework

Lotus Framework Contributor

Code Tester Documentation Guy

Follow us at @tonjoo Public Release : End of 2013

Page 30: Lotus Framework

Question Session