Skip to content

zelibobla/go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

(development is closed since ZF2 released; use my `seed` skeleton for ZF2)

Go – Zend Framework topping
===========================

ZF – is fine tools collection providing much of freedom for developing. The cost of this freedom – is much of same coding from project to project. Here is the topping I've collected for some years of using ZF.

1. Core_Model_Item
---------------------------
Basicly Zend ORM system provide Zend_Db_Table_Row classes which you can operate via public properties. Beside of incapsulation principle violation another good reason to change this is the application mobility.
If you have $my_class->color = green; in 10 different places of your code and now you need to trigger some event after color changed, what should you do? Find all these places and rewrite your code. Nothing from OOP left in this case.
In my case you just refactoring the $my_class->setColor() method to add necessary event trigger. That's all.

Another reason to do setters and getters is to prevent illegal object properties access. Since I subclassing Zend_Db_Table_Row I'll have all properties in public. But anyway I do access to all of them only through setters and getters in myself convention. This is the way I can be sure nothing changed in my object values from outside and the object itself doesn't know changes.

ZF provides ManyToMany data retrieve but not save. I've added this ability. And several other symantical sugar like Some_Model_Item::build( $primary_key = some_value ) also added.

2. User_Model_User
--------------------------
General idea about users: there are no not registered users. If user came to the site first time, system creates account for him, remember it and authenticate user under this account automatically. Later if user would like to register at the site – he is welcome, if not – system will remove his temporary account after sometime.
What is advantage of this approach? We can save anything about user activity (system messages, language settings and etc.) and bring it all into account he'll make later. So actually when user creates account he just edit his temporary account - that's all.

3. Go_Controller_Default
--------------------------
This is enhancement of Zend_Controller_Action with protected properties _user and such a needed methods like _isAllowed( resource, action ) or _notify( message ) that check user rights and push user notification accordingly.

4. Go_Controller_Crud
--------------------------
Performs all user operations under any item.

5. Core_Model_Notification
--------------------------
Any user notifications are being handled via this entity.

About

ZF1 application skeleton

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published