Jump to content

Recommended Posts

Hey Guys. I am learning about the Enterprise pattern, and to me it seems like its the same as the MVC pattern (which I learned about)

Do they work the same??

 

For those who know Martin Fowler's Patterns of Enterprise Application Structure, that is what I am referring to as the enterprise pattern

Edited by eldan88
Link to comment
https://forums.phpfreaks.com/topic/291607-mvc-vs-enterprise-pattern-php/
Share on other sites

From a book I read by Larry Ullman that MVC isn't really a true "pattern"  (He said it, I didn't so I don't want people coming down on me  :happy-04: ), so I guess the Enterprise Pattern could be MVC though I haven't gotten that far in another book that I'm reading about OOP. But I'm sure some guru here will answer this question better.  ;D

There is no singular enterprise pattern. I mean, really, it says so right in the title of the book: Enterprise Patterns.

 

And, despite what Larry Ullman says, MVC is most definitely a pattern. It's a bit looser in the world of web development than application UI development, which is where it originated from, but, yes, it's a pattern.

 

The thing about patterns is that they're not mutually exclusive. It's not a matter of MVC OR something from Fowler's book. And, yes, patterns often have some overlap, or are otherwise similar in their execution. That's part of the point of patterns - they're generalized, and often can be used as the springboard to other patterns. They're also used in conjunction (MVC where the models are based on the Active Record pattern? What madness is this? :P ).

KevinM1. Oh okay I see what you are saying. I was reading about  enterprise patterns in the book you actually recommeded me to read... (PHP Objetcs, Patterns, and Practice by Matt Zandstra) and the layout just looked very similar to your typical MVC structure..

Most books that talk about design patterns lift the format that was used in the original Gang of Four book, where they describe the problem, show the pattern that addresses it, and any related patterns and/or things to keep in mind. Regarding the code, what you're seeing are SOLID principles at work (look up what SOLID means in the context of OOP). The code will look similar because the separation of concerns and favoring composition over inheritance, among other things, are OOP staples.

 

So, combine the two, and you'll find that design pattern books are very samey. It doesn't mean that the patterns are necessarily the same or similar (although a lot of them do follow the same themes and build off one another), just that while you're learning about individual patterns you're actually also learning about how professionals attack problems in a larger, more meta sense.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.