Quantcast

Quickstart Guide Model Programming Paradigms

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Quickstart Guide Model Programming Paradigms

Tom Shaw-4

Following the example Model programming patterns found in the Zend Framework Quick Start, Domain Model, Data Mapper, Table Data Gateway. My question is, to adhere to the rules of all three

programming patterns where should your miscellaneous functions like checkEmail() or updateAccess() be placed? My guess is but I want to be 100% certain is follow the exact same rules

as the base functions getId() fetch() fetchAll() are using, by placing reference functions in your Domain Model that refer to the actual function in the Data Mapper. My last question is what kind of functions would you typically use in your Table Data Gateway when using all three programming paradigms.

 

Thanks

 

Tom Shaw

[hidden email]

214-275-4326    

 

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Quickstart Guide Model Programming Paradigms

Jurian Sluiman
Hi Tom,
I don't understand your first question well, but nevertheless I'll try to answer. The function checkEmail() sounds very like an input validator. You can use Zend_Validator to validate email against it. Better: use Zend_Form for input and attach the validator to your input field. Now the validation is done even before you're speaking about the domain model or data mapper.


For table gateway functions: adding some more data during insert or update (timestamps and/or user id's) are typically things you want to do in the datamapper. The quickstart used to have such an update method.


R, Jurian
--
Jurian Sluiman
Soflomo.com


Op Tuesday 12 May 2009 18:29:32 schreef Tom Shaw:
> Following the example Model programming patterns found in the Zend
> Framework Quick Start, Domain Model, Data Mapper, Table Data Gateway. My
> question is, to adhere to the rules of all three
>
> programming patterns where should your miscellaneous functions like
> checkEmail() or updateAccess() be placed? My guess is but I want to be 100%
> certain is follow the exact same rules
>
> as the base functions getId() fetch() fetchAll() are using, by placing
> reference functions in your Domain Model that refer to the actual function
> in the Data Mapper. My last question is what kind of functions would you
> typically use in your Table Data Gateway when using all three programming
> paradigms.
>
>
>
> Thanks
>
>
>
> Tom Shaw
>
> [hidden email]
>
> 214-275-4326

Loading...