5 Replies Latest reply on Apr 14, 2010 6:14 AM by levancho

    Value objects

    hidarikani Level 2

      I know that a RemoteObject can return a value object.

      Can it return an array of value objects?

       

      I have a LineChart and it's dataProvider is an ArrayCollection of objects. So I wonder if I can get an array collection of value objects from the server.

       

      Or maybe I have to get one VO at a time and then add it to my ArrayCollection? The last solution isn't efficient, because if the length of the array is 20 I have to make 20 HTTP requests. Looks sending around plain XML would be better, or am I wrong?

        • 1. Re: Value objects
          levancho Level 3

          Term Value Object has an abstract meaning, and might mean nothing for some developers,and have a 10 different meaning based on who you ask?

          for me to be honest, it has no meaning at all, I am used to Java terminology and used to call those "value Objects" just Beans,

          so in generall, Array can also be considered as Value Object,

          now to get to your question: absolutely yes, if your remote service returns Collection it will be translated to ArrayCollection of whatever "value Object"s it had.

          1 person found this helpful
          • 2. Re: Value objects
            JeffryHouser Level 4

            Value Objects; or Data Transfer Objects is a design pattern in which the object has no bheavior except fo the storage and retrieval of it's own data:  : http://en.wikipedia.org/wiki/Value_Objects

             

            I understand that the way developer's use design patterns in their own applications is often different, but Value Objects don't seem to leave a lot of wiggle room.

            • 3. Re: Value objects
              hidarikani Level 2

              And that's exactly how I understand them.

               

              All I can pass from PHP is this:

              class MyClass {
                   public $propA;
                   public $propB;
                   //and so on
              }
              

              • 4. Re: Value objects
                levancho Level 3

                JeffryHouser wrote:

                 

                Value Objects; or Data Transfer Objects is a design pattern in which the object has no bheavior except fo the storage and retrieval of it's own data:  : http://en.wikipedia.org/wiki/Value_Objects

                 

                I understand that the way developer's use design patterns in their own applications is often different, but Value Objects don't seem to leave a lot of wiggle room.

                Well, lets open up some can of worms ,

                so thats one source you have provided.

                 

                now look at  this source : http://stackoverflow.com/questions/1612334/difference-between-dto-vo-pojo-javabeans

                 

                Value Object

                 

                A Value Object or VO is an object such as java.lang.Integer that hold values (hence value objects). For a more formal definition, I often refer to Martin Fowler's description of Value Object:

                 

                 

                and this source:http://martinfowler.com/bliki/ValueObject.html

                is also different.

                 

                I do agree that they still share same conceptual meaning.

                anyways

                conclusion coul be that ArrayCollection can also be considered as a ValueObject and not collection of  Value Objects.

                or DTOs or Beans or DOs (Data Objects)onr maybe even POJOs but thats only relative to Java, unless we change POJO to be POAO

                I know about 5 more of those synonyms, thats why I just stick with the simple one and try to avoud uneccessary Buzz, and IMHO Value Object terminology is just uneccessary Buzz.

                • 5. Re: Value objects
                  levancho Level 3

                  from PHP you need to pass collection that means to have return type of some kind of collection so that they get deserialized as ArrayCollection on Flex side,