Repetitive tasks code generation for RL's
Anyone had any luck with code generation with RL's
Has anyone made any headway into this area?
I was thinking it would be cool if there could be an app (ant/or air application) that you tell it the location of your
views + events
models + events
commands
and then you give it some parameters when you want to do something in the app like fire an event from a view that is designed to call a service and update the model and it generates at bunch of classes like magic, based on common ways of setting up these things.
Anyone got any thoughts on this or can think of other features that could be useful
:)
Comments are currently closed for this discussion. You can start a new one.
Support Staff 2 Posted by Ondina D.F. on 06 Oct, 2010 01:41 PM
Hi Nikos,
For the code generation part, do you mean something like this?
http://github.com/EladElrom/robotlegs-utilities-AntGenerator
I've never tried it out though..
Ondina
3 Posted by creynders on 06 Oct, 2010 03:03 PM
FlashDevelop is a dream when it comes to templates and scaffolding. You can create your own structures very easily and use them to create new projects.
http://www.flashdevelop.org
4 Posted by Nikos Katsikanis on 06 Oct, 2010 04:54 PM
I tried it but it wasn't doing much, just creates directories, I tried Johns one that creates commands but couldn't get it working
http://johnlindquist.com/2010/06/03/robotlegs-and-signals-code-gene...
5 Posted by creynders on 07 Oct, 2010 07:30 AM
Really you should give FD a bit more attention. You can set up a vanilla project with all libraries, et cetera just as you want it. Combining them with custom templates makes it very easy, powerful and fast to create mediators, commands, ...
Just take a look at the standard scaffolding project files in [FD install directory]/Projects
to have an idea how to start out and you'll see you'll get the hang of it pretty soon. Once you get it working, you can't imagine how you could manage before without.
P.S.: the standard project scaffolding files are in [FD install directory]/Projects but you should place your own custom scaffolding files in [FD application files]/Projects
6 Posted by creynders on 07 Oct, 2010 07:55 AM
I created an example project, which took me approximately 5 minutes.
What it does is it sets up a FD project, and adds a robotlegs.swc and greensock.swc
Also it creates the typical mvs directory structure, with the context and 4 commands already: ConfigureViewsCommand, ConfigureModelsCommand, ...
As you'll see you can easily extend it to include a full bootstrap mechanism et cetera if you want to.
To use it just goto 'Tools' > 'Application Files' in FD. Explorer will open, go inside the 'Projects' directory and copy the contents from the attached zip to the 'Projects' directory.
Now you'll see that if you choose 'New Project' in FD it'll have added
to the 'installed templates' panel (at the bottom of the list)
7 Posted by Nikos Katsikanis on 07 Oct, 2010 08:00 AM
I've thought about FD but f builder 5 should have similar features I think so may wait before buying FD.
thanks
8 Posted by creynders on 07 Oct, 2010 08:08 AM
FD is freeware. No need to wait ;)
Support Staff 9 Posted by Joel Hooks on 07 Oct, 2010 08:09 AM
You will wait a long time before buying Flash Develop:
10 Posted by Nikos Katsikanis on 07 Oct, 2010 08:12 AM
woops, got confused with FDT :)
11 Posted by Nikos Katsikanis on 07 Oct, 2010 08:12 AM
can you use FD on the same project as beign used in FB4?
12 Posted by Stray on 07 Oct, 2010 08:13 AM
Unless you code for a hobby I'd say that having the right tools is always worth it.
It's your own choice but it seems a little strange to want code gen tools (and others to build them!) but not be prepared to switch to an IDE that makes code gen easy.
13 Posted by Nikos Katsikanis on 07 Oct, 2010 08:21 AM
true
14 Posted by Nikos Katsikanis on 07 Oct, 2010 08:52 AM
I think im gonna use FDT over my FB4 project for kicks after seeing this:
http://johnlindquist.com/2010/01/21/as3-signals-tutorial/
http://johnlindquist.com/2009/11/18/robotlegs-hello-world-video-tut...
15 Posted by Nikos Katsikanis on 07 Oct, 2010 08:57 AM
aaaaaahhhhhhhh help
FB4 , FDT ,FD, intelliJ
too much choice grrr
16 Posted by Stray on 07 Oct, 2010 09:03 AM
You forgot TextMate and projectSprouts
oh - and Thor (ruby generators, similar to projectSprouts).
plus Emacs and VI
and there's always the Flash CSx IDE ;)
My advice would be - just pick something that looks good enough and get practiced at using it. Any familiar IDE beats and IDE you don't know the shortcuts for.
17 Posted by Nikos Katsikanis on 07 Oct, 2010 09:09 AM
more pain
18 Posted by Nikos Katsikanis on 07 Oct, 2010 09:13 AM
can you use all the IDE's at the same time?
ie the IDE specific files do not clash?
I'm thinking of doing the main coding using FB4 and the excellent perforce plugin and use other IDE's when I want to speed code in that project, ie when writing lots of classes.
penny for your thoughts?
19 Posted by Stray on 07 Oct, 2010 09:26 AM
Hi Nikos - did you read what I wrote in my previous message?
The fastest way to code is to use an IDE that you really, really know how to use.
That means picking one IDE and just using it well.
Using all the IDEs at the same time would be ridiculous. Whether or not the IDE specific files clash, your BRAIN - which is the throttle for any programmer - would not cope.
My fingers can type at 80+ wpm. Nobody can code at 80 wpm. QED typing itself is not the bottleneck. The purpose of code gen tools is not to avoid typing - it's to avoid having to *think* about what you should type, by scaffolding the required structure in each class. This frees up brain power for the higher level task of architecture.
If you mix and match your IDEs then you will have to think about how to use the IDE. That defeats the purpose of code gen - you would have even less brain power available than if you had no code gen tools at all.
Personally I use TextMate. I try to add a custom command and learn another of the bzillion keyboard shortcuts each week. Just one of each per week - because unless using shortcuts and commands is totally unconscious you become slower and less focussed on your code.
So - just choose and IDE and stick with it, and slowly learn to use the full power of that IDE. Learning ONE IDE takes several months, I think, so if you try to learn all of them you will be there for years before you have any fluency.
Stray
(Yes, I know that a small number of people use a couple of different IDEs, but generally this is because they have become fluent at one before adding the next, and they would still not try to use them all at the same time.)
Support Staff 20 Posted by Ondina D.F. on 07 Oct, 2010 10:44 AM
In addition to what creynders and Joel said and to Stray’s wise advise:
I think, we all share the desire to type less code, especially while using an MVC framework in a complex and/or big application.
I don’t know if you’ve already tried out other frameworks, but if robotlegs is your First-Framework-Ever, you probably can’t appreciate the fact that robotlegs considerably reduces the amount of boilerplate code you have to write compared to what its counterparts in the world of frameworks make you produce.
So, by choosing robotlegs, you already skipped the 1st step in the process of Reducing-Typing-Of-Code-To-An-Acceptable-Minimum.
On the one hand, I would say that even if it’s really boring and time consuming to write your Mediators and Models and VOs and Services and Commands over and over again, it might be a good practice in the beginning.
The benefit: you learn the proper syntax (you know, [Inject] instead of [inject]) or the relationship between the different Classes (say, if you don’t map your Command to an event, none will listen for that event dispatched by a Mediator, that wants to access a Service)
So, don’t be lazy:)
On the other hand, you are right, there are too many options out there, and it’s hard to find the tool that will fulfil all your expectations and will be worth the money. Automating the repetitive tasks is just one of the many things we (generally) expect from the previously mentioned IDE’s.
And there are too many frameworks out there, too many utilities, tools and so on. When you get used to one, another very promising framework, tool, utility appears out of nowhere. I think many developers spend more time deciding what to use than using it. We are a bunch of perpetually frustrated people, aren’t we? :)
Ondina
21 Posted by Nikos Katsikanis on 07 Oct, 2010 10:55 AM
Stray + Ondina = very helpful :)
thx
22 Posted by Stray on 07 Oct, 2010 10:59 AM
>
> **The benefit**: you learn the proper syntax (you know, [Inject] instead of [inject]) or the relationship between the different Classes (say, if you don’t map your Command to an event, none will listen for that event dispatched by a Mediator, that wants to access a Service)
>
That is a fantastic insight.
You shouldn't use a code gen tool for a class that you can't write by hand - you are cheating yourself out of the understanding of the framework / approach you're using.
Ondina is correct - without putting in the time to get familiar with the code you will be (far more) frustrated and side tracked by small bugs that you don't have the knowledge to find the root of.
You don't need to dig into the workings of Actor, the CommandMap and so on - or worry about how the framework carries out its own injections. But you do need to get hands on practice at wiring up your applications - if only because one day there might be a deadline, and a bug, and nobody else around to diagnose your problem!
Stray
ps - I'm actually super happy with my TextMate / projectSprouts / robotlegs combo, so I think I'm one of the developers who isn't unhappy with my lot! But then I used to be an engineer, so I'm kind of pragmatic in most things :)
23 Posted by Nikos Katsikanis on 07 Oct, 2010 11:20 AM
although it does help:
You don't need to dig into the workings of Actor, the CommandMap and so on - or worry about how the framework carries out its own injections.
24 Posted by Nikos Katsikanis on 07 Oct, 2010 11:27 AM
FDT + FB4 would be great but I think they will conflict due to project files where I know
IntelliJ works fine at the same time as at FB4 project as its settings are in a seperate folder.
25 Posted by creynders on 07 Oct, 2010 11:46 AM
My 2 cents:
If I have to work in Flex ('have to' is correct, because I actually detest Flex) I use FB & FD at the same time. They can manage the same project perfectly. I only use FB because of it's superior handling of mxml. To me the separation is clear: all view code & mediator mapping is done in FB and everything else I write in FD.
In other words: dirty presentation code -> FB, clean, beautiful & crisp code in FD ;)
I worked with FDT for a few months, but I never got the hang of it. I thought it was cumbersome and didn't 'help' me like FD does, but I'm certain that's only because I had been using FD for years already then.
Finding the right IDE (for the right language) is a bit like buying a guitar: you have to try a few out, and the one that 'feels' right probably is the one you should invest time in.
Until something better comes along of course :)
26 Posted by Nikos Katsikanis on 07 Oct, 2010 11:54 AM
yeah nice post creynders
27 Posted by Nikos Katsikanis on 07 Oct, 2010 04:17 PM
this is the best I've found
makes signals,commands and adds to context when you want a new signal
http://johnlindquist.com/2010/06/03/robotlegs-and-signals-code-gene...
has anyone had any success with this?
28 Posted by Nikos Katsikanis on 08 Oct, 2010 03:56 PM
I assumne the eclipse keyboard shortcuts are similar in FDT to FB4?
Stray closed this discussion on 12 Feb, 2011 11:19 PM.