topleft topright
  PureMVC Forums

Welcome, Guest. Please login or register.
September 02, 2010, 07:48:13 AM
Home Help Search Login Register
News: ATTENTION: Spambots must die! Humans must visit http://contact.futurescale.com to request forum access.

Pages: [1]
Print
Author Topic: quick VO clarification  (Read 1609 times)
akastar
Newbie
*
Posts: 4


View Profile Email
« on: January 04, 2009, 04:31:27 AM »

is it good practice to expose a VO to a views?

i.e the proxy manager finds a userVO via some ID and passes that userVO to the View where the view can unpack the name and password etc or is it better that the proxy manager keeps everything on its side and keeps the VO away from the view and passes the name and password.

thanks
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2366



View Profile WWW
« Reply #1 on: January 04, 2009, 11:54:11 AM »

Certainly do expose value objects to your view components. The primary benefit of a value object is to act as a data carrier to shuttle data across the tiers of your app.

The VO represents the domain model at its purest, client-side form. And the view has no other purpose than to expose this data to the user, and allow them to interact with and somtimes update it.

But while the view needs to know about the data, we are still trying to separate out our responsibilities into M,V & C tiers, each of which needs to understand the data without knowing too much about each other. So the VO can be thought of as the extend of their shared knowledge about the domain.

That said, obviously its a good thing to work out your  domain model first, since constant churn in VO definition can cause you to be changing code all over the app across all tiers. The domain model is a cross-cutting dependency that is impossible to minimize.

Hope this helps,
-=Cliff>
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2366



View Profile WWW
« Reply #2 on: January 04, 2009, 11:56:19 AM »

Also, have a look at the Flex EmployeeAdmin demo for an example of how to use VOs (and Enums) in this way.

-=Cliff>
Logged
Pages: [1]
Print
Jump to:  



Login with username, password and session length

Powered by SMF 1.1.11 | SMF © 2006-2007, Simple Machines LLC
Copyright © 2006-2008 Futurescale, Inc.