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

Pages: [1]
Print
Author Topic: Multicore questions  (Read 10186 times)
openoli
Full Member
***
Posts: 44


View Profile Email
« on: February 07, 2013, 01:12:16 »

Hi,
I'd like to move from standard to multicore version.
After reading a lot of posts in this forum and some blog articles I've got more and more questions.
Simply changing the flex project from standard to multicore seems easy.
But unterstanding the wohle concept and transfer it to my application to get an handsome architecture seems not so easy.
Perhaps there's anybody out there who could ligten me ;-)

I'm building a tab based flex application, here're my questions:

1) More than one shell core inside a multicore project?
There is a skeleton with some navigation buttons and common functions.
In multicore context this would be the 'shell', right?
Inside this 'shell' the user could open different tabs wich will be place inside a view stack.
A tab is like a module and provides different views with different functionalities and it's own tab related navigation. Should be each tab have it's own shell core? Or should each tab 'submodule' including the tab skeleton be represented by a core?

2) How granular-> how many cores in a multicore project?
I've read one benefit using multicore is to be able to create unit tests in a proper way.
But what should we define as a unit, my understanding is that one core represents a unit.
Within an application there could be tons of functions, modules, submodules... units after all.
As a result of this we would have tons of cores inside a project. Is there a limitation for the number of cores inside a project?

3) Shared proxies
In my application each tab has references to same proxies.
E.g. one tab provides a userlist and another tab displays detailed informations of one user. So both tabs have a reference to the 'UserCollectionProxy' and both could manipulate the proxy. How this works with the multicore version? Should this be done by using pipes?
I know the best way is to have 100% encapsulated modules, but I think this doesn't work in real life!?

4) 'Dynamic' cores
To make sure that each view/mediator inside a tab handles the right notifications I make an extensive usage of notifications type parameter by passing an unique id with it. Sometimes this is a bit confusing.
Is it right that by using the multicore version I'll don't have to pay attention to this cause within multicore each core have an unique id?

5) EmployeeAdmin multicore demo?
For me it would be helpful if the EmployeeAdmin demo would be available as multicore demo.
Are there any examples like this out there?

Many many thanks for reading this and sorry for my bad english;-)

Kind regards
Olaf





Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: February 07, 2013, 08:42:24 »

1) More than one shell core inside a multicore project?
There is a skeleton with some navigation buttons and common functions.
In multicore context this would be the 'shell', right?
Inside this 'shell' the user could open different tabs wich will be place inside a view stack.
A tab is like a module and provides different views with different functionalities and it's own tab related navigation. Should be each tab have it's own shell core? Or should each tab 'submodule' including the tab skeleton be represented by a core?
It all depends. Will each tab be massive, really different, and possibly only loaded sometimes? If so, probably make it a core of its own. But that's not the only reason to make something a separate core. Even if every section will be loaded each time, sometimes it's just easier to have each section be a core of its own because it simplifies the overall app. Inside a core, you usually only have to deal with the stuff in that core. This makes it easy for you to split the functionality across teams. You can have different teams working on different cores. Also, to answer the other question here, only one shell exists - the main app.

2) How granular-> how many cores in a multicore project?
I've read one benefit using multicore is to be able to create unit tests in a proper way.
But what should we define as a unit, my understanding is that one core represents a unit.
Within an application there could be tons of functions, modules, submodules... units after all.
As a result of this we would have tons of cores inside a project. Is there a limitation for the number of cores inside a project?
No, for unit testing, you don't have to have the core be the 'unit'. The benefit of MultiCore for unit testing is that with each test in the test suite, you can create a NEW facade for testing. With Standard, each test uses the one and only Facade, so you can't get back to a clean slate for the next test. You can test whatever you want. Look at the MultiCore framework unit tests to understand this better.

3) Shared proxies
In my application each tab has references to same proxies.
E.g. one tab provides a userlist and another tab displays detailed informations of one user. So both tabs have a reference to the 'UserCollectionProxy' and both could manipulate the proxy. How this works with the multicore version? Should this be done by using pipes?
I know the best way is to have 100% encapsulated modules, but I think this doesn't work in real life!?
Yes, this absolutely works in real life or there'd be no point in doing a modular approach at all!

The only thing that needs to be shared is data object classes and 'protocol' classes - i.e. custom message types.

All you have to change is your thinking. Don't have multiple cores 'share' a proxy, make a separate core (or cores) for talking to the service(s) and send that core a message (if you're using pipes to comm between cores) or invoke a method (if you're using interfaces and core references for comm). So your service core is the only one that has the proxy. Send it a message that says, give me the user list, and the core receives the message, executes a command to figure out what you're trying to do, and manipulates the proxy to make a call. It should use the async token pattern to remember what it was doing so that when the service responds, it can trigger a command that sends a message back (if using pipes) or calls a method on the other core (if using interfaces) to get the data back to the caller.

4) 'Dynamic' cores
To make sure that each view/mediator inside a tab handles the right notifications I make an extensive usage of notifications type parameter by passing an unique id with it. Sometimes this is a bit confusing.
Is it right that by using the multicore version I'll don't have to pay attention to this cause within multicore each core have an unique id?
Each core does have a unique ID. You still have to target the right core, and you'd be sending pipe messages instead of notes, (or making method calls if using interfaces). But your mediators wouldn't need to check for note type all the time.

5) EmployeeAdmin multicore demo?
For me it would be helpful if the EmployeeAdmin demo would be available as multicore demo.
Are there any examples like this out there?
Well, there is the PipeWorks demo, and the Modularity Demo for Flex. They should give you some idea.
https://github.com/PureMVC/puremvc-as3-demo-flex-pipeworks/wiki
https://github.com/PureMVC/puremvc-as3-demo-flex-modularity/wiki

Also you can see a real world example at http://seaofarrows.com + http://seaofarrows.com/srcview

Hope this helps!
-=Cliff>
« Last Edit: February 07, 2013, 08:47:52 by puremvc » Logged
openoli
Full Member
***
Posts: 44


View Profile Email
« Reply #2 on: February 08, 2013, 01:07:10 »

Cliff, your continuous support over years by now is unbelievable, many thanks!
There a lot hints inside your answer that I have to grapple with, hope I'll get a better understanding of all these things.

One simple question:
In pipes context there's an extensive usage of the word "plumb/plumbing".
The german translation(s) are not comprehensible within the context for me.
Could you describe what is meant with this?

Thanks!

Olaf
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #3 on: February 08, 2013, 08:29:36 »

Plumbing is what we call all the pipes and pipe fittings that connect sinks and showers and toilets the like so that water runs to them. In this case think of message flow as water flow.

But the pipes concept for modular software really came about with Unix, where you can 'pipe' the output of one command (like a directory listing) through another command (like a sort) and build a pipeline of commands that process the data that flows through it.

Cheers,
-=Cliff>
Logged
openoli
Full Member
***
Posts: 44


View Profile Email
« Reply #4 on: February 11, 2013, 01:41:06 »

I've got it Cliff, thanks!

In the meantime I've moved my application to multicore by doing all the necessary stuff.
That was a little work but pretty easy:-)

Now I'll try to understand the PipesUtility... perhaps there will be some questions soon;-)
   
Logged
Pages: [1]
Print