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 / General Discussion / Re: PureMVC is time-wasting code on: November 04, 2008, 11:15:38
Cliff,

Campaign speech editor... that's one for the elastic compute cloud.

They are using PureMVC.

-- Mike
2  Announcements and General Discussion / General Discussion / Re: PureMVC is time-wasting code on: November 03, 2008, 02:13:42
Here is my response so far. It's meager given the accusations but I'm very busy. Comments are much appreciated:

- PureMVC is data-driven > I don't agree. MVC came out of Smalltalk; about as object oriented as a  programming language was ever designed to be non-data-driven. MVC decouples the view from the model. I think you are confusing data brokering with MVC. Data brokering decouples the business objects from their possible data sources.  We use WebORB and nHibernate to manage this side of the decoupling problem.

- Poor Domain Model > Again I disagree. I see nothing in the framework that enforces the use of VOs for all business objects. We use VO's for hydrating BOs and then based on security and client side performance issues we decide just how much more behavior we deploy to the client's well-formed BOs. Sometimes a VO is all that needed and then I'd agree that the application is somewhat data-driven. Although you can push all the domain logic of a BO into simple and complex Commands, you don't have to. We do and don't based on a balance between decoupling and encapsulation.

PureMVC has to admit to the complexity of web applications and therefore puts objects into the framework like the VO that can cause one to see it as data driven. I see the framework as data agnostic. After reading and re-reading the Best Practices, I modify the framework to meet my data brokering needs. If you look at the WebORB codegen of PureMVC AS code you will see their bias, but since they give you access to the XSLT you don't have to live with that bias.

- PureMVC is centralistic > I'm not sure what you mean by this.  I'll just need you to be more specific. In case you are talking about deploying the Flex through a browser or as an Adobe Air app, we see no reason to believe that PureMVC would cause a problem here.

- Out[side] of AS/Flex [event model] > I've seen a lot of bad object oriented code, but some of the worst has been written in Flex/AS right here in my company. This code bound the UI so tightly to the business objects that we had to abandon the code once we tried to expand it for a similar flex-editable product. Had that programmer worked within the PureMVC framework he may have had a fighting chance to see how to decouple the UI from the business objects. One of the things I like most about PureMVC is how richly and rigorously it deals with events. I'd suggest that you read page 13 of the PureMVC Best Practices or read this post by the author of PureMVC http://forums.puremvc.org/index.php?topic=60.0.

PureMVC, like WebORB is a powerful framework. It deserves a much hard look that you've obviously given it. Please read the Best Practices document. I'll be happy to give you a Flex/AS code base that uses the PureMVC, WebORB, nHibernate and nUnit. Please review this code and tell me how you think it could be improved by discarding PureMVC.

Thanks.

-- Mike
3  Announcements and General Discussion / General Discussion / PureMVC is time-wasting code -NOT on: November 03, 2008, 12:19:42
Hi All,

In our company we use PureMVC for all our Flex projects and I strongly recommended it to a contract programming firm that I've hired to build a Flex application. This app has a call to a database when it fires up that hydrates some objects and then a call when it shuts down to update dirty objects otherwise it is mostly client side graphic object generation and movement. I'd like to hear what others here have to say about why they don't wish to follow my advice. Here is what they said:

There are two existing widely used Flex architecture frameworks:
- Cairngorn
- PureMVC
We choose to not use them guided by the following aspects:
- Both of them are very data-service oriented as they are designed to work with database CRUD functionallity applications. This is not the case as this is a document editing application.
- Have a poor Domain Model witch is based only on Value Objects (a DTO Flex renaming), all the domain logic must be on Controller Commands or in the server side data-service handler.
- They are centralistic. This means that they are designed to work at application level for the event flow. This may not be desiderable as application widgets may be separated later for the creation of the document viewer.
- Specifically PureMVC is designed to work "out" of ActionScript / Flex envirioment as it tries to be more general and be implemented on many other languages. As a downside it does not use the databinding capabilities of AS3, but using a Mediator object beetween the view and the model. This is just time-wasting code.
4  Announcements and General Discussion / General Discussion / Re: Flex integration to WebORB .NET code gen on: October 30, 2008, 11:12:09
Hi Cliff,

I'm not the best one to ask about the XSLT being current with PureMVC.

WebORB code gen creates classes that I discard; facade and mediator. I think it should just concern itself with the model and leave the V and C to the Flex developer. I'm using the WebORB/nHibernate to support the model side. I'd expect WebORB to create the Command, VO and Proxy. I would like it to create more of the grunt-work of the VO, Proxy and Commands. In the next few weeks I may add to the XSLT and I'll post my changes to this thread if and when I do.

I look forward to hearing what you learn from the author. Pass along my thanks. I really like WebORB and the code gen.

-- Mike
5  Announcements and General Discussion / General Discussion / Flex integration to WebORB .NET code gen on: October 28, 2008, 10:21:10
I'm starting to use the WebORB PureMVC code gen for Flex (-type 8). I was surprised to get a Facade and a Mediator generated.

There is nice WebORB/Flex example project here: http://www.adobe.com/devnet/flex/articles/flextodotnet_remoteobject_04.html
This is a decent article on the generator:
http://www.adobe.com/devnet/flex/articles/code_generator.html

WebORB uses XSLT to generate this stuff. The XLST is in the /weborbassets/codegen dir.

Does anyone have any best-practices advice on this code gen or an XSLT code gen they like better?

-- Mike
6  Announcements and General Discussion / General Discussion / Rogue Development's ObjectHandles on: June 27, 2008, 08:11:30
Hi,

I'm developing using ObjectHandles and am wondering if anyone
has pointers for propagating events to MVC view components that are
contained in ObjectHandles. Right now I've got it working by
implementing an ObjectHandlesMediator that listens for
ObjectHandleEvent.OBJECT_SELECTED events and handles them, but I run
into some ugly code when I go to get the child object. It's mixed in
with eight ImageHandle objects. I'm thinking I should subclass
ObjectHandles and make it more specific to my uses. Any suggestion
would be appreciated.

-- Mike
7  Announcements and General Discussion / General Discussion / Re: prana framework on: June 14, 2008, 09:54:51
This repo has a PureMVC sample app:
https://prana.svn.sourceforge.net/svnroot/prana prana
Look in the prana-projects-0.5.zip.
-- Mike
8  Announcements and General Discussion / General Discussion / Re: prana framework on: June 10, 2008, 08:18:32
Hi Ryebrye,
Is there any way you could take the CafeTownsend example and retrofit it with a Prana implementation?
-- Mike
9  Announcements and General Discussion / General Discussion / Re: prana framework on: June 03, 2008, 01:30:20
Cliff,

That finally got it through to me. Thanks so much for your gracious persistence.

I missed the CodePeek demo. I'll go find it and look at the XML Database utility.

About my data-driven comment; I was seeing a lot of hollowed out Proxy/BOs and a cloud of behavior commands that make them responsible to the business. I see it differently now.

-- Mike
10  Announcements and General Discussion / General Discussion / Re: prana framework on: June 01, 2008, 09:07:17
Cliff,

Thanks for your reply and the link to the other post. Both were very useful.

Bear with me as I put my thoughts and confusion in terms for which I'm more familiar. I am up against my own biases from having built many fat clients in Smalltalk. I'm trying to move this knowledge into a Flex/AS3 pureMVC application that will have many view components and many data sources (some under our control and some under our customer's control). As I read your post I can't help feeling data-driven. I've always liked Wirfs-Brock's responsibility-driven OO design because it focuses behavior and let's data follow.

In pureMVC I see two main frameworks:
- MVC
- Data Broker
Where MVC keeps the business logic out of the view and the data broker keeps the primary keys and other data artifacts out of the Model or Business Objects (BOs). The BOs are the primary focus of business logic encapsulation, polymorphism, inheritance and delegation.

Data Broker - This framework has two parts. The brokers and the well formed business objects. The data for the business objects could come from a variety of sources, mulitple relational tables, XML heirarchies, etc. and the broker hides this sausage factory of turning that data into a well formed business object. For example, when it is time to persist the BO, it turns to the broker to put all that state to rest in relational table, XML files, etc. The primary keys of the relational world never make it across into the BO. So I'd like to put the data broker behavior/responsibilities into the DOs and the BOs into the Proxies.  This must bear in mind that as your Best Practices points out that Proxies can be of various kinds. This kind being for the encapsulation of business logic (business behavior/responsibilities).

MVC - The Controller is the place where view related state and logic live that do not belong in either the View or the Model (BOs). For example, Bank Account (a BO) has a balance. When the balance goes negative we want the value in the View to change from black to red. The BO should not know red from black because that's view related. Nor should the view be wired with the logic that would change the color based on the Account's balance. Therefore the Controller has the responsibility for knowing about color changes with repect to the Accounts's balance. We get the reuse of this logic across multiple views because the Controller is the one place that can see both the View and the Model. In pureMVC, I'm left with putting this behavior in a command or a mediator and am not sure where.

Finally I'm still not convinced that the Command is "the home of your application's business logic" as stated on page 5 of the Best Practices doc. I'd put that logic, whenever possible, in the Proxy as a way of building a well-formed BO.

Please don't think that I'm being argumentative or esoteric. I'm simply trying to get my understanding in-line with your framework before I and others in our company do more coding in the PureMVC. Thanks.

-- Mike
11  Announcements and General Discussion / General Discussion / Re: prana framework on: June 01, 2008, 01:08:38
Cliff,

Thanks for you reply. I'm probably going to take a hard look at Prana in about two months. I'm interested in using dynamic namespace declarations for increasing semantic richness and discrimination. Right now I'm moving ahead with just a pure pureMVC. BTW, I'm really enjoying this framework. I used to work for Digitalk (Smalltalk).

In your Best Practices writeup (nice work) I'd like a gut-level example of the difference between Business Logic and Domain Logic. If you do a search on the difference the first paragraph of the top listing seems to go against your usage of these terms:
http://martinfowler.com/articles/dblogic.html
I think of domain as part of the problem domain. I'm wondering if domain is about marshalling data into well formed business objects, but then why not allow these objects to embody their own behavior. It seems to me that a complex application would end up with a lot of decapsulated behavior as command objects. Isn't this getting onto a slippery slope of dumb data objects and procedural code snippets. Obviously you would do your best to name these command objects in such a way as to aggregate them, but this is a weak convention compared to keeping them with their business objects. I'm sure I'm missing your point. I hope you'll enlighten me. BTW, if you have already answered this, and I bet you have, please just give me a link to it and save your valuable time.

-- Mike
12  Announcements and General Discussion / General Discussion / prana framework on: May 29, 2008, 07:55:29
Just a little bit of meta info for the reader. The first 5 or 6 posts are about MVC and Data Broker and then a really good post follows about the Prana Framework and PureMVC. -- Mike.

Hi All,
A friend suggested that I look at the Prana Framework (pranaframework.org) and I have, but before I put more time into this, I was just curious to know if anyone can recommend prana?
Thanks for any insights.
-- Mike
BTW, on the home page, there is a prominent declaration that the framework is PureMVC compatible and when I look at the code, I see a corresponding set of code.
13  Announcements and General Discussion / Getting Started / Re: Flex event won't propagate from toolbar to canvas on: May 23, 2008, 05:34:30
Thanks for the clarification Cliff. I didn't mean to delete the original comment. I just don't know how to work with this forum yet. I'm really appreciative of this framework.  -- Mike
14  Announcements and General Discussion / Getting Started / Flex event won't propagate from toolbar to canvas on: May 22, 2008, 03:24:53
Hi,

I think I figured it out. The event that I'm emitting in the Toolbar (xmxl) doesn't seem to have anything to do with the INotification propagation. So I wired up the button event to a notification handler in the toolbar that turns around an sends a Create_Text notification that is seen by the canvas. This make sense. Anyway, I wanted to post this ASAP so people didn't spend time on it. Thanks.

-- Mike
Pages: [1]