ITB2016 Intro To ColdBox MVC

Preview:

Citation preview

ColdBox MVC:NATHANIEL FRANCIS

‣Computer Know How

‣CFML/JavaScript developer

‣APIs (REST)

Who Am I?

As applications grow, complexity growsAs complexity grows, complications multiply

How do we make complex applications

while minimizing complications?

GOALS: make existing code organization simple while developing complex applications for teams to work on

GOALS: make developing new code

simple to integrate into existing code

VIEW ‣what the user interacts with ‣UI/UX ‣browser/mobile stuff ‣“the site” or “the app”

according to the user

MODEL ‣business logic ‣data interaction manipulation ‣services ‣data access

CONTROLLER ‣“confusing one” ‣controls application flow ‣mediator between model & view ‣request/response manager ‣different for different systems

The MVC Restaurant: an illustration in organization

‣The menu

‣What the user sees

‣User Interface (UI) -> what the user interacts with

View

Controller

‣ The waiter/server

‣Go-between for the View and the Model

‣ Takes orders from the View

‣Brings food from the Model

Model‣The Chef

‣Makes the food

‣Data modeling

‣Data management

‣Business Logic

Model-View-Controller (MVC)

Controller Brings requests from the View to the Model

Brings data from the Model to the View

Model handles the business logic

View UI, what the client sees/interacts with

What MVC does for us ‣organization ‣file definition ‣every aspect of our app has a place ‣makes amazing coffee

Just the Basics!

brings more to the table ‣conventions over configurations ‣modularization ‣event management

Conventions over Configurations

Over

Configurations

You map this thing to that other thing and write this annotation if you need the third thing and if you make a new thing you have to map that

to the first thing and…???

Conventions

Put the right stuff in the right box and everything works

What this looks like…

Conventions:

“put the right stuff in the right box & ColdBox does the work for you”

Beyond

MVC

Modulesprogram packages that give extra functionality

to your core application. They are:‣ Independent ‣Interchangeable ‣reusable

What this looks like…

‣ Lives in modules folder (convention)

‣Has its own MVC

‣ Independent, interchangeable, pluggable

‣Extensibility

Modules can be…

‣ Libraries for extra functionality

‣Widgets

‣Anything that gives extends your core application

‣ Example: ContentBox uses modules for its functionality

Interceptors‣ Intercept an event with action

‣ “When” -> interception point ‣Default interception points

‣Custom interception points

‣ Intercept time ‣“when this happens, do this…”

Putting it Back Together

@Francainath