Could we have code patterns (GOF etc) in new version of Idea?

I know we've got code templates etc, but it would be very useful to have a set of built in patterns (GOF would be a good start) and the ability for people to write these as downloadable additions to idea.

We used to use Together, and that was one of it's majorly useful features - It's now borland, so eughhh :(

Anyway, this is a feature request - I'd be interested to hear comments

TIA

7 comments
Comment actions Permalink

On 29-07-2004 14:26, john grange wrote:

I know we've got code templates etc, but it would be very useful to
have a set of built in patterns (GOF would be a good start) and the
ability for people to write these as downloadable additions to idea.

We used to use Together, and that was one of it's majorly useful
features - It's now borland, so eughhh :(


I'm not familiar with Together. Could you give a bit more explanation
how this feature should work? It's an expansion of templates?

Bas

0
Comment actions Permalink

I'll give you an example:

I have an entity bean and what i want to do is to create a transfer object factory for that bean (as a stateless session bean). What I would want to do is:

Right click on entity bean->Patterns->J2EE->DTO Factory. This then pops up a dialog box asking me how I want to implement it (As a Session bean), what package/classname I want to give it and which properties I want to include from the original entity bean. It then goes away and creates the Session Bean and DTO code for me.

I know that I can do a refactor to create a factory method instead of a constructor for a class - this is sort of going in the right way, but if we could have a framework for the creation and distribution of pattern wizards, then we would greatly enhance the (already very good) productivity benefits of idea.

Patterns are important in that they avoid developers making mistakes that have been rectified by others in the past. Making the implementation of patterns integral to an IDE enables developers to concentrate on the specifics of their code rather than having to write the boilerplate code to implement the patterns themselves.

Idea is already very strong with it's helpful features which avoid programmers from having to type in boilerplate code (the generation of getters and setters being a very good case in point) and thereby encouraging good programming practice. The addition of patterns just seems like a logical progression to me...

Regards

0
Comment actions Permalink

john grange wrote:

> (the generation of getters and setters being a very good

case in point) and thereby encouraging good programming practice.


If you want an IDE to encourage good programming practice, then giving
people options to generate swathes of get/set methods isn't exactly a
smart move - you may as well offer a "Make All Instance Variables
Public" option instead.

0
Comment actions Permalink

I humbly apologize for tempting you off the track of this thread - I was using the get/set as an example of how idea helps you to focus on matters more important than merely typing on the keyboard.

0
Comment actions Permalink

john grange wrote:

I humbly apologize for tempting you off the track of this thread
I was using the get/set as an example of how idea helps you to
focus on matters more important than merely typing on the keyboard.


No worries, I wasn't trying to start a flamewar - I agree that a good
IDE should aid/enforce good programming style - helping to generate
recognised patterns wouldn't be a bad idea.

0
Comment actions Permalink

Thanks.

Right, where do we go from here on this discussion?

Thinking about it last night, some patterns could be done using file templates (albeit needing to generate multiple files at once) and some as refactorings. Most, however, would require some sort of input from the developer via a gui and I do feel that it would be sensible to group them all together in one place.

Also, some patterns could be generated "cold" i.e. you would not have to have selected a class or group of classes that you are applying a pattern to. Other patterns would have to be enabled in a context sensitive manner depending on the class(es) you have selected at the time.

Again, where do we go from here? Do the people at intellij monitor these forums? Is there anybody out there with the knowledge who wants to try and run with the idea using the existing plugin framework?

Ideas/suggestions gratefully received....

0
Comment actions Permalink

You could start by adding the request to the Feature Request page of the Wiki. Not sure how much heed the IDEA developers take of it, but it's certainly a place to start.

0

Please sign in to leave a comment.