Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought

Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Show Posts

| * |

  Show Posts
Pages: [1]
1  Announcements and General Discussion / Public Demos, Tools and Applications / Flex client and Google App Engine server on: August 23, 2008, 08:47:38
I've published a sample application that shows how a Flex client can use a Python service hosted in Google App Engine to create, read, update and delete objects. The Flex application is built with PureMVC.

I hope it can help people learning these tools and techniques. Also, feedback on how to do things better is most welcome.

The source code is hosted on github so anyone can easily fork it. I also authorize it to be included in the PureMVC samples area if it is deemed good enough for this.

More information here:

2  Announcements and General Discussion / Getting Started / Sample project with Google App Engine on: August 13, 2008, 05:53:23
I've been working for some time on a sample application with a Flex client and a Google App Engine service. It is based on a PureMVC example, but with many modifications.

This sample application is able to show, create, edit and delete projects and also project participants.

Although I still plan to improve it to learn about other approaches, it is already working and maybe it can help others learn about PureMVC, Flex, Python, GAE or PyAMF.

The source code is hosted on github:

I've also been publishing several articles describing the approach I am taking:

I hope this helps. Feedback is welcome.
3  Announcements and General Discussion / Architecture / The role of value objects on: July 30, 2008, 05:56:13
I am really liking PureMVC a lot. It is clean, well thought-out and very flexible.

As I learn it, I still have some doubts about the role of Value Objects in its architecture. For instance, there is a post (http://forums.puremvc.org/index.php?topic=243.0) where Cliff says:

Value Objects should be just that, carriers for data. Proxies should generally have the methods that massage that data, translate it or simply expose it to the app.

The main reason for only having attributes on a value object is that it is intended for shuttling data across tiers of an application.

That includes across client and server tiers. When marshaling and unmarshaling an object into a transfer format like XML, you can only send values. The methods wont go, or necessarily even make sense on the other side.

OK... First of all, in the Employees example, the UserVO is not a pure Value Object in this sense. It has two methods: isValid() and givenName(). So it is more like a Domain Object, which seems to be benefic to the application.

Next, the quote describes a Value Object as a Data Transfer Object that should only contain data, not any behavior, and that will be shuttled between application layers, including between client and server.

Now, it seems I can easily use an anonymous object as a DTO between the client and the server. It also seems that the client application should not be too tied to the way the server represents the data. I would consider the DTO as a kind of calling protocol to the service, that could possibly require conversion to data types more adequate for a client application. Again, it seems odd that a view component would receive the same DTO that would be returned by a remote service.

Let me try to clarify my thoughts with an example.

A "Project" entity could have a "Manager" attribute. That could be represented by an integer key on the service. But on the client I would like it to be an instance of a Manager class, not just an integer. Or at least to have also the manager name, that I would retrieve from another proxy, so it would be easier to sort on grids by the manager's name.

I also could want my project objects to have a collection of milestones. In the service that would be represented by another DTO for the Milestone entity, that would probably have the integer ID of the project and a milestone name and due date. But I would like my client-side project object to have a collection of milestones.

I also could want to go full domain object on this, and have the client-side behavior associated to the project on the project object itself, like the sample does with the User object.

I've read the best practices document three times, read all the other documents I could find on this site, downloaded and browsed the examples, created my own sample application (http://fernandoacorreia.wordpress.com/2008/07/30/flex-client-using-puremvc/), read all articles I could find in blogs about PureMVC, but it is still not very clear to me how we can deal in PureMVC with a database-based scenario like I described (Managers <-> Projects <-> Milestones) and how we can have a client-side abstraction of this objects that is not too restricted by the service interface.

Actually I am not certain if this strategy of using a VO and putting the instance behavior on the proxy is a definite best practice on PureMVC or if it is just a convenience. That is, would I run into trouble if I decided to use anonymous objects as DTOs to the server, use domain objects with attributes and instance methods within the client and kept in the proxy only the methods common in the Repository pattern, like CRUD methods?

The only possible complication I can think of is that the view components would be able to call the methods on the domain objects and that could break the isolation. Then again, that's exactly what the Employees example does with the isValid() and givenName() methods of the User "Domain" object...  :o

Any help will be appreciated.
4  Announcements and General Discussion / Getting Started / Learning application documented and published on: July 30, 2008, 04:51:21
I am learning PureMVC and I hope to use it to build a Flex client that will talk to a Python service hosted on Google App Engine.

I am documenting the progress in my blog:


The source code of the application is published too.

This is not a full-blown example yet because it is a work in progress and I still have to learn a few best practices. If and when I get it done I will offer it to the samples gallery.

Feedback is most welcome. Specially, now I must consider how I will deal with a "has many" relationship: a project has many participants.
Pages: [1]