0

I have found some explanation http://www.bennadel.com/blog/2379-a-better-understanding-of-mvc-model-view-controller-thanks-to-steven-neiland.htm which describes the MVC architecture.

The model is described in the following way:

The Model's job is to represent the problem domain, maintain state, and provide methods for accessing and mutating the state of the application. The Model layer is typically broken down into several different layers:

  • Service layer - this layer provides cohesive, high-level logic for related parts of an application. This layer is invoked directly by the Controller and View helpers.

  • Data Access layer - (ex. Data Gateway, Data Access Object) this layer provides access to the persistence layer. This layer is only ever invoked by Service objects. Objects in the data access layer do not know about each other.

  • Value Objects layer - this layer provides simple, data-oriented representations of "leaf" nodes in your model hierarchy.

What is the goal of the Value Objects layer? I couldn't find any good explanation...

Thanks

Community
  • 1
  • 1
grundig
  • 101
  • 2
  • 14
  • his explanation is wrong. MVC is for the presentation layer. Model–view–controller (MVC) is a software architectural pattern for implementing user interfaces. The wiki article has a good explanation of the pattern. http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller – geggleto Jan 08 '15 at 13:07
  • Pro tip: don't try to use MVC for PHP. It's just not possible. – PeeHaa Jan 08 '15 at 13:09
  • @PeeHaa and why is that? just curious – NeiL Jan 08 '15 at 13:10
  • Because there is now way for the view to observe changes in the model. – PeeHaa Jan 08 '15 at 13:21
  • @user3098423 I tend to prefer this approach: http://stackoverflow.com/a/5864000/727208 – tereško Jan 08 '15 at 14:26

1 Answers1

0

I will preface by saying I don't completely get it either, but I'll take a stab at my interpretation:

Different models are used in different parts of your code, and it sounds like here they are referring to more light weight models/objects that have no dependency on deeper parts of your project like services or the data layer. These objects are used purely for at the view/presentation layer.

Although I could be completely wrong!

EDIT: Removed the part about DTOs since it wasn't quite right.

jjardine
  • 11
  • 3