Prácticas, patrones y factores para la elección del framework PHP.
Material del seminario dictado por la Comunidad-Symfony, mas detalle en http://www.symfony-community.com/introduccion-a-arquitectura-web
Actividad integradora 6 CREAR UN RECURSO MULTIMEDIA
Symfony-Community: Introducción a arquitecturas de aplicaciones web y frameworks
1. Introducción a arquitecturas
de aplicaciones web y
frameworks
Prácticas, patrones y factores para la
elección del framework
Disertante:
2. presentación
comunidad
¿Quiénes somos?
Colaboradores: Objetivo del seminario:
• Excedesoft S.A.
• Lic. Fabian Castillo Proveer al estudiante, profesional o
• Ing. Emiliano Viada empresa con los conceptos necesarios
para poder elegir un framework.
Destinatarios:
• Estudiantes
• Profesionales
• Empresas - Instituciones
Disertante:
3. • Concepto de aplicación web Contenido
• Evolución de las aplicaciones web (temario)
• Aplicaciones cada vez mas complejas.
• Concepto de arquitectura
• El rol del arquitecto.
• Cuestiones
• Concepto de framework
• Que es un framework?
• Ventajas y desventajas de utilización de un framework.
• Patrones arquitecturales
• Diferencia entre patrones computacionales y arquitecturales.
• Patrones arquitecturales mas populares
• Factores comerciales-técnicos para la
elección del framework.
• Técnico y de gestión: arquitecturales, lenguajes, frameworks, prácticas, estándares,
escalabilidad, soporte
• Institución o empresa: costos, portabilidad, curva de aprendizaje,
• Comercialización: puntos de venta, ventajas competitivas.
• Demostración de conceptos en práctica..
Disertante:
4. Concepto Aplicación Web
Cliente Medio - HTTP Servidor
PC - Browser Solicita Requerimiento Web Aplicación
Pagina URL Server - Sesión
- Negocio
Internet - BD
Renderiza HTML, CSS, JS, - Recursos
Contenido Imágenes
Usuario
Arquitectura Cliente - Servidor
Una aplicación web es un programa que se ejecuta sobre la plataforma web.
Es decir, el usuario maneja dicho programa desde el explorador, que por medio de
la red de internet (o intranet) se comunica con el servidor para el procesamiento
del requerimiento (tarea o función).
Disertante:
5. Evolución de aplicaciones
Móviles
App Interface
Rica – JS Driven
Múltiples
Web Aplicaciones
PC - Browser Solicita Requerimientos
Pagina Server
App App
Internet Negocio
Renderiza HTML, CSS, Core Componets
Contenido Imágenes
Nuevos tipos de
Partner aplicaciones:
Server B2B Content
Json, SOAP, XMLs • Web
• Móviles
• Servicios Web
Disertante:
• APIs
6. Nuevos tipos de aplicaciones
PC - Browser Características Arquitectura
Sin limitaciones.
Mayor calidad gráfica,
mas ancho de banda.
Múltiples
Aplicaciones
Recursos Limitados (3G, hard..)
Móviles App Interface Rica App
Web
Javascript - Ajax driven
Server App
Utilización de HTML5 – CSS3
Responsive design Negocio
App
Backend – Rest calls – Busines layer
Core Componets
Web Services
B2B En su mayoría Backend
Development.
- RPC, Rest Calls (json, xml), Soap
B2C Mecanismo de Autentificación.
APIs Interface para el desarrollador:
Librerías que permiten la integración de
ambas aplicaciones.
Funciona en combinación de web Disertante:
services.
7. Tendencias. Más complejidad.
• Internacionalización • Soporte múltiples
• Regionalización dispositivos
• • Diferentes formatos y
Arquitectura
Geo localización
• Distribución tamaños de display.
• Diferentes
capacidades.
Global Portables
Integración Experiencia
estratégica del usuario
• Interfaces ricas,
• B2B o B2C animadas,
• Alianzas Estratégicas. Interactivas
• Redes sociales • Más diseño de la
experiencia.
• APIs
• Mas simplicidad.
Disertante:
8. La importancia de la arquitectura
“ Una arquitectura es el conjunto de
decisiones significativas sobre la
organización de la aplicación web que
define los principios que guían el
desarrollo, los componentes principales
del sistema, sus responsabilidades y la
forma en que se interrelacionan.
Disertante:
“
9. ¿ Quién, Cuándo, y Cómo se gestionan
estas complejidades arquitecturales?
CUANDO = YA !!
• Análisis requerimientos
funcionales, operativos, etc.
• Priorización, proyección
features y capacidades del
sistema.
QUIEN = Arquitecto
COMO = Framework
• Si el framework es maduro, muchas de
estas cuestiones ya vienen incorporadas y
probadas.
• Queda por investigar los requerimientos Cuál es nuestro alcance
tecnologicos nuevos y ponderar el riesgo. en términos técnicos?
Disertante:
10. ¿Qué es un framework?
• Librerías, componentes y herramientas
• Provee dirección y límites.
• Proveer una arquitectura madura, experiencias y
conocimiento.
¿ Para qué?
• Para la construcción de aplicaciones complejas
• De manera rápida, escalable y mantenible.
• Con calidad, testeables, robustas.
Disertante:
11. Features de un framework web
Arquitecturalmente: • Ajax Integration
• Application controller, Filter • Tasks
• Enrutamiento • Generate-admin
• MVC • Unit-testing
• ORM
Consideraciones:
Componentes: 1. Licenciamiento
• App.Setting 2. Escalable
• Forms 3. Soportado (duración?)
• Web-services 4. Seguro
• Mailing 5. Estable
• I18n y l10n 6. Documentado
Disertante:
12. Web Design
Patterns
(Patrones/Framework)
Web Design Patterns &
Best practices.
Patrones Arquitecturales y Frameworks
Disertante:
13. Patterns
¿Qué es un Patrón?
Un patrón es una solución general reutilizable para un problema que se repite
una y otra vez dentro de un contexto dado.
- No es absoluto (sino conceptual)
- Es un conjunto de buenas prácticas.
Estructura de un Patrón
• Nombre. Es crucial, debe ser realmente descriptivo.
• Propósito.
• Esbozo del patrón. Generalmente, no siempre, un diagrama UML.
Tipos
Arquitecturales Computacionales
• estructura – organización • Resuelven problemas
• performance de la aplicación algorítmicos
• escalabilidad
• alta disponibilidad, etc.
Disertante:
14. Patterns
Patrones Arquitecturales
Los patrones arquitecturales son bien definidos en 3
grandes capas dentro de la arquitectura de software:
- Presentation layer: Domain Logic Pattern
- Presentación de información
- Gestión de interacciones. Data source Patterns
- Captura y validación entradas. Web Presentation Patterns
- Domain layer: Distribution Patterns
- Gestión de negocio, reglas, transacciones Session State Patterns
- Data source layer: Concurrency Patterns
- Gestión de la información, persistencia y
Base Patterns
recuperación de los datos.
- base de datos
- messaging,
- services, etc. Disertante:
15. Patterns
Patrones de Arquitectura
más populares
- Presentation Patterns:
- Front Controller
- MVC (Model-View-Controller)
- Template View
- Multi-step View
- Data Source Patterns:
- Object-Relational Mapping (ORM)
- Object-Document Mapping (ODM)
- Domain Logic Patterns:
- Transaction script
- Table Module
- Domain Model
Disertante:
16. Presentation
Patterns
Application Controller
http://www.myblog.com/
• index.php?accion=contacto
• index.php?accion=post-recientes
• Index.php?accion=comentar-post
URL Apache
request Server
Browser App. Controller
result index.php
intancia
.htaccess
Usuario contacto.php
Propósito: post-reciente.php
- Única puerta de entrada
- Gestión de requests.
comentar.php
- Enrutamiento de acción.
- física del código de la URL.
Variantes: Disertante:
- Front-controller, Page-Controller
17. Presentation
Patterns
Ejemplo PHP
Consideraciones:
- Utilización de .htaccess
para forzar la redirección al
index.php
- Los archivos .php por si
mismos no deberian
ejecutar ninguna lógica.
Disertante:
18. Presentation
Patterns
Model-View-Controller
Propósito:
- Organiza la aplicación en tres capas físicas-lógicas.
- La primera gestionará los requerimientos (controlador)
- Una capa de negocio (modelo)
- Y la ultima de presentación (vista)
Browser
REQUEST RESPONSE
http – cli, et Html, rss, xml
Json, etc
Controller
A demanda
Datos
Model View
Disertante:
19. Presentation
Patterns
Model-View-Controller
Browser AC Controller Model View
request
Invoca acción
GET - POST
Invoca método
Prepara
datos
Renderiza(datos)
HTML
Disertante:
20. Presentation
Patterns
Model View Controller
Apache
request Server
Browser
App. Controller
result
request response
Usuario Controller View
Model
• Controller = App. Controller + Actions
• Model = Clases de negocio + Persistencia
• View = Presentación Disertante:
21. Presentation
Patterns
Model View Controller
Consiste de 3 niveles:
- El Modelo representa la información con la cuál la aplicación opera, es decir,
su lógica de negocio.
- La Vista se encarga de presentar la información del Modelo dentro de una
página web para la interacción con el usuario.
- El Controlador responde a las acciones del usuario y lleva a cabo los cambios
en el Modelo o en la Vista según sea necesario.
El patrón MVC separa la lógica de negocio (model) y la presentación (view),
dándonos una gran mantenabilidad de la aplicación. Por ejemplo, si una aplicación
necesita presentar la data en diferentes vistas (standard browsers, mobile, consola),
solo se necesita una nueva vista manteniendo el controlador y el modelo.
El controlador ayuda a ocultar el protocolo usado (HTTP, Consola, Emailing, etc)
del modelo y de la vista; y el Modelo abstrae la lógicaDisertante:
de negocio.
22. Presentation
URL Routing Patterns
Mapear un requerimiento (URL) con una acción.
(Caso de Uso)
Apache
request Server
Browser
App. Controller
result
Routing response
Usuario request
Action
View
Controller
Propósito:
- Lograr URL amigables
- Independizar la ubicación Model
física del código de la URL.
- Flexibilidad – mantenabilidad de rutas.
Disertante:
23. Frameworks
Antes
Pensemos en esta url:
http://www.myblog.com/publico/abms/post.php?id=123456
Desventajas:
- Revelamos parte de la arquitectura de la aplicación.
- No es amigablemente legible.
- Si una url debe de ser cambiada (porque el nombre del script cambió), cada
link que apunta a dicha url debe de ser modificado.
Disertante:
25. Presentation
Multi-step View Patterns
- Propone organizar la vista
- Separa el contenido resultante de una acción especifica del contenido
estático
Contenido Estático Contenido-Vista Final
header Contenido Dinámico header
template template
footer Resulta de la acción footer
especifica
layout layout
template template
Template + View Logic + Layout = Presentación
Disertante:
26. Presentation
Multi-Step View Patterns
Integración con MVC.
Apache
request Server
Browser
App. Controller
result
response
Routing
Usuario request Layout
Action
Template
Controller
Propósito:
- Separación
- Mantenabilidad – orden. Model
- Reutilización.
Disertante:
27. Domain
Patterns
Transaction Script
Propósito:
- Negocio se piensa en términos de
transacciones
- Colección de scripts
- Cada script se corresponde con la petición
del usuario
URL Apache subscripcion.php <> Transaction script
request Server
Browser
<< Transaction script
result post-reciente.php
comentar.php >> Transaction script
Usuario
Disertante:
28. Domain
Patterns
Domain Model
Propósito:
- Negocio se piensa en términos de entidades de negocio y sus
relaciones
- Cada entidad maneja su propia lógica de negocio.
- Orientación a objetos.
Usuario 1
Post
1
* 1
*
* Comment
Disertante:
30. Presentation
Object Relat. Mapping Patterns
Capa de abstracción. Permite mapear las clases de
dominio con la base de datos relacional.
Apache
request Server
Browser
App. Controller
result
response
Routing
Usuario request Layout
Action
Template
Controller
Propósito:
- Simplicidad, escritura código en Domain Model
términos de negocio.
- Independencia de plataforma Mapping Persistencia
MySql,
Oracle, etc
Implementaciones:
- Java: Hibernate Ebean Disertante:
- PHP: Doctrine, Propel , PdoMap
32. Data Source
Patterns
ORM
El patrón Object-Relational Mapping nos permite acceder a base de datos
relacionales en una manera orientada a objetos, proveyendo una interfaz que nos
permite traducir lógica de los objetos en lógica relacional y viceversa.
Un ORM nos facilita un conjunto de objetos que nos dan acceso a la data
almacenada en una base de datos, manteniendo las reglas del negocio en ellos.
Uno de los mayores beneficios al utilizar un ORM es la capa de abstracción de
datos, la cual previene utilizar una sintáxis específica a un motor de base de datos
dado. Automáticamente, traduce las acciones realizadas por objetos a la query
optimizada para la base de datos.
La capa de abstracción encapsula la lógica de la data. El resto de la aplicación no
necesita saber de las consultas SQL que se llevan a cabo.
Disertante:
33. Presentation
Filter Patterns
Ejecución de múltiples tareas, previo y post la ejecución de la acción.
Apache
request Server
Browser
App. Controller
result
Filtros
response
Usuario Routing
request Layout
Propósito: Action
Template
- Forzar la ejecución y orden de Controller
tareas comunes a cada request.
- Extensión del funcionalidad
común. Model
Implementaciones:
- Chain or responsibility
- Security, Routing, Loging, Disertante:
Caching, Rendering
34. Frameworks
Filtros
Los filtros implementan el patrón de
diseño Chain of Responsability, el cual App. Controller
le permite a un objeto enviar una Filtros
petición sin conocer el objeto que lo
Security Logging
recibirá y manejará. La petición es
enviada desde un objeto a otro, Catching Custom
formando ambos partes de la cadena,
en la cuál cada objeto de esta cadena Routing response
puede manejar la petición, enviarla a Layout
request
otro objeto o hacer ambas.
Action
Template
Controller
Model
Disertante:
35. Comercial
Y técnico
Factores comerciales y
técnicos
Ventajas competitivas
Disertante:
36. Ventajas comerciales
Puntos de venta Gestión y producción
• Mantenible y escalable • Paradigma de convención
• Independencia del equipo de • Escalar un equipo
desarrollo. • Minimiza la curva de
• Codificación bajo estándares y aprendizaje.
mejores practicas de la • Setup del entorno.
industria. • Productividad
• Soporte • Scarfolding – Generación de
código
• Menos errores
• Menos costos
• Calidad
Disertante:
37. Bibliografía
Y referencias
Bibliografía
y referencias.
Disertante:
38. Bibliografía
Libros: URL Referencia:
• Patterns of Enterprise Application • http://martinfowler.com/eaaCatalog/
Architecture. Martin Fowler. • http://www.symfony-project.org
ISBN 0-321-12742-0. • http://www.phpframeworks.com/
• Pattern-Oriented Software
Architecture.
Wiley, 2000.
Disertante:
Going into detailEach key point is anchored with a question. I find posing a question to the audience relative to each key point engages them to proactively think and apply the ideas to their own situation vs. just listen to what I have to say. Slide Notes:Place the title of the first key point where it says “People” and also in the box in the upper right.This may seem redundant, but the repetition is important. The “subline” in the upper right hand box is for a one or two word anchor to the first key point.In my case, the subline for “People” is “Happiness” – it’s the people you surround yourself with in business who impact your happiness.I’ll then carry the “box” in the upper right hand corner, color-coded to that section, to additional content slides in that section.
Going into detailEach key point is anchored with a question. I find posing a question to the audience relative to each key point engages them to proactively think and apply the ideas to their own situation vs. just listen to what I have to say. Slide Notes:Place the title of the first key point where it says “People” and also in the box in the upper right.This may seem redundant, but the repetition is important. The “subline” in the upper right hand box is for a one or two word anchor to the first key point.In my case, the subline for “People” is “Happiness” – it’s the people you surround yourself with in business who impact your happiness.I’ll then carry the “box” in the upper right hand corner, color-coded to that section, to additional content slides in that section.
Curva de aprendizaje. El esfuerzo inicial
Es un únicopunto de entrada a la aplicaciónquemanejatoda la gestión depeticionesque se le hacen a la aplicación (Requests, Routing,Internacionalización, etc).
Short MoviesIn addition to photos, I use several short movie clips in my presentations to demonstrate various skills (showing a team leading a daily huddle) or highlight mini-case studies of growth firms applying our tools and techniques.These videos add credibility to my presentation, letting the audience hear from executives like themselves and how they’ve applied and benefited from using our tools and techniques. Slide Note:The image on this slide is a picture. Delete the picture for a media placeholder into which you can insert your own movie.
Short MoviesIn addition to photos, I use several short movie clips in my presentations to demonstrate various skills (showing a team leading a daily huddle) or highlight mini-case studies of growth firms applying our tools and techniques.These videos add credibility to my presentation, letting the audience hear from executives like themselves and how they’ve applied and benefited from using our tools and techniques. Slide Note:The image on this slide is a picture. Delete the picture for a media placeholder into which you can insert your own movie.
Short MoviesIn addition to photos, I use several short movie clips in my presentations to demonstrate various skills (showing a team leading a daily huddle) or highlight mini-case studies of growth firms applying our tools and techniques.These videos add credibility to my presentation, letting the audience hear from executives like themselves and how they’ve applied and benefited from using our tools and techniques. Slide Note:The image on this slide is a picture. Delete the picture for a media placeholder into which you can insert your own movie.
Antes
Despues
Short MoviesIn addition to photos, I use several short movie clips in my presentations to demonstrate various skills (showing a team leading a daily huddle) or highlight mini-case studies of growth firms applying our tools and techniques.These videos add credibility to my presentation, letting the audience hear from executives like themselves and how they’ve applied and benefited from using our tools and techniques. Slide Note:The image on this slide is a picture. Delete the picture for a media placeholder into which you can insert your own movie.
Short MoviesIn addition to photos, I use several short movie clips in my presentations to demonstrate various skills (showing a team leading a daily huddle) or highlight mini-case studies of growth firms applying our tools and techniques.These videos add credibility to my presentation, letting the audience hear from executives like themselves and how they’ve applied and benefited from using our tools and techniques. Slide Note:The image on this slide is a picture. Delete the picture for a media placeholder into which you can insert your own movie.
Short MoviesIn addition to photos, I use several short movie clips in my presentations to demonstrate various skills (showing a team leading a daily huddle) or highlight mini-case studies of growth firms applying our tools and techniques.These videos add credibility to my presentation, letting the audience hear from executives like themselves and how they’ve applied and benefited from using our tools and techniques. Slide Note:The image on this slide is a picture. Delete the picture for a media placeholder into which you can insert your own movie.
Short MoviesIn addition to photos, I use several short movie clips in my presentations to demonstrate various skills (showing a team leading a daily huddle) or highlight mini-case studies of growth firms applying our tools and techniques.These videos add credibility to my presentation, letting the audience hear from executives like themselves and how they’ve applied and benefited from using our tools and techniques. Slide Note:The image on this slide is a picture. Delete the picture for a media placeholder into which you can insert your own movie.
Short MoviesIn addition to photos, I use several short movie clips in my presentations to demonstrate various skills (showing a team leading a daily huddle) or highlight mini-case studies of growth firms applying our tools and techniques.These videos add credibility to my presentation, letting the audience hear from executives like themselves and how they’ve applied and benefited from using our tools and techniques. Slide Note:The image on this slide is a picture. Delete the picture for a media placeholder into which you can insert your own movie.
Short MoviesIn addition to photos, I use several short movie clips in my presentations to demonstrate various skills (showing a team leading a daily huddle) or highlight mini-case studies of growth firms applying our tools and techniques.These videos add credibility to my presentation, letting the audience hear from executives like themselves and how they’ve applied and benefited from using our tools and techniques. Slide Note:The image on this slide is a picture. Delete the picture for a media placeholder into which you can insert your own movie.
Short MoviesIn addition to photos, I use several short movie clips in my presentations to demonstrate various skills (showing a team leading a daily huddle) or highlight mini-case studies of growth firms applying our tools and techniques.These videos add credibility to my presentation, letting the audience hear from executives like themselves and how they’ve applied and benefited from using our tools and techniques. Slide Note:The image on this slide is a picture. Delete the picture for a media placeholder into which you can insert your own movie.
Short MoviesIn addition to photos, I use several short movie clips in my presentations to demonstrate various skills (showing a team leading a daily huddle) or highlight mini-case studies of growth firms applying our tools and techniques.These videos add credibility to my presentation, letting the audience hear from executives like themselves and how they’ve applied and benefited from using our tools and techniques. Slide Note:The image on this slide is a picture. Delete the picture for a media placeholder into which you can insert your own movie.
Short MoviesIn addition to photos, I use several short movie clips in my presentations to demonstrate various skills (showing a team leading a daily huddle) or highlight mini-case studies of growth firms applying our tools and techniques.These videos add credibility to my presentation, letting the audience hear from executives like themselves and how they’ve applied and benefited from using our tools and techniques. Slide Note:The image on this slide is a picture. Delete the picture for a media placeholder into which you can insert your own movie.
Short MoviesIn addition to photos, I use several short movie clips in my presentations to demonstrate various skills (showing a team leading a daily huddle) or highlight mini-case studies of growth firms applying our tools and techniques.These videos add credibility to my presentation, letting the audience hear from executives like themselves and how they’ve applied and benefited from using our tools and techniques. Slide Note:The image on this slide is a picture. Delete the picture for a media placeholder into which you can insert your own movie.
Short MoviesIn addition to photos, I use several short movie clips in my presentations to demonstrate various skills (showing a team leading a daily huddle) or highlight mini-case studies of growth firms applying our tools and techniques.These videos add credibility to my presentation, letting the audience hear from executives like themselves and how they’ve applied and benefited from using our tools and techniques. Slide Note:The image on this slide is a picture. Delete the picture for a media placeholder into which you can insert your own movie.
Creamos modulo contactenos y post Agregamos la rutaAgregamos el links de navegacion del sitio.
“Tell them what you’re going to tell them” Once I paint them a picture of the success they’ll achieve, using the opening story and slide, I next outline no more than 3 to 5 key “how to’s” for achieving this success, color-coded to each upcoming section of the presentation. For growing companies I have them focus on four key decisions they must get right: People, Strategy, Execution, and Cash.These four words are placed one per color-coded box. And I’ll share a growth company example for each key point.
“Tell them what you’re going to tell them” Once I paint them a picture of the success they’ll achieve, using the opening story and slide, I next outline no more than 3 to 5 key “how to’s” for achieving this success, color-coded to each upcoming section of the presentation. For growing companies I have them focus on four key decisions they must get right: People, Strategy, Execution, and Cash.These four words are placed one per color-coded box. And I’ll share a growth company example for each key point.
Image slidesTry to emphasize your concepts with pictures. And I tend to use real pictures – pictures of the companies and executives that are the subjects of my stories.Or I’ll choose a picture that elicits an emotional response to a key point I’m making. It’s important to touch a listener’s heart and head. Slide Notes:Note the left bar color aligns with the section color – visual clue that I’m still in Section 1.To set a picture as a slide background, as on this slide, hold down CONTROL, click the slide and then click Format Background.
Short MoviesIn addition to photos, I use several short movie clips in my presentations to demonstrate various skills (showing a team leading a daily huddle) or highlight mini-case studies of growth firms applying our tools and techniques.These videos add credibility to my presentation, letting the audience hear from executives like themselves and how they’ve applied and benefited from using our tools and techniques. Slide Note:The image on this slide is a picture. Delete the picture for a media placeholder into which you can insert your own movie.
Key PointsFor certain key points, I’ll simply place a few words on a slide without any other visuals, especially when I can’t find an appropriate picture and I want the words to linger in the minds of my audience.Again, I’ll always tell a story that brings the key point alive for the audience while I keep the words on the screen, effectively “burning“ an image in their mind.
Actionable endingI always want to leave the audience with an assignment – some action they need to take.In this case, I’ll ask which of the four decisions do they feel their company needs to focus on the most?Then I’ll give them a few minutes to note their answer and to outline three actions they’ll take when they get back to the office. Slide Notes: If I use photos, I often change the contrast and brightness so that the words stand out. To adjust brightness and contrast for a picture that you set as a slide background, hold down CONTROL, click the slide and then click Format Background. Find brightness and contrast settings on the Adjust Picture tab of that dialog box..To adjust brightness and contrast for a picture on a slide, select the picture and then click the Format Picture tab. Under Adjust, click Corrections to access brightness and contrast options.