CFEclipse CFExplained Part I
By Robert Blackburn
Meet Joe. Joe doesn't know much about computers, but has a grandson who does. One day Joe finds that his computer is acting funny, and promptly calls in his grandson for assistance. His grandson finds that the computer has a virus, most likely introduced while surfing the web. He runs the anti-virus program, cleans up the computer, and does what any geek would do these days; he tells his grandfather to start using Firefox.
"But I don't know how to use this Firefox thing," Joe says.
"Don't worry, Granddad, it's great," his grandson replies. He then proceeds to explain all the great features of Firefox -- tabbed browsing, plug-ins, skins, the toolbar search -- the whole nine yards. But the next day when he pays a visit, he sees his grandfather using Internet Explorer again.
"Why are you using IE, Granddad?"
"Because that Firefox was too complicated."
What went wrong? Well, all Joe needed to know was how to use Firefox. His grandson got so excited and wrapped up in Firefox's features that Joe got the impression that Firefox was complicated. In reality, Firefox is no more difficult to use than Internet Explorer, just a bit different at times. Had his grandson simply explained how to use Firefox first, Joe probably would have grown comfortable with it and learned about all the great features later.
Many ColdFusion developers encounter a similar problem. They are accustomed to using their traditional development IDE. They see the value in switching to CFEclipse, but when they try to switch over they find that things are different, get frustrated, and fall back to their previous IDE. But just as Firefox is no harder to use then IE, CFEclipse is not really any harder to use than the traditional ColdFusion IDEs. It's just different and will take time to adjust to. Yet, like Joe's grandson, many of us try to start out using CFEclipse by focusing on all the cool features when we simply need to understand how to use it.
This two-part article will attempt to provide a clear and comfortable path into using CFEclipse. In this part of the article, we will clarify what CFEclipse is and explain some of the new terms and concepts you'll encounter. In the second part, we will walk you through some typical work scenarios with CFEclipse. By doing this we will not only give you the keys to success, we will show you how to use them.
What is CFEclipse?
CFEclipse is a plug-in to Eclipse, an Integrated Development Environment (IDE) platform that is popular among Java developers but also includes support for many of the most popular programming languages. Eclipse is extremely flexible and customizable, which is one of the reasons it has become so popular among so many different development communities. And I'm sure being free has something to do with its success as well.
If you have been developing ColdFusion using some other IDE like Homesite+, CFStudio, or Dreamweaver MX, you probably already have a development environment for your site. If you don't you will need to set one up. (
ColdFusion Server developer edition is free). Once your site's development environment is set up, you will need to install Eclipse and CFEclipse.
Installing Eclipse
You can install Eclipse by downloading the most recent version from the
Eclipse download page Then unpack and run the install.
Installing CFElcipse Plug-in
Once you have installed Eclipse, you will need to install the CFEclipse plug-in. You can find the easy-to-follow directions on the CFEclipse
download page. Simply follow the directions in the "Installing the Stable Build" section.
Definitions and Terminology
As I said earlier, there are some differences between CFEclipse and previous code editors for ColdFusion. In CFEclipse, you will find a number of new terms and concepts, but the primary ones are:
- Workspace
- Project
- Workbench
- View
- Perspective
Let's take a minute to look at these new terms.
Workspaces
A workspace is a collection of projects, files, and folders. Files and folders are nothing new, but projects are, and will be explained further later.
One of Eclipse's features is that you can have more then one workspace on your computer. Each workspace will be separate from the other workspaces, segregating your work. For example, if I am going to be doing a presentation where I need to show some code, I might set up a separate workspace for that demonstration. That way, only the example files I need are visible and my normal work does not clutter the screen. A consultant might use a different workspace for each client. Someone else might always use the same workspace. What you do is up to you.
Each time you open Eclipse, it will ask you for the location of the workspace you would like to use. Don't stress where to set up your workspace initially, as you can always change your mind later. If you can't decide, I would suggest just using your development server's web root to start.
Projects
A project is how you organize your work in Eclipse, and is essentially a collection of files and folders. How you define what is in each project is up to you. Projects can be an entire web site or a single application, depending on your business model and development style. If you are a consultant, you may use projects differently then if you are a corporate developer.
Projects are not only a way to organize your work. They also provide Eclipse's plug-ins with a way to view and access your work. This means that in order to use Eclipse to its fullest potential, everything you work on must be in a project first. I think that is why projects are often the largest stumbling block for CF developers; they can't just open and edit a file. This can feel very frustrating and confining at first. It did for me. But once I adjusted to it, I actually began to prefer working that way.
Don't worry if projects still seem like a foreign concept. In the next part of this article we will cover typical workflows in CFEclipse, which will give you a much better understanding of how they work.
Workbench
The workbench is the main work area in Eclipse. This is all the panes and panels used to edit resources within your workspace. Let's take a look at the workbench's basic anatomy.
Views
Views are all those panels surrounding the main editing pane. When you install the CFEclipse plug-in you get 7 new views specific to working with ColdFusion:
- Browser View
- Dictionary View
- File Explorer
- FTP Log View
- Methods View
- Package View
- Snip Tree View
Some of these are fairly self explanatory, but if you are interested in knowing more, there will be another series of articles coming soon which will be covering the different features in CFEclipse in more detail.
The wide variety of views, and the fact that there are even more available online, provides you with enormous flexibility in customizing your working environment. Views can be toggled on and off whenever you like by clicking "Window" > "Show View" in the menu.
Perspectives
Perspectives are the different ways of looking at the work you do. Each perspective is completely customizable to fit your own development style. CFEclipse comes with a perspective or you can make your own perspectives. For example, you may have a different perspective for your Java, Flex, and ColdFusion projects ? and each of those can have different plug-ins, views, or features enabled, depending on what you find useful for that type of work. For example, the Browser View might be enabled for the ColdFusion perspective but not the others. As you switch between perspectives, it's almost like you?re switching between completely different tools.
You can switch between perspectives by clicking on the appropriate icon in the perspective tab at the top right corner of the workbench or by clicking "Window" > "Open Perspective" in the menu. Feel free to customize the perspectives as much as you like. You can always set the perspective back to its original state by clicking "Window" > "Reset Perspective".
Summary
At this point we have talked about what CFEclipse is and some of its new concepts. In the
second part of this article we will go deeper into the tool and actually show you how to use it for a typical ColdFusion project.
Relevant Links:
Eclipse Download Page
CFEclipse Download Page
Robert Blackburn is a developer and team leader of the Internet Application Development team at American Power Conversion Corporation (
http://www.apcc.com). He has been using ColdFusion since 1999, and has revived and manages the CFUnit open source project (
http://cfunit.sourceforge.net). He currently has a blog at
http://www.rbdev.net/devblog for his occasional ramblings.