SlideShare is now on Android. 15 million presentations at your fingertips.  Get the app

×
  • Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
 

Architecting Your Models

by Project Lead, Zend Framework at Zend Technologies, Ltd. on Oct 22, 2009

  • 26,106 views

Provides some approaches to the "M" in MVC -- Models -- and how to get away from tying models to your database, and instead adopt sane approaches that provide more flexibility and forward ...

Provides some approaches to the "M" in MVC -- Models -- and how to get away from tying models to your database, and instead adopt sane approaches that provide more flexibility and forward exapandibility in your code.

Statistics

Views

Total Views
26,106
Views on SlideShare
24,098
Embed Views
2,008

Actions

Likes
71
Downloads
717
Comments
7

18 Embeds 2,008

http://sasezaki.hatenablog.com 667
http://storify.com 631
http://www.kimbs.cn 232
http://www.laplacesdemon.com 212
http://www.slideshare.net 111
http://bleroutoolkit.wordpress.com 65
http://paper.li 20
http://twitter.com 19
http://www.techgig.com 17
https://twitter.com 7
http://kbs.kimbs.cn 6
http://a0.twimg.com 5
http://www.scoop.it 5
http://coderwall.com 4
http://translate.googleusercontent.com 3
http://test.idoc.vn 2
http://tricklet.net 1
http://translate.googleuser 1
More...

Accessibility

Categories

Upload Details

Uploaded via SlideShare as OpenOffice

Usage Rights

CC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

17 of 7 previous next Post a comment

  • zlumberjay Zlumber Jay at Programmer Analyst nice :) 1 year ago
    Are you sure you want to
    Your message goes here
    Processing…
  • benjamindulau benjamindulau Hi,

    @gabreanuandrei, i'd like to add that what is so called 'domain logic' isn't limited to add behaviour inside your model classes representing the entities of the system. The business logic can live inside any class, and a service is not an exception. I think a 'well' (that's subjective) designed model layer can mix several approaches. If you take a look at Domain Driven Design for instance, you'll see that it introduces two different kind of services, one specific to the model, responsible of business operations, and being the glue between your models, and the second one dedicated to applicative code, but maybe that's the only aspect that you'll take from DDD, and you'll consolidate your approach being inspirated by other approaches radically different, and in the end, your model will be well organized, but also unique, unique for your project and unique for the business it is designed for, just like matthew pointed it out.

    I think that just opening a book and implementing your stuff exactly like it is 'right' is not necesseraly a good thing.

    At this time, i think that Matthew tried to have the best 'generic' approach he could have with the tools he had ;-)

    Today, it's not really a problem anymore since frameworks let your mind do the job !
    1 year ago
    Are you sure you want to
    Your message goes here
    Processing…
  • weierophinney Matthew Weier O'Phinney, Project Lead, Zend Framework at Zend Technologies, Ltd. @gabreanuandrei I want to point out a few things. First, this tutorial is almost 3 years old at this point. When I originally gave it, domain modelling in PHP was a fairly novel concept, and any information that moved developers away from having models directly extend objects that handled persistence (*ahem*ActiveRecord*ahem*) was a good step forward.

    Second: there are many, many valid ways to perform domain modelling. There is NOT a single correct way, however. Your choices will be informed by the project -- how big or small it is, how many developers you have, the complexity of the domain.

    Is the advice in the presentation _wrong_? I'd likely write a quite different presentation today -- but I wouldn't necessarily call the information in it inaccurate or bad. And yes, I've got a copy of Fowler's POEAA right next to me on my shelf, and have had my copy for many years. It's a guidebook, not a rulebook. ;-)
    1 year ago
    Are you sure you want to
    Your message goes here
    Processing…
  • gabreanuandrei Andrei Gabreanu, Founder at Middleout Isn't this tutorial actually bad? Based on Matin Fowler's article (and more on the web if you google) http://martinfowler.com/bliki/AnemicDomainModel.html - basically the Service should NOT contain logic at all rather than just guide the client into using the Domain Model properly but also provide a public API of your application to clients (controllers, API's, cli scripts, etc.)

    What do you think?
    1 year ago
    Are you sure you want to
    Your message goes here
    Processing…
  • gnoodl Phil Brown, Web Application Developer at IMA Management & Technology I'm curious as to how you'd separate the models from persistence when using an ORM like Doctrine.

    Doctrine seems to be engineered from the perspective that you'd be using the Doctrine_Record extending models directly.

    Cheers,
    Phil
    4 years ago
    Are you sure you want to
    Your message goes here
    Processing…
  • sdwrage sdwrage Awesome slideshow! helped me in understanding how to move more common functionality to services and keep domain models away from using the mapper and let the mapper USE the models :) 4 years ago
    Are you sure you want to
    Your message goes here
    Processing…
  • benjamindulau benjamindulau Hi,

    Interesting. I've spent time recently to implement different layers within Zend MVC.
    I have the following architecture: Controller > Facade (Service manager) > Service Layer > DAO > ORM with dependencies injection (and some experimental AOP :p).

    But i felt so alone around the forums with that stuff. The PHP developers were not ready yet to go so far.

    I'm happy that you're starting to talk about the subject and i hope that kind of architecture will be democratized and proposals will emerge soon !

    In the mean time, this tutorial should generate some interesting discussions but i don't really know where the discussion could take place (nabble, your blog ?).


    Cya,

    Benjamin.

    (I'm sorry if my english is sometime not so good !)
    4 years ago
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Architecting Your Models Architecting Your Models Presentation Transcript