Announcement Announcement Module
Collapse
No announcement yet.
Some (maybe redundant) notes on the current version in svn Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Some (maybe redundant) notes on the current version in svn

    Hi All,

    This post is actually for the developers of the framework.
    I heard that you guys are about to release the next version of SAS.
    That is great news! Today i started to play with the latest svn version.

    I have found a few issues of which i think you want to know about before releasing the next version. If you are already aware of these findings please ignore this post. It is just meant to help out (consider me a beta tester ;-))

    1) building with ant fails on the mac. analyzing the build files shows that asdoc.exe is alway used. Should be easy to fix.

    2) the documentation mentions autowiring in a few configurations.
    byType works great, but autowire="constructor" / autowire="autodetect" doesn't work. Looking at code that i checked out reveals that there is no test for these ones. Maybe this functionality is postponed for a next release (although i really would love to use it ;-)) In that case i think it should be taken out of the docs (which are great BTW!)

    3) after updating to the ascommons swc's in the trunk i get many stacktraces in my output when i build. These look like this:
    Sun Jun 14 22:17:07 GMT+0200 2009 [DEBUG] org.as3commons.reflect.Type - Error while instantiating class [class Event] with null arguments in order to retrieve constructor argument types: TypeError, 2007
    Message: Error #2007: Parameter type mag niet null zijn.
    Stack trace: TypeError: Error #2007: Parameter type mag niet null zijn.
    at flash.events::Event()
    at org.as3commons.reflect::ClassUtils$/newInstance()[C:\workspace\as3commons\as3-commons-reflect\src\main\actionscript\org\as3commons\refle ct\ClassUtils.as:311]
    at org.as3commons.reflect::Type$/_getTypeDescription()[C:\workspace\as3commons\as3-commons-reflect\src\main\actionscript\org\as3commons\refle ct\Type.as:276]
    at org.as3commons.reflect::Type$/forClass()[C:\workspace\as3commons\as3-commons-reflect\src\main\actionscript\org\as3commons\refle ct\Type.as:156]
    at org.as3commons.reflect::Type$/forName()[C:\workspace\as3commons\as3-commons-reflect\src\main\actionscript\org\as3commons\refle ct\Type.as:125]
    at TypeXmlParser$/parseMethodsByModifier()[C:\workspace\as3commons\as3-commons-reflect\src\main\actionscript\org\as3commons\refle ct\Type.as:342]
    at TypeXmlParser$/parseMethods()[C:\workspace\as3commons\as3-commons-reflect\src\main\actionscript\org\as3commons\refle ct\Type.as:321]
    at org.as3commons.reflect::Type$/forClass()[C:\workspace\as3commons\as3-commons-reflect\src\main\actionscript\org\as3commons\refle ct\Type.as:165]
    at org.as3commons.reflect::Type$/forName()[C:\workspace\as3commons\as3-commons-reflect\src\main\actionscript\org\as3commons\refle ct\Type.as:125]
    at TypeXmlParser$/parseParameters()[C:\workspace\as3commons\as3-commons-reflect\src\main\actionscript\org\as3commons\refle ct\Type.as:351]
    at TypeXmlParser$/parseMethodsByModifier()[C:\workspace\as3commons\as3-commons-reflect\src\main\actionscript\org\as3commons\refle ct\Type.as:341]
    at TypeXmlParser$/parseMethods()[C:\workspace\as3commons\as3-commons-reflect\src\main\actionscript\org\as3commons\refle ct\Type.as:321]
    at org.as3commons.reflect::Type$/forClass()[C:\workspace\as3commons\as3-commons-reflect\src\main\actionscript\org\as3commons\refle ct\Type.as:165]
    at org.springextensions.actionscript.ioc.factory.supp ort::AbstractObjectFactory/getObject()[/Users/arnoudbos/Desktop/development/flex frameworks/spring-actionscript/spring-actionscript/trunk/core/src/main/actionscript/org/springextensions/actionscript/ioc/factory/support/AbstractObjectFactory.as:193]
    at org.springextensions.actionscript.ioc.factory.supp ort:efaultListableObjectFactory/preInstantiateSingletons()[/Users/arnoudbos/Desktop/development/flex frameworks/spring-actionscript/spring-actionscript/trunk/core/src/main/actionscript/org/springextensions/actionscript/ioc/factory/support/DefaultListableObjectFactory.as:132]
    at org.springextensions.actionscript.context.support: :XMLApplicationContext/afterParse()[/Users/arnoudbos/Desktop/development/flex frameworks/spring-actionscript/spring-actionscript/trunk/core/src/main/actionscript/org/springextensions/actionscript/context/support/XMLApplicationContext.as:169]
    at org.springextensions.actionscript.ioc.factory.xml: :XMLObjectFactory/_doParse()[/Users/arnoudbos/Desktop/development/flex frameworks/spring-actionscript/spring-actionscript/trunk/core/src/main/actionscript/org/springextensions/actionscript/ioc/factory/xml/XMLObjectFactory.as:348]
    at org.springextensions.actionscript.ioc.factory.xml: :XMLObjectFactory/_loadNextProperties()[/Users/arnoudbos/Desktop/development/flex frameworks/spring-actionscript/spring-actionscript/trunk/core/src/main/actionscript/org/springextensions/actionscript/ioc/factory/xml/XMLObjectFactory.as:319]
    at org.springextensions.actionscript.ioc.factory.xml: :XMLObjectFactory/_onPropertiesComplete()[/Users/arnoudbos/Desktop/development/flex frameworks/spring-actionscript/spring-actionscript/trunk/core/src/main/actionscript/org/springextensions/actionscript/ioc/factory/xml/XMLObjectFactory.as:326]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at org.springextensions.actionscript.collections::Pro perties/onLoaderComplete()[/Users/arnoudbos/Desktop/development/flex frameworks/spring-actionscript/spring-actionscript/trunk/core/src/main/actionscript/org/springextensions/actionscript/collections/Properties.as:118]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()


    My code runs just fine but these traces obviously worry me

    These are my findings for now. If i find more i'll add them to this tread.

    Looking forward to the next release!

    Arnoud

  • #2
    no worries

    You're absolutely right about the constructor and autodetect autowirings, this is totally my bad and will correct them in the docs.
    The ANT buld file is pretty old I believe, so I'm not surprised it doesnt work We've moved to maven for the most part, I'm not sure if the ANT build will remain though. Maybe Christophe or Martino can say something sensible about this, me, I'm not known for saying sensible things

    As fro those enormous traces, these are nothing to worry about. They are the result of as3commons.reflect figuring out the constructor arguments for a bunch of classes.
    I can't remember what the precise technical reason was for this, I believe its a workaround for an actionscript bug. But again, I'm not sure, maybe Christophe or Martino can shed some light on this as well. They're both very busy with work lately, so you will have to be a little patient I'm afraid.

    hope this helped a little,

    Roland

    Comment


    • #3
      tnx

      Hi Roland,

      thanx for clearing that up. One thing is not entirely clear to me.

      You said that you would correct the autowire stuff in the docs.
      Does this mean that autowire="constructor" wil be removed from the docs (they are still in the docs), or maybe the syntax in the docs was incorrect?

      I do think it would be an awesome functionality as it would allow to use completely sealed classes (just constructor and further private properties)
      with dependency injection and mimimal configuration. So if it will be removed from this version, please keep it on the roadmap for future release

      looking forward to the 0.8 release!


      Arnoud
      Last edited by arnoudb; Jun 30th, 2009, 07:13 AM.

      Comment


      • #4
        re: error in reflect proj

        Since we have a google mailing list and this forum some of the info gets lost on one side or the other...Christophe gave me the full explanation for the error and suggested just filtering out the debug stmts from the Reflect project -- here's the link to that thread, followed by his exact, quoted response:

        http://groups.google.com/group/sprin...e94b9ab1ab0314

        "We need to do a little hack in as3commons-reflect to work around a
        flash player bug in order to retrieve correct constructor argument
        information. We also put in the debug logs to inform devs about it.
        You can easily filter these out by configuring the FlexLoggerFactory
        and adding filters on the mx Log class.

        Here's how logging is currently configured in an app we are working
        on:

        private static var loggerSetup:* = setupLogging();
        private static var logger:ILogger = LoggerFactory.getLogger
        ("TMSNG.Main");

        private static function setupLogging():void {
        LoggerFactory.loggerFactory = new FlexLoggerFactory();

        var traceTarget:TraceTarget = new TraceTarget();
        traceTarget.includeCategory = true;
        traceTarget.includeDate = true;
        traceTarget.includeLevel = true;
        traceTarget.includeTime = true;
        traceTarget.filters = ["TMSNG.*"];
        Log.addTarget(traceTarget);

        var traceTargetSpring:TraceTarget = new TraceTarget();
        traceTargetSpring.includeCategory = true;
        traceTargetSpring.includeDate = true;
        traceTargetSpring.includeLevel = true;
        traceTargetSpring.includeTime = true;
        traceTargetSpring.level = LogEventLevel.INFO;
        traceTargetSpring.filters = ["org.springextensions.*"];
        Log.addTarget(traceTargetSpring);

        var traceTargetReflect:TraceTarget = new TraceTarget();
        traceTargetReflect.includeCategory = true;
        traceTargetReflect.includeDate = true;
        traceTargetReflect.includeLevel = true;
        traceTargetReflect.includeTime = true;
        traceTargetReflect.level = LogEventLevel.WARN;
        traceTargetReflect.filters = ["org.as3commons.reflect.*"];
        Log.addTarget(traceTargetReflect);
        }"

        Comment


        • #5
          its on the roadmap

          Hey Arnoud,

          for now I have changed the documentation to state 'NOT IMPLEMENTED YET' regarding the autodetect and constructor options. The documentation hasn't been updated on www.springactionscript.org yet though, only in the SVN repository. I currently don't have the ability to update the site directly myself, that's why the site is a little outdated right now.

          I'm not sure why the aforementioned options haven't been implemented yet, whether its not possible, or maybe just out of lack of time. I will ask Martino the exact reason (he's the one who implemented all the other wonderful autowiring magic).

          But as far as I know its still on the roadmap.


          cheers,

          Roland

          Comment


          • #6
            good news

            Well,

            I've just received word from Martino and he's gonna do his best to include the constructor and autodetect options for autowiring in the upcoming version 0.8 release.

            I hope that makes you happy

            cheers,

            Roland

            Comment


            • #7
              Verrrry happy!

              Cool!

              Thanx Roland for the quick answer! Especially during development time this would be a great feature, speesing up developent. If i want to make the context more clear after the development cycle i could then always make the context more explicit (for other developers).

              I think the 0.8 release will be really great,
              thanx guys for the great work!

              Arnoud

              Comment


              • #8
                long traces

                Thanx Brian!

                this is very handy to know as my own logging became hard to spot between the long traces.

                i'll subscribe to the mailing list as well to prevent asking questions already asked.

                cheers,

                Arnoud

                Comment


                • #9
                  autowire="constructor"

                  Hi,

                  thanx fox release 0.81!

                  i have a question on what the status is on autowire="constructor" / autowire="autodetect".

                  It was stated that this would be in the release but i don't get it to work. Looking at the code i dont' see tests for it so probably this isn't implemented yet.

                  an example:

                  <object id="helloWorldModel" class="nl.artim.projectx.viewmodel.HelloWorldModel Impl" />
                  <object id="helloWorldCommand" class="nl.artim.projectx.command.HelloWorldCommand " scope="prototype" autowire="constructor" />

                  doen't work but:

                  <object id="helloWorldModel" class="nl.artim.projectx.viewmodel.HelloWorldModel Impl" />
                  <object id="helloWorld3Command" class="nl.artim.projectx.command.HelloWorld3Comman d" scope="prototype" />
                  <constructor-arg ref="helloWorldModel"/>
                  </object>

                  does work. I prefer the short notation ;-)

                  Any news on this?

                  thanx,

                  Arnoud

                  Comment


                  • #10
                    works as far as i can tell...

                    Hey Arnoud,

                    the test project does in fact contain tests for the autodetect and constructor autowiring. Check the XmlObjectFactoryTest in the test project for details.
                    The only difference I could see between our unit tests and the code that you posted is that your autowired object has a prototype scope.
                    So just to be certain I added an extra test that also 'constructor-wires' a prototyped object. In the test project all these tests pass perfectly, so the error must be something else.

                    Could you post a sample project, perhaps, that demonstrates the problem?

                    thanks,

                    Roland

                    Comment


                    • #11
                      It works!

                      Hi Roland,

                      thanx for the fast reply.

                      I have it working now. The strange thing is, i dont have a clue of what went wrong. Well 1 thing, i replaced the old springactionscript 0.71 today with 0.81 and it seems that this lib file was not refreshed somehow. Looks like some cache was holding the old one. Anyway after seeing your working code i restarting eclipse and that seemed to do the trick.

                      Sorry to waste your time in the weekend ;-)

                      Arnoud

                      Comment


                      • #12
                        np

                        No problem Arnoud

                        Glad to hear you have it working, good luck with your app!

                        cheers,

                        Roland

                        Comment

                        Working...
                        X