13 Replies Last post: Aug 12, 2008 11:45 AM by Anna Kozlova  
Taras Tielkes Apprentice 1,029 posts since
Oct 20, 2002
Currently Being Moderated

Jul 31, 2008 1:50 AM

Another plugin idea: DFA-based navigation

Let's say I'm inside a method, which got passed some string parameter named "userName".

 

The calling method may be just passing on the value which it received.

The method itself may in turn pass this parameter to other methods, etc.

 

Actually this it quite common for some category of parameters:

- a web controller extracts some parameter from HttpServletRequest

- passes this parameter to a service object

- the service object in turn passes it on to a DAO

- the DAO passes it on to a JDBC API method

 

Looking at the flow of this parameter through the code, it would look like a mostly-hierarchical graph (with cycles in some scenarios).

The edges of the graph can be of two types:

"input edges": the parameter is initialized / assigned

"output edges": the parameter is passed to some method outside of project source

 

I have some ideas about UI as well, but first I'd like to know:

- will something like this fly? If not, what are the obvious blockers?

- do any other products provide something similar? (IIRC next version of VS is supposed to have something)

- and last but not least: is there some code or IDEA APIs that could be useful?

 

Meanwhile I'm going to give the previous idea a go (thanks Bas and Dmitry)

 

Taras

Guest
Currently Being Moderated
Jul 31, 2008 11:11 AM in response to: Taras Tielkes
Re: Another plugin idea: DFA-based navigation

Hello Taras,

 

The weirdly named "Slice backward" feature in Diana does exactly this type

of analysis. Please try it out.

 

Let's say I'm inside a method, which got passed some string parameter

named "userName".

 

The calling method may be just passing on the value which it received.

The method itself may in turn pass this parameter to other methods,

etc.

 

Actually this it quite common for some category of parameters:

- a web controller extracts some parameter from HttpServletRequest

- passes this parameter to a service object

- the service object in turn passes it on to a DAO

- the DAO passes it on to a JDBC API method

Looking at the flow of this parameter through the code, it would look

like a mostly-hierarchical graph (with cycles in some scenarios).

 

The edges of the graph can be of two types:

 

"input edges": the parameter is initialized / assigned

 

"output edges": the parameter is passed to some method outside of

project source

 

I have some ideas about UI as well, but first I'd like to know:

 

- will something like this fly? If not, what are the obvious blockers?

 

- do any other products provide something similar? (IIRC next version

of VS is supposed to have something)

 

- and last but not least: is there some code or IDEA APIs that could

be useful?

 

Meanwhile I'm going to give the previous idea a go (thanks Bas and

Dmitry)

 

Taras

 

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

 

 

 

Guest
Currently Being Moderated
Aug 2, 2008 10:01 PM in response to: Taras Tielkes
Re: Another plugin idea: DFA-based navigation

Hello Taras,

 

Dmitry wrote:

Please try it out.

 

Yeah, that's what I was looking for.

 

My main problem/request is: make the search cancellable. Sometimes I

open a node (by mistake) that causes a very long/extensive search to

be performed.

 

Shall I create a JIRA request?

 

Please do.

 

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

 

 

 

Thibaut  Apprentice 1,011 posts since
Jan 27, 2003
Currently Being Moderated
Aug 4, 2008 5:31 PM in response to: Dmitry Jemerov
Re: Another plugin idea: DFA-based navigation

Dmitry, how do you trigger this ?

 

I managed to find there is a (disabled) "slice" toolwindow, but couldn't find how to activate it

Guest
Currently Being Moderated
Aug 4, 2008 6:01 PM in response to: Thibaut
Re: Another plugin idea: DFA-based navigation

Hello Thibaut,

 

Dmitry, how do you trigger this ?

 

I managed to find there is a (disabled) "slice" toolwindow, but

couldn't find how to activate it

 

Please wait for the next EAP.

 

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

 

 

 

Anna Kozlova JetBrains 535 posts since
Aug 16, 2004
Currently Being Moderated
Aug 12, 2008 11:45 AM in response to: Taras Tielkes
Re: Another plugin idea: DFA-based navigation

Hello Taras,

 

duplicated paths

 

 

Thank you

-


Anna Kozlova

JetBrains Inc.

http://www.intellij.com

"Develop with pleasure!"

 

Dmitry,

 

Can you give an explanation on the "gray sections" in the DFA tree

view?

 

 

 

 

Guest
Currently Being Moderated
Jul 31, 2008 4:00 PM in response to: Taras Tielkes
Re: Another plugin idea: DFA-based navigation

Hello Taras,

 

Where is it hidden?

 

-Didea.is.internal=true

 

And does it work both forward and backward?

 

At the moment it works only backward.

 

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

 

 

 

Dave Griffith Newbie 34 posts since
Dec 11, 2006
Currently Being Moderated
Aug 2, 2008 8:45 PM in response to: Dmitry Jemerov
Re: Another plugin idea: DFA-based navigation

Not a bad start.  Definitely needs some highlighting magic (more than the tree-based view).  Also some way to show the transitive closure of backward slices, so that it can highlight any code which might impact the value of the selected expression, even indirectly (it currently seems to only go back two steps).  Also, of course, forward slicing. I actually managed to find a bug in the 10 line test program I whomped up to try this out.  I look forward to seeing the end results.

 

--Dave Griffith

More Like This

  • Retrieving data ...