99designs / ergo

A lightweight php5 library for request/response routing, controllers and http interaction.
http://99designs.com
MIT License
29 stars 4 forks source link

Break ergo into discrete components, glue components together with composer #8

Open lwc opened 12 years ago

lwc commented 12 years ago

Why?

Currently ergo is a somewhat monolithic library that provides a large portion of function for building a web application. To this end it does a pretty good job, and we use it to great effect.

Unfortunately, due to its design, it is impossible to re-use or depend on components of the library, without including the entire library. This is undesirable, and does not promote code re-use.

For example, when writing a client library for an API, it would be useful to depend on ergo/http

How?

Restructure ergo into a series of sub-libraries that are then composed into the greater meta-library ergo, something like:

It would be possible to build libraries that only require the specific parts of ergo needed This could:

harto commented 12 years ago

+1

joshbenham commented 12 years ago

+1 + ++1 + ++1

On Tue, Aug 21, 2012 at 9:46 AM, Stuart Campbell notifications@github.comwrote:

+1

— Reply to this email directly or view it on GitHubhttps://github.com/99designs/ergo/issues/8#issuecomment-7887417.

richo commented 12 years ago

:shipit:

dhotson commented 12 years ago

Yep, completely agree.

The Ergo core should be fairly limited in scope in my opinion. This suits my taste of making little libraries that do one thing well. :-)

lox commented 12 years ago

What are the components of Ergo?

It was designed to be the bare minimum for the MV part of an MVC app. There should be Routing, Controllers, Views and enough wiring for a simple application abstraction.

IMO, we should be trying to integrate the Symfony2 kernel in Ergo's place, they are rapidly becoming the defacto standards:

http://silex.sensiolabs.org/doc/usage.html

If I were to gut Ergo, I'd just rip out everything but it's containers and basic wiring. It would be truer to the name.

mtibben commented 12 years ago

Fully agree @lox

The dependency injection model of Silex/Symfony is an incredibly clean and flexible way of building a framework, and has many similarities to Python's Pyramid.