tag:robotlegs.tenderapp.com,2009-10-18:/discussions/robotlegs-2/861-where-multiple-context-fits-in-real-world-applicationRobotlegs: Discussion 2013-03-11T14:00:23Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/251844912013-02-22T16:54:37Z2013-02-22T16:54:37Zwhere multiple context fits in real world application?<div><p>Hello,</p>
<p>Thank you for your kind words:)</p>
<blockquote>
<p>Now I am considering RL again for a bigger but classic business
application.</p>
</blockquote>
<p>I strongly recommend using robotlegs 2 instead of 1, if
you’re starting anew.</p>
<p>Robotlegs source code & documentation (readme files in
pretty much every package):<br>
<a href=
"https://github.com/robotlegs/robotlegs-framework/tree/master/src/robotlegs/bender">
https://github.com/robotlegs/robotlegs-framework/tree/master/src/ro...</a></p>
<blockquote>
<p>when exactly multiple context to be used ? Suppose for a
business application where there will be products, inventory,
customers & accounts, reports etc (all are seperate modules but
inter dependent on model) how can I apply multiple context here ?
Or should I just work with single context ?</p>
</blockquote>
<p>If they are separate modules - like in Flex Modules – then
it is certainly better to let each module have its own context. If
products, inventory, customers are different areas of functionality
in a single app, then you can use a single context, but if you want
to define a context for each area, you are free to do so.</p>
<p>Under Robotlegs 2 category there are a couple of discussions
about rl2+modules. I suggest reading them. [<a href=
"http://knowledge.robotlegs.org/discussions/robotlegs-2">http://knowledge.robotlegs.org/discussions/robotlegs-2</a>]</p>
<p>A list of rl2 examples:<br>
<a href=
"http://knowledge.robotlegs.org/discussions/examples/20-links-to-robotlegs-v2-articles-examples-demos-utilities-and-tutorials">
http://knowledge.robotlegs.org/discussions/examples/20-links-to-rob...</a><br>
Look for “modular”.</p>
<p>Not all of them use the latest version of robotlegs 2 beta, and
not all of them follow the best practice., but looking at different
examples can help you understand the new features.</p>
<p>For robotlegs 1 the examples are here: <a href=
"http://knowledge.robotlegs.org/discussions/resources/33-links-to-robotlegs-resources-examples-tutorials">
http://knowledge.robotlegs.org/discussions/resources/33-links-to-ro...</a><br>
Also look for modular, and especially Joel Hooks’
tutorials.</p>
<blockquote>
<p>when can we expect the RL version 2 ? Will it be of a different
breed altogether OR carry it's legacy ?</p>
</blockquote>
<p>Shaun said: sooon;)</p>
<blockquote>
<p>one of our friend here expressed performance issues compare to
pureMVC with earlier RL version, where do we stand now with version
1.5.2 ?</p>
</blockquote>
<p>Hmm, there is a discussion about this somewhere on this forum,
but I can’t find it right now.</p>
<blockquote>
<p>RL is know for MVCS, is there any parameter to follow to
distinguish Command & Service layer as per best practrices
?</p>
</blockquote>
<p>I don’t understand your question. I’m sure
you’ve read this already: <a href=
"https://github.com/robotlegs/robotlegs-framework/wiki/best-practices">
https://github.com/robotlegs/robotlegs-framework/wiki/best-practices</a><br>
Would you mind being a little more specific about what you mean by
“any parameter to follow to distinguish Command & Service
layer” ? :)</p>
<p>Ondina</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/251844912013-02-22T20:17:44Z2013-02-22T20:20:22Zwhere multiple context fits in real world application?<div><p>I am happy getting new tech friends. Volla :) I really moved
away from RL ealier bacause I didn't know where to ask if I trapped
somewhere middle of a big project, I am confident now.</p>
<p>Say my hello to Shaun also :)</p>
<p>Well, on your suggestion for using RL 2, that's in beta stage,
would this not be a risk from stakeholder's standpoint ? We are
still to get the RC or, we are close & beta can be used safely
? Please clear this point for me.</p>
<p>With my question "RL is known for MVCS, is there any parameter
to follow to distinguish Command & Service layer as per best
practrices ?", I regret for the miscommunication.</p>
<p>I really mean between "Model" & "Service" (since both
extends actor), is this just we think model as internal actor &
service as extrernal actor ?</p>
<p>Thanks.</p></div>parikshit.duttatag:robotlegs.tenderapp.com,2009-10-18:Comment/251844912013-02-23T14:33:25Z2013-02-23T14:33:25Zwhere multiple context fits in real world application?<div><p>Hello :)</p>
<blockquote>
<p>Well, on your suggestion for using RL 2, that's in beta stage,
would this not be a risk from stakeholder's standpoint ? We are
still to get the RC or, we are close & beta can be used safely
? Please clear this point for me.</p>
</blockquote>
<p>That’s a good point and I understand your concerns very
well. All I can say at the moment is that I’m pretty
confident that RL2 will be released very soon. It’s not a
guarantee, of course.<br>
I have ported almost all my RL1 projects to RL2 a while back
already.<br>
I don’t know what advise to give you. Maybe it’s better
to play it safe and start your new project based on rl1.<br>
Though, getting acquainted with rl2’s new features would be
beneficial, at least for later projects.</p>
<blockquote>
<p>I really mean between "Model" & "Service" (since both
extends actor), is this just we think model as internal actor &
service as extrernal actor ?</p>
</blockquote>
<p>That’s right, in robotlegs 1 Models and Services, they
both extend Actor.</p>
<p><a href=
"http://knowledge.robotlegs.org/kb/reference-mvcs-implementation/model-service-and-the-actor">
http://knowledge.robotlegs.org/kb/reference-mvcs-implementation/mod...</a></p>
<p><a href=
"http://knowledge.robotlegs.org/kb/reference-mvcs-implementation/do-models-and-services-have-to-extend-actor-why">
http://knowledge.robotlegs.org/kb/reference-mvcs-implementation/do-...</a></p>
<p><a href=
"https://github.com/robotlegs/robotlegs-framework/wiki/best-practices#wiki-modelandservice">
https://github.com/robotlegs/robotlegs-framework/wiki/best-practice...</a></p>
<p>As you could see in the above mentioned articles, Actor.as is a
base class, provided as a convenience.<br>
You could let any class that needs a reference to the shared event
dispatcher and the local event map extend Actor. On the other hand,
any class that needs a shared event dispatcher can just inject it,
instead of extending Actor:</p>
<p>[Inject] public var eventDispatcher:IEventDispatcher;</p>
<p>In fact, that’s what you’d have to do in rl2, where
there is no Actor.as</p>
<p>Now, the differences between a Model and a Service are related
to their roles.<br>
For a detailed description of their roles you might want to read
the Best Practices, the ActionScript Developer’s Guide to
Robotlegs, as well lots and lots of interesting discussions on this
forum around Models and Services. Here, just a short explanation
(my own interpretation):</p>
<ul>
<li>
<p>Services+Models+VOs =responsible for retrieving data,
manipulating data, persisting data structures</p>
</li>
<li>
<p>Service = gatekeeper to the outside world, data supplier, data
source. Services should encapsulate logic for storing data to
external data storage and/or retrieving data from external data
sources (persistent data storage: Server, File system) and inform
other actors about the results</p>
</li>
<li>
<p>Models should encapsulate all the logic responsible for
maintaining the integrity of the data, for manipulating the data
/application’s states, and for informing other actors of
changes to the data (through events or signals).</p>
</li>
<li>
<p>VO=data carrier class to shuttle typed data across tiers</p>
</li>
<li>
<p>Controller=Events+Commands= application logic =
application’s behavior= use cases</p>
</li>
<li>
<p>Commands act upon Models and Services, usually in response to
user interactions with the application</p>
</li>
<li>
<p>View=user interface</p>
</li>
<li>
<p>Mediator= intermediary between application and View, wiring the
Views to the shared event dispatcher.</p>
</li>
</ul>
<p>Services are the intermediaries between an application and the
outside world(data sources); Mediators are intermediaries between
the application and the user interface.<br>
Hope this helps.</p>
<p>Ondina</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/251844912013-02-23T16:11:30Z2013-02-23T16:11:30Zwhere multiple context fits in real world application?<div><p>Hey thanks!<br>
I will give it a final look today & if I don;t find any follow
up question I will close this thread for now.</p>
<p>Btw, I need another clarification, I will create a new ticket
since that is not related to this topic.</p>
<p>Thanks again.</p></div>parikshit.duttatag:robotlegs.tenderapp.com,2009-10-18:Comment/251844912013-02-24T12:28:21Z2013-02-24T12:28:21Zwhere multiple context fits in real world application?<div><p>I'd also recommend to use RL2. Even though it's still in beta,
it's stable. If you take a look at the issue queue, you'll see that
most issues are about internal stuff w/o any impact on the API. Not
saying the API is 100% fixed, but it'll only be small changes or
additions.<br>
Also, Shaun and Till are genuinely concerned about their userbase
and respond pretty quickly to issues. I'm certain that if any
critical issues arise a solution will be found swiftly.</p>
<p>However I understand your concern. If you do choose to go with
RL1 make sure that none of your classes inherit from any of the RL1
classes directly. Just make wrappers for all necessary classes,
i.e. make a CommandBase, MediatorBase and ActorBase and let those
inherit from the relevant RL classes. If you'd decide to migrate to
RL2 somewhere along the way then this approach will make the
migration a LOT easier, since all you'll need to do is modify the
wrappers to reflect the changes in RL2. Normally you won't need to
touch any of your MVS classes. Most work will be in the commands,
since they'll need to access RL internals and those have changed.
But I'm pretty confident that it'll be a very swift and clear
migration.</p></div>creynderstag:robotlegs.tenderapp.com,2009-10-18:Comment/251844912013-03-11T14:00:21Z2013-03-11T14:00:21Zwhere multiple context fits in real world application?<div><p>I'm closing this discussion, but feel free to reopen it in case
you have more questions or you need further assistance with this
issue. Please open new threads for new issues.<br>
Thank you:)</p></div>Ondina D.F.