Thread: [SrcML] static analyzis
Status: Beta
Brought to you by:
crashchaos
From: Leif B. <lei...@in...> - 2005-05-24 19:22:14
|
The analyzer plugins can handle more than one SrcML document now. Therefore I changed the execute method from: public abstract Vector execute(SrcML f_srcml) throws PluginException; to public abstract Vector execute(Vector f_docs) throws PluginException; I also changed the Analyzer Platform, but I didn't adopted the way the View Platform handles this. Instead I will use a Vector with SrcML documents in it. To manage the Vector there are 4 methods: public Vector addDocument(SrcML f_srcml) {} public Vector getDocuments() {} public void removeAllDocuments() {} public Vector removeDocument(SrcML f_srcml) {} The advantage is, that you can add all your files you want to be analyzed and then run numerous analyzes on it, with just set the new plugin each time. As always, tell me what you think about it! Leif |
From: Frank R. <fra...@in...> - 2005-05-27 23:28:06
|
On Tue, May 24, 2005 at 09:22:16PM +0200, Leif Bladt wrote: > The analyzer plugins can handle more than one SrcML document now. > Therefore I changed the execute method from: > public abstract Vector execute(SrcML f_srcml) throws > PluginException; > to > public abstract Vector execute(Vector f_docs) throws > PluginException; You can change that into public abstract Vector<AnalyzerResult> execute( Vector<SrcML> f_docs) throws PluginException now that we 'support' java 1.5 to increase the type safety. (same for the methods below) > I also changed the Analyzer Platform, but I didn't adopted the way the > View Platform handles this. Instead I will use a Vector with SrcML > documents in it. To manage the Vector there are 4 methods: > public Vector addDocument(SrcML f_srcml) {} > public Vector getDocuments() {} > public void removeAllDocuments() {} > public Vector removeDocument(SrcML f_srcml) {} So if I understand that correctly the AnalyzerPlatform still only has a execute() method without parameters, but implicitly calls the plugin with execute(getDocuments()) ? > The advantage is, that you can add all your files you want to be > analyzed and then run numerous analyzes on it, with just set the new > plugin each time. > > As always, tell me what you think about it! Sounds good. Although you could do the same for the View too. The Vector of SrcML documents has to be created 'somewhere'. In your case the AnalyzerPlatform takes care of it and in the case of the ViewPlatform the callee would have to use the same Vector for every chosen ViewPlugin. But from a design point of view your solution looks better to me as it's emphasizing the platform concept more clearly. -- Raiser, Frank Student @ University of Ulm (www.uni-ulm.de) |
From: Leif B. <lei...@in...> - 2005-05-29 21:47:20
|
> You can change that into > public abstract Vector<AnalyzerResult> execute( > Vector<SrcML> f_docs) throws PluginException > now that we 'support' java 1.5 to increase the type safety. > (same for the methods below) ok >> public Vector addDocument(SrcML f_srcml) {} >> public Vector getDocuments() {} >> public void removeAllDocuments() {} >> public Vector removeDocument(SrcML f_srcml) {} > So if I understand that correctly the AnalyzerPlatform still only > has a execute() method without parameters, but implicitly calls > the plugin with execute(getDocuments()) ? exactly. Do you see any problems with this? >> The advantage is, that you can add all your files you want to be >> analyzed and then run numerous analyzes on it, with just set the new >> plugin each time. > Sounds good. Although you could do the same for the View too. The > Vector of SrcML documents has to be created 'somewhere'. In your > case the AnalyzerPlatform takes care of it and in the case of the > ViewPlatform the callee would have to use the same Vector for every > chosen ViewPlugin. But from a design point of view your solution > looks better to me as it's emphasizing the platform concept more > clearly. ok, but this could take 'til wednesday. > Leif |
From: Frank R. <fra...@in...> - 2005-05-29 21:52:56
|
On Sun, May 29, 2005 at 11:47:12PM +0200, Leif Bladt wrote: > >So if I understand that correctly the AnalyzerPlatform still only > >has a execute() method without parameters, but implicitly calls > >the plugin with execute(getDocuments()) ? > exactly. Do you see any problems with this? not at all. just wanted to make sure. > >Sounds good. Although you could do the same for the View too. The > >Vector of SrcML documents has to be created 'somewhere'. In your > >case the AnalyzerPlatform takes care of it and in the case of the > >ViewPlatform the callee would have to use the same Vector for every > >chosen ViewPlugin. But from a design point of view your solution > >looks better to me as it's emphasizing the platform concept more > >clearly. > ok, but this could take 'til wednesday. I was not suggesting you change anything. We should rather discuss if it's worth to restructure the ViewPlatform the way the AnalyzerPlatform works to get a more unified interface for handling the SrcML documents in those platforms. -- Raiser, Frank Student @ University of Ulm (www.uni-ulm.de) Software is like sex: It's better when it's free. (Linus Torvalds) |