Approaching unknown unknowns: CMF for the masses

41
Approaching unknown unknowns - CMF for the masses -

description

A brief informal presentation about CMF design at the Rome PHP User Group.

Transcript of Approaching unknown unknowns: CMF for the masses

Page 1: Approaching unknown unknowns: CMF for the masses

Approaching unknown unknowns- CMF for the masses -

Page 2: Approaching unknown unknowns: CMF for the masses
Page 3: Approaching unknown unknowns: CMF for the masses

The problem™

Page 4: Approaching unknown unknowns: CMF for the masses

The problem™Too much work

Page 5: Approaching unknown unknowns: CMF for the masses

The problem™Too much work

The solution™

Page 6: Approaching unknown unknowns: CMF for the masses

The problem™Too much work

The solution™Work less

Page 7: Approaching unknown unknowns: CMF for the masses

 Be  lazy

Page 8: Approaching unknown unknowns: CMF for the masses

Don't reinvent the wheel

Page 9: Approaching unknown unknowns: CMF for the masses

Technologic stack:php

mysqlapache

symfony 1.4

Page 10: Approaching unknown unknowns: CMF for the masses

Why not Symfony2?

Page 11: Approaching unknown unknowns: CMF for the masses

Why not Symfony2?

Sf2 is not ready for production.

Page 12: Approaching unknown unknowns: CMF for the masses

We are

Page 13: Approaching unknown unknowns: CMF for the masses

N customers express theirselves in one

way:

The Web

Page 14: Approaching unknown unknowns: CMF for the masses

So you need a tool to express N domains into the web.

That is called CMF.

Page 15: Approaching unknown unknowns: CMF for the masses

How do the CMF and the customer

domain (DSL) talk?

Page 16: Approaching unknown unknowns: CMF for the masses

How does the CMF is bound with the DSL?

There is a hierarchycal Tree.Containing N Pages.Pages use nested sets.

Every page containing N Boxes.Each box containing its Content.

Page 17: Approaching unknown unknowns: CMF for the masses

How does the CMF is bound with the DSL?

Dependency inversion:the CMF doesn't know anything about the DSL

Page 18: Approaching unknown unknowns: CMF for the masses

How does the CMF is bound with the DSL?

Each box has a content:the content is an instance of ConcreteBox

Page 19: Approaching unknown unknowns: CMF for the masses

The system is pluggable.

Permissions are an example:

Page 20: Approaching unknown unknowns: CMF for the masses
Page 21: Approaching unknown unknowns: CMF for the masses

Abstraction over abstraction over abstraction over abstraction over

abstraction....

Page 22: Approaching unknown unknowns: CMF for the masses

So our well-dressed CMF will finally look like...

Page 23: Approaching unknown unknowns: CMF for the masses
Page 24: Approaching unknown unknowns: CMF for the masses

Solution:a spaghetti coder +

memcached V2.0 +

ANSI C

=

Page 25: Approaching unknown unknowns: CMF for the masses

RedisA fast in-memory key-value storage engine written in ANSI-C.Supports clustering, stores data like PHP arrays, writes to disk.

Instead of memcached 2.0 we can call it memcache 100.0

Page 26: Approaching unknown unknowns: CMF for the masses

F***YEAH!

We have NoSQL, we're on the edge!

Page 27: Approaching unknown unknowns: CMF for the masses

MySQL talks to Redis

Page 28: Approaching unknown unknowns: CMF for the masses

Cross-DBMS transactions

Page 29: Approaching unknown unknowns: CMF for the masses

Redis is gently asked by the front-end

Page 30: Approaching unknown unknowns: CMF for the masses

So this...

Page 31: Approaching unknown unknowns: CMF for the masses
Page 32: Approaching unknown unknowns: CMF for the masses

...becomes this...

Page 33: Approaching unknown unknowns: CMF for the masses
Page 34: Approaching unknown unknowns: CMF for the masses

F***YEAH!²

We use NoSQL, and we have a reason!

Page 35: Approaching unknown unknowns: CMF for the masses

A few other points:

Page 36: Approaching unknown unknowns: CMF for the masses

Intensive loggingIf a transaction fails, we

need to know if it has failed due to MySQL or Redis.

And then why.

Page 37: Approaching unknown unknowns: CMF for the masses

REST vs SEOGET /products/1

orGET /products/ferrari-f3000

Page 38: Approaching unknown unknowns: CMF for the masses

REST vs SEOGET /products/1

orGET /products/ferrari-f3000

MIX'EM! GET /products/ferrari-f3000-1

Still REST, still SEO!

Page 39: Approaching unknown unknowns: CMF for the masses

Thanks!Alessandro Nadalinodino.orgtwitter.com/_odino_

Page 40: Approaching unknown unknowns: CMF for the masses

Last but not least!

Page 41: Approaching unknown unknowns: CMF for the masses

Creditshttp://www.flickr.com/photos/whatknot/13198827/sizes/o/in/photostream/

http://www.flickr.com/photos/donnagrayson/195244498/sizes/o/in/photostream/http://www.flickr.com/photos/sakechaud/4452392482/sizes/o/in/photostream/http://www.flickr.com/photos/gamergates/3461154165/sizes/o/in/photostream/

http://www.flickr.com/photos/14060551@N06/3050235141/sizes/l/in/photostream/http://www.flickr.com/photos/33246833@N00/4353212216/sizes/o/in/photostream/

http://www.flickr.com/photos/jurvetson/36572011/sizes/o/in/photostream/http://www.flickr.com/photos/htcfloorsystems/4008090894/sizes/o/in/photostream/

http://www.flickr.com/photos/mlleglass/491378611/sizes/o/in/photostream/http://www.flickr.com/photos/rhymereverie/2253533697/sizes/l/in/photostream/http://www.flickr.com/photos/spunkinator/3050946547/sizes/o/in/photostream/

http://www.flickr.com/photos/725/3524480344/sizes/l/in/photostream/