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] 2
1  Announcements and General Discussion / Architecture / Using PureMVC to build SDKs, Libraries and Frameworks on: September 03, 2015, 01:35:41
Hello Cliff,

I'm brainstorming on the architecture and how to approach building API's and Library Frameworks using Multicore PureMVC that can be linked by both PureMVC (preferably) and non PureMVC apps.

Typically ShellModule/ShellFacade can be instantiated that further instantiates other modules and plumbs them. Can you please comment on what'd be the right approach to leverage the functionality of those modules from outside the Shell and get results back from their inner workings.

Basically the intent is using PureMVC framework to build other Frameworks. Thanks.
2  PureMVC Manifold / MultiCore Version / Java Servlets with PureMVC on: July 02, 2015, 09:27:10
Hi Cliff,

Trying to get my head around implementing a plumbed multicore app with Java Servlets, wondering if there's an implementation or if you can please guide for startup mechanics. I see Servlet as Front Controller/Router intercepting requests and delegating on to PureMVC apparatus via it's Mediator. I've following steps under review.

1. Define a class implementing ServletContextListener that loads with the application server, instantiate Shell and other modules inside contextInitialized method, and plumb them followed by shell and module registration with the Servlet Context so references are available to Servlets in #2

2. Servlets are lazily instantiated and are available after ServletContext is constructed. Within each servlet's init method get reference to custom ServletContext, then reference to Shell or Modules and using a method like acceptRouter along with acceptInputPipe/acceptOutputPipe while passing this so a RouterMediator can be set upon it.

Any thoughts?
3  Announcements and General Discussion / Architecture / Bulky Modules on: June 06, 2015, 10:03:04
In context of a REST based server multicore app (node.js, express.js), the application under progress is getting bulky and complex because of too many operations involved within each module and since all these operations are related to this single entity (database entity) it doesn't feel intuitive to split them out into several submodules, (besides I've several modules already for other entities).

Starting with 4 CRUD operations (GET, POST, PUT, DELETE), for each there's an AsyncCommand with it's associated AsyncProxy. Adding PATCH support will add another couple.

On top of that some modules may require file upload, although the operation is redirected right from the RouterMediator and piped towards S3Module (Amazon S3 file storage) but then the sender module itself will require S3ResultCommand to handle results (4 kinds of results), or in other words every other module supports different actions/names and therefore requires a Command to handle those results.

Any additional requirement may force another couple of Async Command/Proxy into the module.

Every CRUD AsyncCommand (triggered from the view/RouterMediator/Router), triggers asyncAction of it's associated AsyncProxy, that pools the connection, gathers params from the body, headers, queryString etc., executes SQL, calls the the result/fault within the Proxy, releases the connection there and then responds back to the AsyncCommand so it could shuttle the results to the View layer (browser output).

So even combing above operations into fewer actors will make those actors bulky, plus there could be content negotiations factors that would require me to have different SQL calls in each actor, so I'd rather keep actors following SingleResponsibility Principle.

No problem with the View Layer though, it's pretty lightweight, a single actor ResponderMediator just listens for two notifications (RESULT/FAULT) fired from each AsyncCommands which it then outputs to the browser via Responder component.

In essence REST requirements involving several operations around each entity/resource is requiring me to have several commands and proxies for the related module and I'm not finding a way out of it.
4  PureMVC Manifold / Multicore Version / PureMVC utilities for node.js on: May 26, 2015, 01:30:35
1) Pipes
https://www.npmjs.com/package/npmvc-util-pipes

2) AsyncProxy
https://www.npmjs.com/package/npmvc-util-asyncproxy

3) AsyncCommand
https://www.npmjs.com/package/npmvc-util-asynccommand


Kudos to Robbert Streng - https://www.npmjs.com/package/npmvc
5  PureMVC Manifold / Multicore Version / PureMVC File Templates on: December 10, 2014, 09:27:53
Generated File Templates for PureMVC actors for different IDE's.

https://github.com/sshams/puremvc-templates
6  Announcements and General Discussion / Architecture / handlePipeMessage function on: October 28, 2014, 03:06:32
In a case when any module is connected to several other modules, and there's communication back and forth.

module A will receive a message from Shell.

then module A will send a request to module B and will get it's response within same handlePipeMessage.

from there, module A will then send some request to module C, and will get it's response within the same handlePipeMessage.

module B is connected to several modules and outputting on it's STDOUT, and I'm filtering based on the requester (module) name.

so handlePipeMessage of moduleA is getting complex.

What's the best workflow would you suggest in the above scenario, have separate Message types or have information like sender/receiver inside the header etc.
7  PureMVC Manifold / Multicore Version / AsyncProxy - A PureMVC / JS Utility on: September 29, 2014, 09:56:11
Based on a need to handle a series of asynchronous WebSQL or AJAX operations. Ultimate use in conjunction with AsyncCommands/AsyncMacroCommands in a sequence. Demo included.

AsyncProxy Utility
https://github.com/sshams/puremvc-js-util-asyncproxy

Demo Async Sequential
https://github.com/sshams/puremvc-js-demo-async-sequential
8  PureMVC Manifold / Multicore Version / Port to AsyncCommand - A PureMVC / JS Utility on: September 26, 2014, 03:55:37
Developed JavaScript Utility for Asynchronous Commands with a demo.

Async Command
https://github.com/sshams/puremvc-js-util-asynccommand

Demo Sequential
https://github.com/sshams/puremvc-js-demo-sequential
9  PureMVC Manifold / Port to JavaScript / State Machine Utility (using native prototype property) with LockableDoor Demo on: September 26, 2014, 12:24:27
StateMachine Utility (developed using native JavaScript Object.prototype property)
https://github.com/sshams/puremvc-js-util-statemachine

LockableDoor Demo
https://github.com/sshams/puremvc-js-demo-lockabledoor

The Demo also demonstrated a simple solution for communication between component and a Mediator that PureMVC JS community has been struggling with or have questions about, it's a Delegation Pattern in JavaScript using closures for communication between viewComponent and it's Mediator. Inspired by Objective-C Demo where the viewComponents communicates to it's Mediator via a Delegate. Have a look at the following.

https://github.com/sshams/puremvc-js-demo-lockabledoor/blob/master/js/view/ApplicationMediator.js
https://github.com/sshams/puremvc-js-demo-lockabledoor/blob/master/js/LockableDoor.js

Inside onRegister a closure was defined and is passed to the viewComponent, viewComponent only knows about functions within that closure and has no information about it's Mediator hence it's loosely coupled, that closure has reference to Mediator that can then call function of the Mediator. Closures are big and powerful in JavaScript and solved many problems.

This approach eliminates the need of any 3rd party utilities/libraries for dispatching events or Signals, you're free to use any for their benefits but my intent was to develop the demo in it's purest form and without depending upon any library, and just utilizing the power of the language and the PureMVC framework itself.
10  Announcements and General Discussion / Architecture / Multicore PureMVC with Routing on: September 23, 2014, 12:51:50
This question is in context of a JavaScript Application where angular has been employed for routing and to watch for hash changes in a browser.

Should we implement multiple routing for each submodule or implement single routing system. I'm facing some challenges with multiple routing but I see some pro's and cons for each.

A
Each submodule listen for it's own set of hash changes and acts accordingly (Added benefit is that it let's you specify it's own function calls within it's "scope" and automatic execution on hash changes, Independence etc.)

or B
Shell implements the routing system and broadcast changes via junction to all of it's submodules. Submodules listens to Routing notifications and steward viewComponents to different states or execute commands etc.

Personally I see the implementation B best though I'd lose some benefits of integrated angular benefits but I had a different case as well in a PHP implementation. A specific submodule was loaded based on the first part of the route, and then the submodule branches off and decides the operation based on the 2nd part. I was looking at my current project in the same context.

In SOAMusicPlayer, I've noticed the Browser Mediator and then it seems Shell acts on it independently without requiring submodules to do anything, but in a situation where submodules need to act as well, what's the best way to achieve from the above?

In some earlier implementations of AS3 with SWFAddress that I've seen, the routing was implemented in a proxy implying it as a data/information and in the case of SOAMusicPlayer it's a viewComponent managed by BrowserMediator. Please also expand on this.
11  PureMVC Manifold / Multicore Version / equivalent of initializeModel and initializeView in ApplicationFacade on: February 13, 2014, 02:20:40
is there an equivalent of initializeModel and initializeView in ApplicationFacade for the JS port? (http://puremvc.org/pages/docs/AS3/standard/framework_asdoc/org/puremvc/as3/patterns/facade/Facade.html)

I see a startup function in the demo examples that registers the commands and then fires the notification instead of initializeController?

https://github.com/PureMVC/puremvc-js-demo-reversetext/blob/master/src/ApplicationFacade.js

how this works out in the JS port?
12  Announcements and General Discussion / Architecture / Bidirectional Communication between Modules using Pipes on: January 26, 2014, 12:50:05
I went couple of posts under "Architecture" forum that are talking about intercore communication but I think I need more help.

I've two submodules talking to each other, let's say a login module and a social module (plus others).

For some internal reasons, the login module is separate because of it's complexity and kind of services it's paired with.

If social module is invoked/requested, it needs to first pass the authToken (encrypted username/password) to "Login" module (Login and Social modules are connected to each other via Pipes).

Login module in turn returns true (with user data) or false, and then Social can carry on forward with what it has to do.

I understand that Pipes is one-way communication but I need communication back and forth. There are no web services involved, so it's not an asynchronous call. I'm using PHP port, it checks the database synchronously and returns true (with user data) or false.

What i can think is of is that, send a message with authToken from SocialJunction to LoginJunction and LoginJunction retrieves the Proxy, calls the function, gets it result and sends a message in return, received by SocialJunction and it carries on forward from there? Please advise.

Future Needs: (if multiple types of communication back and forth, use type attribute to distinguish between type of calls, Yes???)

Also if Asynchronous calls, can you pass a function of one submodule and have it executed by the second module as discussed here under Shared Proxies. http://forums.puremvc.org/index.php?topic=2080.0
Is that what async token pattern is or what is it?

Appreciate your help.
13  PureMVC Manifold / Standard Version / Objective-C Multicore version & Pipes Utility on: December 06, 2013, 10:29:40
Any plans or ongoing work for this? Looking forward to it.
14  PureMVC Manifold / Standard Version / feature request on: September 27, 2013, 11:12:11
Hi Cliff:

Possible that if you can implement a change across all the ports in your next release, that the registerProxy function returns the proxy after calling onRegister function. Same with registerMediator, that it should return the registered mediator.

I run into a case where I had to register sub-proxies and sub-mediators inside proxies and mediators (onRegister function) and had to write additional lines to retrieve them.

I added return at the end for Facade, Model and View for registerProxy and registerMediator functions for this PHP port and wish that if it becomes part of all other ports. Any thoughts?

Regards.
15  Announcements and General Discussion / Architecture / Data Request from Components on: June 13, 2012, 12:40:29
I'm not sure, I read an example somewhere for a best strategy to implement.

For instance,

1) a component needs some data at user request (click of a button), event is dispatched.
2) Mediator in the listener function retrieves the proxy and calls the function on it.
3) Proxy makes the data request and has a handler method for the response.
4) Proxy then sends the notification once data is ready inside handler method
5) Notification is received by the same Mediator in this case, and populates the component.

For me it seems like a long trip, is there a shorter way?
Pages: [1] 2