where multiple context fits in real world application?

parikshit.dutta's Avatar

parikshit.dutta

21 Feb, 2013 10:13 PM

Hello RL Team,
Firstly kudos to you all in team for the good work that you are doing!

Okay, I'm a new member here although I have used RL for quite a few applications, mostly for FB games. Last I have used version 1.4 & back in 2011. Now I am considering RL again for a bigger but classic business application.

I have a few questions:

  1. 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 ?

  2. when can we expect the RL version 2 ? Will it be of a different breed altogether OR carry it's legacy ?

  3. 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 ?

  4. RL is know for MVCS, is there any parameter to follow to distinguish Command & Service layer as per best practrices ?

Thanks

  1. Support Staff 1 Posted by Ondina D.F. on 22 Feb, 2013 04:54 PM

    Ondina D.F.'s Avatar

    Hello,

    Thank you for your kind words:)

    Now I am considering RL again for a bigger but classic business application.

    I strongly recommend using robotlegs 2 instead of 1, if you’re starting anew.

    Robotlegs source code & documentation (readme files in pretty much every package):
    https://github.com/robotlegs/robotlegs-framework/tree/master/src/ro...

    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 ?

    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.

    Under Robotlegs 2 category there are a couple of discussions about rl2+modules. I suggest reading them. [http://knowledge.robotlegs.org/discussions/robotlegs-2]

    A list of rl2 examples:
    http://knowledge.robotlegs.org/discussions/examples/20-links-to-rob...
    Look for “modular”.

    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.

    For robotlegs 1 the examples are here: http://knowledge.robotlegs.org/discussions/resources/33-links-to-ro...
    Also look for modular, and especially Joel Hooks’ tutorials.

    when can we expect the RL version 2 ? Will it be of a different breed altogether OR carry it's legacy ?

    Shaun said: sooon;)

    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 ?

    Hmm, there is a discussion about this somewhere on this forum, but I can’t find it right now.

    RL is know for MVCS, is there any parameter to follow to distinguish Command & Service layer as per best practrices ?

    I don’t understand your question. I’m sure you’ve read this already: https://github.com/robotlegs/robotlegs-framework/wiki/best-practices
    Would you mind being a little more specific about what you mean by “any parameter to follow to distinguish Command & Service layer” ? :)

    Ondina

  2. 2 Posted by parikshit.dutta on 22 Feb, 2013 08:17 PM

    parikshit.dutta's Avatar

    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.

    Say my hello to Shaun also :)

    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.

    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.

    I really mean between "Model" & "Service" (since both extends actor), is this just we think model as internal actor & service as extrernal actor ?

    Thanks.

  3. Support Staff 3 Posted by Ondina D.F. on 23 Feb, 2013 02:33 PM

    Ondina D.F.'s Avatar

    Hello :)

    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.

    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.
    I have ported almost all my RL1 projects to RL2 a while back already.
    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.
    Though, getting acquainted with rl2’s new features would be beneficial, at least for later projects.

    I really mean between "Model" & "Service" (since both extends actor), is this just we think model as internal actor & service as extrernal actor ?

    That’s right, in robotlegs 1 Models and Services, they both extend Actor.

    http://knowledge.robotlegs.org/kb/reference-mvcs-implementation/mod...

    http://knowledge.robotlegs.org/kb/reference-mvcs-implementation/do-...

    https://github.com/robotlegs/robotlegs-framework/wiki/best-practice...

    As you could see in the above mentioned articles, Actor.as is a base class, provided as a convenience.
    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:

    [Inject] public var eventDispatcher:IEventDispatcher;

    In fact, that’s what you’d have to do in rl2, where there is no Actor.as

    Now, the differences between a Model and a Service are related to their roles.
    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):

    • Services+Models+VOs =responsible for retrieving data, manipulating data, persisting data structures

    • 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

    • 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).

    • VO=data carrier class to shuttle typed data across tiers

    • Controller=Events+Commands= application logic = application’s behavior= use cases

    • Commands act upon Models and Services, usually in response to user interactions with the application

    • View=user interface

    • Mediator= intermediary between application and View, wiring the Views to the shared event dispatcher.

    Services are the intermediaries between an application and the outside world(data sources); Mediators are intermediaries between the application and the user interface.
    Hope this helps.

    Ondina

  4. 4 Posted by parikshit.dutta on 23 Feb, 2013 04:11 PM

    parikshit.dutta's Avatar

    Hey thanks!
    I will give it a final look today & if I don;t find any follow up question I will close this thread for now.

    Btw, I need another clarification, I will create a new ticket since that is not related to this topic.

    Thanks again.

  5. Support Staff 5 Posted by creynders on 24 Feb, 2013 12:28 PM

    creynders's Avatar

    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.
    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.

    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.

  6. Support Staff 6 Posted by Ondina D.F. on 11 Mar, 2013 02:00 PM

    Ondina D.F.'s Avatar

    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.
    Thank you:)

  7. Ondina D.F. closed this discussion on 11 Mar, 2013 02:00 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac