Subscribe: Brian Kotek: Inversion of Control - CFEclipse
http://www.briankotek.com/blog/rss.cfm?mode=full&mode2=cat&catid=B0E10100-DAC9-A8F4-2A8BD0971391C4A3
Added By: Feedage Forager Feedage Grade A rated
Language: English
Tags:
ant  cfeclipse  code  create  eclipse  file  files  ide  much  new  people  plugin  plugins  set  task  things  trac  xml 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: Brian Kotek: Inversion of Control - CFEclipse

Brian Kotek: Inversion of Control - CFEclipse



Brian Kotek on ExtJS, DeftJS, CoffeeScript, Java, Groovy, Grails, Design Patterns, and Object-Oriented Programming



Published: Sat, 25 Nov 2017 05:25:20 -0700

Last Build Date: Thu, 03 Apr 2008 11:53:51 -0700

 



Development Tip: Change Your Coding Font

Thu, 03 Apr 2008 11:53:51 -0700

Just posting a quick tip about a topic that most people would probably not consider: changing your font in your IDE. I highly recommend Consolas on Windows, and the very similar Inconsolata on the Mac, which are by far the best fonts I've found for coding. It sounds a bit crazy, but a little thing like this can make a big difference in your productivity, especially when you're literally staring at it all day! Check it out compared to Courier New, a common default font:

Consolas / Inconsolata:

(image)


Now Courier New:

(image)


To me, the difference in sharpness and clarity is quite significant! Give it a try and see what you think.





For Users of Eclipse, SVN, and Trac: Mylyn Utterly Rocks

Thu, 20 Mar 2008 09:05:00 -0700

I've been using Eclipse as my IDE for a while now. It's just far too sweet to have my CF IDE and Flex IDE together, plus XML, CSS, HTML, ANT, and all the rest. I've also been a Subversion zealot for a long time. Quite frankly, if you're not using Subversion, for everything related to your development, then you're nuts. And a glutton for punishment. This means all of your code (yes, even those stupid little tests where you try something out), but also all of your documents, database schemas, SQL queries, ANT build files, etc.

But this entry isn't a plea to your logical side to use Eclipse or SVN. I'm assuming you already are. No, this entry is about integrating Trac task management into Eclipse through the Mylyn plugin.

Put simply, Mylyn kicks ass. It links to your Trac repository via web interface or, better, XML-RPC. If you don't have Trac, consider using a service like CVSDude which includes SVN and Trac, or setting up a fully configured virtual server using Jumpbox.

Once you get things set up, Mylyn allows you to handle all aspects of task management from right inside Eclipse. It ends up looking like this:

(image)

As you can see, it gives you a full list of Trac tasks. You can sort or categorize these any way you want to. It lets you do a "focus on the workweek" mode, which limits what you see to only tasks due this week. You can create, modify, or close tasks right from Mylyn, no need to work with the crappy Trac web interface. This alone is really great, but it gets better.

Mylyn lets you attach a "context" to any task. This means it will keep track of what files you are working on that relate to the current task. So if you come back to a task later and activate it, Eclipse loads the attached context and shows only the files and resources that have to do with that task! This is great since it makes it much easier to work on a task without seeing a bunch of unrelated files. Of course you can choose to show everything in your workspace again if you need to add more files to the context. This is really a great idea.

Finally, if you have the proper connection set up between Subversion and Trac (which CVSDude and Jumpbox do), you can close Trac tickets directly in your commit comments! So if you commit with a comment like "Fixes #188", ticket 188 will automatically close and have a comment added that references the Subversion revision that closed it!

All of this really creates a full-circle version control and task management capability, all from within the IDE. More details are available at the Mylyn page, or you can read a more thorough article at IBM. I'd urge anyone to have a look at this very cool plugin and enjoy the immediate workflow benefits. And to anyone already using Mylyn, feel free to share your experience or any tips you have.



ColdFusion IDE Survey

Mon, 07 Jan 2008 11:58:00 -0700

Ray already blogged with a link to it, but this is so important that I think it needs to be aggregated to everything we can get our hands on. Damon Cooper has put up a survey asking about what features you use and what you want to see added to a ColdFusion IDE. Please fill this out and let them know what you want, and hopefully we'll see a great IDE just for ColdFusion that rivals FlexBuilder.



Using ANT and ColdFusion to Emulate Rails Generators

Mon, 23 Jul 2007 08:42:00 -0700

One of the nice things about Rails is how it can automatically spit out common code for you. For example, if you need a new Model or Controller, Rails can spit one out for you, ready to be customized, with one line of code. I've thought for a while that similar capabilities could be obtained using Apache ANT, which comes built in to Eclipse or can be downloaded separately and run from the command prompt. Last night I had a few minutes so I decided to try it for fun. And it seems to work pretty well! For example, in a Model-Glue app, I could execute an ANT task called create_controller.xml. What this would do is prompt me for the name of the controller. Say I enter "StoreController". Then it copies the Controller from the Model-Glue application template folder into my application's controller folder and names it StoreController.cfc. Then it embeds new XML into the Model-Glue config XML file like: into the controllers block. It does this by doing some replace commands on the Model-Glue XML, as well as replacing the controller name and the application name. It does the same sort of replace within the CFC to embed the proper name and path. I also did this with a create_event.xml file. This prompts me for the name of the event, and a view file name, and then creates the XML for the event, copies a view template into my views folder, and name it to match the view file name I specified. If you've used the Model-Glue application template to create a new application, you know it already does some copying of files and some replacing. It wouldn't be hard to imagine it also copying and creating a set of build XML files to perform common tasks like this. These build XML files would all be set up specific to the newly generated app, with the proper paths and application name already embedded within them. And obviously the same sort of thing could be done with any framework (ColdBox, Fusebox, Mach-II, etc.) These two examples were quite simple to create. And while they don't save a huge amount of time, it does save some time. I don't have to worry about creating new view or controller stub files, or creating the base XML in the config file. The build XML will do this for me in about one second. I could imagine making these do much more complex things if necessary, since ANT has a very large set of tasks that it can perform, including RegEx processing and replacement. I was curious to see if anyone had thought about something like this before, and if this sounds like it would be useful.



Even More CFEclipse Snippets

Tue, 10 Jul 2007 10:59:00 -0700

Inspired by Dan Wilson's post on CFEclipse snippets, I thought I'd post some as well. I have a lot of similar snippets to the ones Dan showed in his post, but I also have some shorter but equally useful snippets that I wanted to share. I hope folks find them useful, they sure eliminate a lot of typing for me! Trigger Text: qloop Trigger Text: aloop Trigger Text: sloop Trigger Text: lloop Trigger Text: lset Trigger Text: vi variables.instance.$${varName} Trigger Text: try



CFEclipse: Pros, Cons, and Misconceptions

Mon, 02 Jul 2007 08:35:00 -0700

I'm sitting in JFK airport in New York and my flight back to Raleigh was cancelled due to the storms on the east coast. Fun stuff. So I thought it might be a good time to pull a "Peter Bell" and churn out a couple of blog entries on my new MacBook. Last week an interesting and heated discussion was going on at the CF-Talk list regarding ColdFusion code editors. I chimed in with a response that will probably surprise no one who reads this blog: I trumpeted CFEclipse. What surprised me was the range of responses the topic of CFEclipse had among the broad CF-Talk crowd. Some people agreed with my praise for it. Some people were openly uncertain. Not too surprising there. No, the surprise came from the number of people who either had negative feelings about CFEclipse or who openly bashed it. And once I got into deeper discussions with these folks, one theme emerged: most detractors of CFEclipse have deep misconceptions about how it works and what it can do. Some lamented that lack of any site-wide search capabilities. Others derided the fact that you can only intent code one line at a time. Uncompelling snippets, no easy way to test some code quickly without creating projects, lackluster tag editing/insight, or undesired keyboard shortcuts. Anyone who uses CFEclipse already will instantly recognize that all of these complaints are actually non-issues. There is full site wide search. You can indent blocks of code with no problem. The snippets are extremely powerful. The scribble pad makes quick tests a snap. It has plenty of tag editors and tag insight for all tags and functions (even CF8 already). And the keyboard shortcuts can be extensively customized. So the majority of the issues people seem to have with Eclipse are not actually issues at all. In this regard, it appears that fans of CFEclipse need to blog or present more on this topic to raise awareness, because this is a shame. However, there were a few concerns that are more substantial: One is the memory footprint of Eclipse itself. I run MyEclipse, FlexBuilder, and Aptana alongside CFEclipse and it will routinely use about 150 Mb of physical RAM. My large number of plugins is probably on the very high end, but even so, many people seem to think 100+ Mb of memory usage is too much. I'm not sure if that is a vocal minority or not, because I simply didn't think anyone but a tiny percentage of ColdFusion developers are working on systems with less than 1 or 2 gigs of RAM. RAM is so cheap now (I found a 2 Gb stick for $68) and I have a hard time grasping why anyone would still limit themselves to 512 Mb. However, I suppose it can't be denied that Eclipse does eat up a good bit of RAM. If someone truly has no way to get more RAM this is indeed a showstopper. Another common complaint was the fact that you can't just click on a file in your file explorer and open it in Eclipse. This is also a valid observation, but I was somewhat surprised by how many people were bothered by this. For me, when I'm working, I'm working. Eclipse is open, and my workspace and projects are all right there. If I need to open a file, I open it from here. It's rare than I just unexpectedly need to open a single file. Am I alone on this or am I unusual and this limitation of Eclipse is really a problem? I'm also not entirely sure why this limitation exists. Is it because Eclipse doesn't know which project or workspace you need to work with if you open a file outside of it? This relates to another seemingly major problem: the fact that Eclipse pushes its approach of workspaces and projects upon us. I realize this is primarily a carryover from its Java roots, where most projects require external packages, build paths, and other settings. However, with the ability to integrate with Subversion and the integration with ANT that can be leveraged at the project level (like automatically running unit tests when you save a file), I don't really mind th[...]



Stub Generator for CFCs, Unit Tests, and More

Wed, 16 May 2007 08:00:00 -0700

I've created a new and much improved CFC Stub Generator and want to see what people think of this idea. It will generate CFCs, unit tests (for CFUnit or CFCUnit), mock objects, test runners, ColdSpring XML, and ANT unit test build XML files from a simple text file. You can download the code in the sidebar. I've also submitted an RIAForge project for it. To show how it works, I created a Connect presentation about using the CFC Stub Generator. Have a look and let me know what you think. Thanks. (Quick aside since I don't think I explicitly mentioned it, you can get the CFCUnit facade for the unit testing tab in CFEclipse at Sean Corfield's blog.)



Subclipse 1.1.9

Mon, 08 Jan 2007 07:30:00 -0700

Another quick post relating to Subversion and the Subclipse plugin for Eclipse. Over the weekend I realized there is a version of Subclipse specifically for Eclipse 3.2 (Callisto). You can get it by creating a remote update site and pointing to "http://subclipse.tigris.org/update_1.2.x". Here is the change log. I found this because I was getting tired of manually right clicking and choosing "update" to update my local files from the repository. This new version allows you to define keyboard shortcuts for common Subclipse tasks! Much easier, now I can just choose a project and hit Alt-U to get latest from the repository. I thought I'd pass this on in case anyone else didn't know about the newer version.



MyEclipse, CFEclipse, and Eclipse Configuration Tips

Mon, 11 Sep 2006 00:15:00 -0700

I saw some folks discussing and asking questions about MyEclipse, CFEclipse, and Eclipse in general on the CF-Talk list. I've been using all of these with good results so I thought I'd share some of my experiences using these tools. First, the background. Eclipse is primarily a Java IDE, but is extensible through plugins, and there are a ton of them. CFEclipse is a plugin that helps you create ColdFusion applications by offering tooltips, validation, and much more. MyEclipse is a commercial bundle of plugins. Even FlexBuilder is a plugin. The nice thing about Eclipse is that you can pretty much snap any or all of these plugins into your installation. Normally, to install a plugin into Eclipse you use Eclipse's built-in upgrade functionality in the Update Manager. This is under help-software updates-find and install. You can usually point it at the appropriate URL (look at the plugin documentation or site information) and let Eclipse pull down and install the plugin. It will restart and you'll be set. Other times you have to manually download a zip file containing the plugin and extract it to your plugins directory. Be careful that you are putting the plugin in the correct place. Yet other plugins, like MyEclipse, actually have their own installer. Since MyEclipse is a commercial plugin package, you have to run the installer and enter a valid serial number to be able to use it. You just point it at your Eclipse installation and it does the rest. As an aside, sometimes you can install a plugin and it just won't show up. In cases like this, I've had luck with starting Eclipse in "clean mode". Set up a shortcut to Eclipse like "eclipse.exe -clean", which sort of kicks it in the butt and makes it reload everything. Now before you run off and start downloading and installing all these plugins, I urge you to hold back for a moment and go read up on managing multiple Eclipse installations (thanks to Andy Jarrett for blogging that back in '05). The idea here is to separate your core Eclipse installations (3.1 vs. 3.2 for example), your Eclipse workspaces, and your Eclipse extensions (plugins) into separate folders. This way it is much, much easier when Eclipse 3.3 or whatever comes out. Instead of having to reinstall all the plugins again, you can just point the new version at your extensions folder and bam, they're all sucked in. The same goes for your CFEclipse snippets (put them in the extensions folder) so multiple installations of Eclipse can all point to the same set of snippets. Doing this is not very easy and it doesn't gain you a whole lot right now. But going forward this results in a much more maintainable setup, believe me. One last bit of advice: back everything up. Eclipse is pretty huge, but since it is a Java application it is completely standalone. That means you can literally just copy all your Eclipse folders to a backup location with no issues. If you ever corrupt the installation or something horrible goes wrong with your system, you can easily restore. Don't underestimate how much time you will save by not having to completely rebuild everything. Trust me on this, I've had to do it both ways and the simple copy and paste beats the pants off reinstalling everything. Eclipse is a great IDE but it has its prickly points and annoying nuances. It takes a while to get used to using it but the benefits are well worth it. Let me know if any of this is helpful, and if you have any tips or tricks of your own feel free to post about them in the comments. [...]



The Coding Holy Grail in CFEclipse?

Mon, 14 Nov 2005 21:36:00 -0700

I've been playing with Eclipse a lot lately to help me learn more about Java. Using Eclipse to write Java code is just a joy, and I wanted to point this out in the hope that maybe CFEclipse can eventually get us to this point with our CFML coding. It might not even be possible (or just extremely difficult) to do this in a language like CFML that is not compiled until runtime, but hey, a guy can dream. I'm a big fan of a development approach called "Coding by Intention". The basic idea is that when you start coding something like a CFC, you should write the "high-level" methods first, but each line of the high-level method is actually a call to a lower-level method that hasn't even been created yet. So you might do something like:
"processForm" access="public" returntype="void" output="false" hint="I validate the form and insert the data into the database.">
   "data" type="struct" required="true" hint="The raw form data." />
   "" />
   
   
Where validateData() and getDAO() aren't even created yet. They'll be private methods. The idea is to write the "sergeant" method and pretend that whatever you need is already there. Once you know what you need it's fairly easy to go back and create each of the individual "private" methods. My real point here isn't to harp on "Code by Intention" but to exalt how easy Eclipse makes this when writing Java. Imagine you're coding in Java and you write the line:
Person p = new Person("Brian");
You can then put the cursor over "new Person" and press Control-1, and a little pop up offers you the choice to "Create Class Person?". How nice, you think, and click it. Bam, a skeleton Person class is generated. Again hover over "new Person" and hit Control-1, and now it asks "Create Constructor Person(String)?" You click that and a constructor skeleton is created that matches the arguments that you declared. You can do this for any "Code by Intention" methods you create and it will spit out the private methods with matching method signatures. Further, you can go to the Refactor menu and do all sorts of crazy things like automatically create factory methods and make the constructor private, generate getters and setters, move common methods up the inheritance tree, etc. And whenever you do these things, the IDE automatically updates all references in your project to reflect the change. Can you imagine doing things like this to write CFML? To me this would be a Coding Holy Grail. Now I know that some (all?) of this would be extremely difficult in a typeless, runtime language like CFML. My hope is that bringing these features up to folks who might not be aware of them will generate interest in trying to do these things in CFEclipse. To be honest I never knew IDE's could do things like this. So, would features like this be useful to other CFers or am I just wigging out because I hadn't seen things like this before? Are things like this even possible goals for CFEclipse?