6 Replies Latest reply on Nov 12, 2009 5:09 AM by FortPointUIGuy

    How to best organize Flex Builder projects within a source control system?

    FortPointUIGuy

      Hi Everyone,

       

      I'm in the process of working on a medium size team of developers on an enterprise product that will be using Flex on the front-end, remoting services to Java objects on the server, etc.

       

      Right now, I've just created a sample application with a Flex Builder project within Eclipse and using WTP.

       

      I'm looking for any tips or suggestions on how best to organize a large Flex/Java project for team use with subversion, etc.

       

      Does it make sense to checkin the entire Flex Builder project (i.e. properties files etc.)?  Our development environments will be identical as they will be VM images.

       

      I've done a lot of searching and found some tidbits but I figured I'd see if I could get some feedback from other folks that have experience with this or are in the process of organizing their source code etc.

       

      Thanks a lot,

       

      FortPointUIGuy

        • 1. Re: How to best organize Flex Builder projects within a source control system?
          msakrejda Level 4

          This is sort of a religious topic. Some people insist on checking in project files; others find it's a terrible practice. For what it's worth, I'm in the latter camp (especially since in some cases, Eclipse wants absolute paths in the config files). Flex Builder makes setting up a project based on existing files very straightforward--I think it makes more sense to take advantage of this rather than impose a single project config on everyone (not to mention a single IDE--e.g., some people on a Flex project may decide to use IDEA for Flex development instead).

          1 person found this helpful
          • 2. Re: How to best organize Flex Builder projects within a source control system?
            FortPointUIGuy Level 1

            Thanks for the reply.  Yes, I've noticed it is a highly-debated topic as to whether or not to check-in the project properties.

             

            I must admit that I'm very new to Flex but I've worked with Java projects within Eclipse a lot in the past and it was a similar debate.

             

            I guess I'll need to play with creating the projects from just the source files and see what the process is like.

             

            Do you or anyone else have any experience when building Web projects that use a data service like BlazeDS as to how to best organize the code structure?

             

            Should I create one WTP project that includes the Flex client code and the Java server-side classes or is it best to separate these into different projects???

             

            Any info or debate is apprecaited.

             

            Thanks again for the reply.

            • 3. Re: How to best organize Flex Builder projects within a source control system?
              msakrejda Level 4

              We use Granite DS (which is very similar to Blaze; essentially it's the Blaze before Blaze existed), but I set up a server-less project in FlexBuilder and configured this manually. The Java code and Flex code are part of the same project, and that works pretty well--no real issues there. I've changed my swf output path to be inside the tomcat webapp directory, so I can rebuild and re-launch (and debug) without having to restart tomcat, which is quite handy.

               

              I use  a bastardized maven-like layout for the code (although we don't use maven):

               

              src/

                main/

                  flex/

                  resources/

                    embedded/

                    ...

                  java/

                test/

                  flex/

                  java/

               

              lib/

                build/

                  flex/

                  java/

                main

                  flex/

                  java/

                test/

                  flex/

                  java/

               

              src/main/flex contains the root of the Flex source code hierarchy. src/main/java is the same thing for Java. I think src/test/{flex,java} is obvious. lib/build is for libaries for each language that are only needed at build time (e.g., Flex .swc libraries that are linked in; or dependencies for our ant build process); lib/test is test time, and lib/main is runtime (e.g., most Java jars). The src/main/resources folder is for any assets (e.g., i18n, styles, images, etc.). The embedded subfolder is treated specially--this is where we keep everything that gets baked into the .swf, so we don't copy this out to the .war file. Technically maybe it should be a subfolder of src/main/flex, but that's a detail.

               

              Overall, I'm pretty happy with this. I've never set up a server project in FB, so I'm not sure if that's easier or harder, but this setup gets me what I need, and I've had no real issues from the project configuration itself.

              1 person found this helpful
              • 4. Re: How to best organize Flex Builder projects within a source control system?
                FortPointUIGuy Level 1

                msakrejda - all of your information is extremely helpful and I appreciate yout taking the time to document all of this.  I full understand where you are coming from and this is quiete helpful.

                 

                So, your great answer sparks a few more quesitons as you've obviously gone through the process that I'm going through right now:

                 

                1.) The project that you created was a basic Flex Builder project, as you said server-less, right?

                 

                2.) GraniteDS - How do you like it?  Do you feel confident that the support and community is there for it to keep on going?  I just downloaded it yesterday and I'm going to evaluate it.  It obviously has some features that BlazeDS does not have that I'm very interested in - (i.e. client-server synchronization).

                 

                3.) One thing that has been tripping me up a bit using BlazeDS is whether or not the BlazeDS JARs should be packaged as part of my web app or have BlazeDS run separately on the app server.  Do you just package up graniteds with your web app and deploy it or do you have graniteds already running as a separate web app on your server?

                 

                Accept my apologies if some of my questions are a bit off-base as I'm trying to understand how all of these pieces fit together right now!

                 

                Thanks Again!  Your post is going to help many others dealing with this in the future as well.

                • 5. Re: How to best organize Flex Builder projects within a source control system?
                  msakrejda Level 4

                  1. Yep. Note that to do both Java and Flex in the same project, I first had to create a Java project, and then something like Flex Project Nature > Add Flex Project Nature. Attempting to do this the other way around (start with a Flex project and add the Java code) did not work for me.

                   

                  2. It's been great. Franck Wolff, the chief developer, has been very responsive on their forum (even with stupid questions that were actually my fault). He added some requested functionality to the as3 Enums, and overall we've been pretty happy. We don't actually use any of the fancier Granite features (other than its gas3 actionscript generator for client-side objects for AMF); we mostly just use it because we moved to it before Blaze existed. However, we have no plans to move to Blaze.

                   

                  3. Yep, we just dump the Granite jars into our war, although that might not be the right thing for everyone. We have a fairly heavy-weight application, so we just assume we can dominate the server. This has worked fine for us, althoough I don't think we've ever shared our tomcat instances with any other web apps, so YMMV.

                   

                  And no problem--glad to help.

                  • 6. Re: How to best organize Flex Builder projects within a source control system?
                    FortPointUIGuy Level 1

                    Thanks again for all of the help.  That's great news about Granite as well.

                    We control the server in our situation so we can certainly just wrap up the Blaze or Granite JARs...

                    Again - great help.

                    -Bobby