Announcement Announcement Module
Collapse
No announcement yet.
Spring ActionScript and other AS framework Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring ActionScript and other AS framework

    Hi All,

    I am experienced in java Spring framework but new in AS and Flex development.

    As I know, there are a lot of frameworks are available for Flex. For example, Cairngorm and PureMVC.

    Since I am learning PureMVC, I would like to take PureMVC as an example to discused. PureMVC is an MVC framework. We can use it to split the Flex application into a few layers. It support Event handling so that different layers can be decoupled. It also manage the lifecycle of the objects(For example, the command objects. Of course, we have to create these object at the beginning by ourselves but PureMVC will take over everything after the creation.)

    I just have a look at the Spring Actionscript. Just like the Spring framework that has been implemented in Java, the Spring AS provide IOC(object lifecycle management), EventBus(Event handling), Operation/Command(They look like the concepts in MVC framework).

    It seems that the Spring Actionscript overlap with PureMVC so much. However, Spring AS also support Extensions for PureMVC. That means Spring AS does not overlap with PureMVC and they should work with each other.

    Now, I am confused and below are my questions:
    1. Compare with PureMVC, what is the advantage of Spring AS?
    2. What is the advantage of using Spring AS standalong?
    3. What is the advantage of using Spring AS with PureMVC?

  • #2
    Hi,

    here's an answer to your questions.

    1. Compare with PureMVC, what is the advantage of Spring AS?

    While PureMVC is a purely architectural framework, Spring AS is a full blown IoC container that contains building blocks to create MVC architectures. Hence, we can't really compare both frameworks. They both do different things, although there is a certain overlap. (See next answers)

    2. What is the advantage of using Spring AS standalong?

    Spring AS contains all the the necessary ingredients to create an MVC architecture (EventBus, Commands, Tasks, Operations, Service abstractions), without imposing one certain architecture. You are free to combine the APIs in the way you want and in the way that best fits your needs. This might feel a bit weird at first since there is not 1 single way to tackle all problems, but our experience is that this is not possible with architectural frameworks anyway. While they might give you some comfort at first, we have found most architectural frameworks to work counter-productive as applications grow and you want to keep fitting your application in the architecture that is imposed by the architectural framework you are using.

    3. What is the advantage of using Spring AS with PureMVC?

    Spring AS can be used as the core of your application, mainly the IoC container, while you can use your existing knowledge of PureMVC to handle the application architecture. This is a good fit if you want to stick to PureMVC but also want to have a dependency injection mechanism and a container that centralizes your application configuration.

    I hope this answers your questions.

    regards,
    Christophe

    Comment


    • #3
      Similar to what Christophe said, my opinion is that PureMVC is more of an exercise in building an MVC architecture than it is a pure AS3 MVC solution (PureMVC exists firstly in theory, and is then applied to a programming language).

      My rant ():

      PureMVC provides a very clear cut MVC architecture, and forces you to adhere to the rules it defines. This in turn has its advantages, and disadvantages. Spring AS is a much broader framework, and focuses on DI rather than MVC. However, the obvious problem we face when developing with GUI technologies is how to loosely couple all involved components, so it's almost logical that Spring AS will also provide some utilities that (sometimes unintentionally) help with implementing an MVC pattern.

      I'm facing a similar "issue" right now. We traditionally developed our Flex applications with PureMVC (we decided on this back when Spring AS wasn't even called Spring AS yet). I'm evaluating how PureMVC compares to Spring AS, and more specifically the micro MVC framework that comes with it. On paper, I like Spring AS a lot because I'm a long time Spring user, and the general approach feels very natural to me. On the other hand, I know using PureMVC for real world applications works well, which I can't say for sure of Spring AS. The general "gut feeling" I'm getting is that using Spring AS will force me back to the roots of Flex development, where it's OK to have more-than-usual Actionscript in the MXML definitions compared to PureMVC, which is a very neat separation of view mark-up (MXML) and Actionscript logic (Mediator).

      The control freak in me dislikes this, because I like things to be neat and tidy. But on the other hand I find that neat & tidy in PureMVC means that it can sometimes be a real task to figure out exactly what is happening (eg. an MXML component dispatches an event, its Mediator handles the event and dispatches multiple notifications, these notifications in turn trigger one or more Command(s) which turn dispatch new notifications, etc.). On the ither hand, the Spring user in me wants to get things done quickly and simply without compromising stability. It's an interesting problem

      Comment


      • #4
        absolutely not

        Spring AS will force me back to the roots of Flex development, where it's OK to have more-than-usual Actionscript in the MXML definitions
        Don't worry about this please, Spring Actionscript will most definitely not force you back to an MXML/Actionscript mess. We promote the use of presentation models which will cleanly separate your business logic from your presentation logic.

        If you're interested, take a look at one of the reference applications to see an example of such a structure:
        https://fisheye.springsource.org/bro...ples/organizer

        hope this helps a little,


        cheers,

        Roland

        Comment


        • #5
          Thanks for the pointer Roland.

          I had already previously used the Cafe Townsend (MVC) example as a reference, but the organizer project looks like another great example.

          Comment


          • #6
            Reference App - CairngormStore

            I would like to run and examine the CairngormStore in your reference apps but my svn client (tortoise) errors out when I try to download the app. Could you please post instructions on how to obtain the CairngormStore project? Possibly the https is an issue?
            Thanks

            Originally posted by 666shooter View Post
            Don't worry about this please, Spring Actionscript will most definitely not force you back to an MXML/Actionscript mess. We promote the use of presentation models which will cleanly separate your business logic from your presentation logic.

            If you're interested, take a look at one of the reference applications to see an example of such a structure:
            https://fisheye.springsource.org/bro...ples/organizer

            hope this helps a little,


            cheers,

            Roland

            Comment

            Working...
            X