Finger Macros in Java EE Development (part 1)

As folks can probably tell, my main responsibility around here is to help maintain and extend the integration modules for GlassFish and Sun's application server offerings. I am also very interested in the development experience for Java EE that NetBeans provides.

I recently started looking at how to structure a couple simple elements of IDE to reduce the number of keystrokes that I use when working on a web or enterprise project. My goal is to find the edge cases and propose some enhancements.

The two elements of the IDE are the editor and the 'Main Project'. The editor is obvious, since almost every change that you want to test will be made there. The 'Main Project' is special, since a number of actions and keybindings trigger actions associated with this project, instead of the project which "owns" the code that you have focused in the editor.

I started off looking at a various scenarios to see what the current situation is. Since I was writing it down, I figured I might as well share what I found.

In the first set of experiments I have two projects open. I have a web app as the Main Project and an additional class library project that the web app depends on.

File in the EditorFrom Main ProjectAction (Keybinding)Result
A jsp fileyesSave (Command-S)File saved to source and deployment directory. The user can switch applications to the browser (Command-Tab), possibly need to switch application windows (Command-`) and finally reload the page (Command-R) to see their updated content.
a jsp fileyesRun File (Shift-F6)The jsp file is saved (if it was edited). The web application is redeployed (in place). The browser is told to load the page automatically.
a servletyesRun File (Shift-F6)The changed file is saved and recompiled. The web app is redeployed. A dialog may open to confirm the value of the URL to open in the browser, relative to the context root of the web app. The IDE tells the browser to open using the context root and the relative URL.
A java file that isn't a servletyesRun File (Shift-R6)The java file is saved. If the class has a public static main(String[]), it gets run (just like a regular Java project). If the class doesn't have a main(), an error message is displayed.
any fileyesRun Project (not bound by default)Changes are saved. Any necessary compilations are done. The web app is directory deployed. The browser is opened and told to load the URL constructed from the values of the context root and the relative URL.
any filenoRun Main Project (F6)Changes are saved. Any necessary compilations are done. The web app is directory deployed. The browser is opened and told to load the URL constructed from the values of the context root and the relative URL.

I did notice one thing while working on some larger sample applications, that was a bit embarassing for me. In the past I have touted the joy of the save and reload development workflow. Once a project got beyond JSP development or I had multiple projects that I was integrating and testing, Run Main Project (F6), judicious management of the Main Project and its Relative Url were the things that helped keep me productive.

Comments:

Post a Comment:
Comments are closed for this entry.
About


Vince Kraemer writes the entries in this blog.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today
News
Blogroll

No bookmarks in folder

automarks