-- Simon Walter <[email protected]> wrote
(on Wednesday, 13 April 2011, 01:43 AM +0900):
> On 04/12/2011 11:30 PM, Matthew Weier O'Phinney wrote:
> > -- Simon Walter<[email protected]>  wrote
> > (on Tuesday, 12 April 2011, 08:49 PM +0900):
> > As for ZF2 MVC, I'm currently in the middle of writing the proposal for
> > MVC implementation (I wrote a proposal for the interfaces a couple
> > months ago). And at this point, I'm targetting at least two
> > implementations: a version that mostly mimics ZF1 behavior, and another
> > that utilizes several new features, including the EventManager and a
> > Dependency Injector/Service Locator system.
> The event manager might be something I'm interested in for this app.
> In one of your articles you mention gearman. Are there any proposals
> to use gearman with ZF2?

The EventManager and Gearman are two very separate, very different
things. The EventManager is used to allow code to trigger events and/or
listen to interesting events and respond; another goal is to allow
altering execution flows based on the results of events triggered. This
ia a new component for ZF2.

Gearman is a standalone daemon that provides infrastructure for
asynchronous event (jobs, in Gearman) management, and lives outside PHP.
PHP has an extension available that allows you to both create Gearman
jobs as well as attach handlers to them using PHP. Gearman is available
to all flavors of PHP versions 5 and up via PECL.

> > You can likely use the MVC as it stands now, but be aware that there
> > *will* be some big changes coming in the very near future.
> Does that mean I can use the ZF1 behaviour implementation or I can
> use the one with the new features (EventManager, etc)?

Right now, the ZF1 MVC is still mostly intact. However, the current MVC
milestone is yet to be implemented (prototypes are well under way, as
are proposals), and as such, if you build on the current code base,
you may have major refactoring to do later.

> > Our goal is a working version of the MVC by the end of May (if we can),
> > a beta during the summer, and GA by end of year. Personally, I wouldn't
> > start writing anything in earnest using the MVC until we get the working
> > version ready.
> I see. Will the difference between the new MVC and the current ZF1
> style be simple enough to port over. I don't know if I want to delay
> the app till the end of the year, but perhaps I'll be able to use
> most of what I've written for ZF1 with the new MVC without much
> hassle.
> 
> Would it be a good route to take? Write for ZF1 now and use ZF2 when
> it is ready or BETA? I would not mind debugging and testing ZF2 if
> it's ready for that.
> 
> Almost all of the app will be modules. Are there significant changes
> to the bootstrap and module loading in ZF2?

Again, we're still finishing up the proposal for the ZF2 MVC. While we
are retaining a goal of having a reasonable migration path from ZF1 to
ZF2, I still don't know what that will look like, nor how hard it will
be to do for end-users. 

If you need to start working on a project now, I have these guidelines:

 * Write your domain logic now, test it well, and make sure it's solid
   and forms the core of your application. Have as little logic as
   possible in your controllers.

 * Use namespaces, and, more importantly, import aliases to make
   refactoring simpler.

    use Zend_Acl_Role as Role;

    // becomes, later:

    use Zend\Acl\Role;

   This simple practice will likely save you a ton of time. Do this for
   any ZF1 classes you use.

 * Rely on configuration when possible. Likely you'll be able to
   refactor the configuration to use with the proposed Dependency
   Injection Container, giving you some forwards compatibility.

-- 
Matthew Weier O'Phinney
Project Lead            | [email protected]
Zend Framework          | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to