| |||||||||
Eclipse tip: Templates
Eclipse tip: TemplatesMany people don't realize the amount of configuration that is possible in the Eclipse IDE. Generally, if you get the feeling that what you are doing could be automated, chances are that it can. This tip is concerned with making eclipse program for you, rather than you programming in eclipse! (sounds nice, doesn't it :-) The idea is to set up templates of code and make use of these whilst programming.
Templates are general in their form. I've chosen to introduce them using a real-life case. A template I rather enjoy.
When writing structured unit tests, you often declare a lot of helper classes to create populated domain objects for you (see e.g. the
"object mother pattern").
This means you'll do loads of
The idea is that when you type ![]() Setting up a template in Eclipse to automate programming tasks.
Now fill out the window as detailed in the above image. You are now able to type
While there are limits to what you can express using templates, they do enable you to automate quite a lot of code. I recall writing templates
for automating code when writing business delegates (a useless J2EE pattern forced upon you should you be so unlucky as to code EJB2). I advice
you to set up the CommentsIf you have any comments to this article, please drop me a mail at firstclassthoughts at gmail dot com please indicate if I can't publish whole or parts of your comment on the site.If you like this site consider Help spread the wordShare this post on your favorite social bookmarking sites:
The most recent contributions 20/05/09 Board Game Jungle speed / Arriba Review of the cool game "Jungle Speed" aka. "Arriba". 16/05/09 Danish Twin words "Twin words" are words that not only have multiple meanings, they must be composed next to each other in meaningful sentences. This article explores the concept of twin words. 14/05/09 English Twin words "Twin words" are words that not only have multiple meanings, they must be composed next to each other in meaningful sentences. This article explores the concept of twin words. 04/05/09 'Office space' extras Crazy stuff about the funny movie "Office space". Nothing of interest? Try browsing the entire article archive... | |||||||||