Re: [basedb-devel] How to extend and override BioAssaySetExporterand Base1PluginExecuter?

2007-08-29 Thread Adam Ameur
Hi,

I would like to extend some methods in the Base1PluginExecuter for  
another purpose. I'm trying to create a more general version of the  
plug-in that is allowed to run on both 1- and 2-channel data.

So if possible. I would want to have the following methods/classes  
changed to 'protected':
getPluginDirectory
getExecDirectory
importFiles
importData
StreamHandler
copy
deleteDir

I think that's all but there could still be something missing.  
Personnaly I would prefer all methods/variables in  
Base1PluginExecuter being made protected or public.  But maybe there  
are good reasons for keeping some things private.

Best Regards,

Adam Ameur
PhD Student
The Linnaeus Centre for Bioinformatics
Uppsala University
Sweden

On Aug 28, 2007, at 1:41 PM, vegard nygaard wrote:


 Hi.


 I add this as a ticket. Can you specify the methods that you need
 acces to.

 /Johan


 I tried using the protected modifier Kjell proposed. And for that  
 worked
 except for ListMap Which I think is a so called inner class of
 Base1PluginExecuter. It had to be public.

 I changed in modifier from private to protected for these
 methods/variables:

 Base1PluginExecuter.java
 usedColumnsParameter
 usedFieldsParameter
 getPluginDirectory
 geneAveragesParameter
 jobParametersParameter
 serialFormatParameter
 getJobParametersFromXML
 ListMap had to be public, protected was not enough.

 BioAssaySetExporter.java
 getBaseFileQIMap
 exportBaseFileSectionHead
 exportBaseFileSectionAssays
 getBaseFileSpotSectionCount
 exportBaseFileSectionSpots


 I think this was sufficient for me now, but I am not sure. I  
 propose that
 methods/variables in classes that might be extended should use the  
 protected
 or public modifier. But there might be other downsides with that  
 approach
 that I don't see.

 Best Regards
 Vegard Nygaard
 Software Engineer
 Department of Tumor Biology (Montebello)
 Rikshospitalet-Radiumhospitalet Medical Center 0310 Oslo
 Bioinformatics user support (NMC)
 Phone 0047 22935590





 17 aug 2007 kl. 16.18 skrev vegard nygaard:



 I want to export more than standard information in the base-file
 sent to my
 plug-in. That is more sections describing the samples, hybs,
 arrays and
 their relationships.  My first plan was to extend
 BioAssaySetExporter and
 Base1PluginExecuter, and then override the methods where the
 information is
 written to file (stdin.txt) adding my extra stuff. This approach
 failed when
 I encountered lots of private methods in Base1PluginExecuter and
 BioAssaySetExporter, making them less useful for extension since I
 have to
 override all the private parts I need even if I don't need to alter
 them.
 Why are those methods private and not public? Is there a better way
 to solve
 my problem?

 A more cumbersome approach is to copy both files (and others if
 needed),
 rename them, do my modifications and it will work. This is what I
 have done
 for years with BASE1, giving me an extra cut and paste job each
 time base1
 was updated and I had to re-update my custom files. I hope BASE2
 can do this
 in a more neat way.

 Best Regards

 Vegard Nygaard
 Software Engineer
 Department of Tumor Biology (Montebello)
 Rikshospitalet-Radiumhospitalet Medical Center 0310 Oslo
 Bioinformatics user support (NMC)
 Phone 0047 22935590



  
 --
 ---
 This SF.net email is sponsored by: Splunk Inc.
 Still grepping through log files to find problems?  Stop.
 Now Search log events and configuration files using AJAX and a
 browser.
 Download your FREE copy of Splunk now   http://get.splunk.com/
 ___
 basedb-devel mailing list
 basedb-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/basedb-devel


 - 
 
 This SF.net email is sponsored by: Splunk Inc.
 Still grepping through log files to find problems?  Stop.
 Now Search log events and configuration files using AJAX and a  
 browser.
 Download your FREE copy of Splunk now   http://get.splunk.com/
 ___
 basedb-devel mailing list
 basedb-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/basedb-devel


 -- 
 ---
 This SF.net email is sponsored by: Splunk Inc.
 Still grepping through log files to find problems?  Stop.
 Now Search log events and configuration files using AJAX and a  
 browser.
 Download your FREE copy of Splunk now   http://get.splunk.com/
 ___
 basedb-devel mailing list
 basedb-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/basedb-devel


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and 

Re: [basedb-devel] How to extend and override BioAssaySetExporterand Base1PluginExecuter?

2007-08-29 Thread Nicklas Nordborg
Adam Ameur wrote:
  Hi,
 
  I would like to extend some methods in the Base1PluginExecuter for
  another purpose.

I think we need to be careful about this. The Base1PluginExecuter and 
BioAssaySetExporter was designed and implemented to solve ONE specific 
problem: Being able to run plug-ins developed for BASE 1 under BASE 2.

I can understand why people want to use the two classes for other but 
similar purposes since they contain a lot of useful code. Considering 
the historical changes (which has been large) in those two classes I 
don't think they are stable enough to make subclassing an appropriate 
solution in this case. Making methods 'public' or 'protected' instead of 
'private' also means a future commitment to not change the contract of 
those methods (ie. method name, method parameters, return values, what 
they are supposed to do, etc...).

The developers of the Affymetrix-related plug-ins, RMAExpress and Plier 
(http://lev.thep.lu.se/trac/baseplugins/wiki/se.lu.thep.affymetrix), 
faced almost the same problem. In this case, the RMAExpress plug-in was 
developed first. When development on the Plier plug-in started the 
developers realized that a lot of code was very similar and moved much 
code to an abstract base class: AbstractExternalBinaryPlugin

I think a similar approach is a better solution also in the case of the 
Base1PluginExecuter and BioAssaySetExporter. That is, we should 
introduce the abstract classes AbstractPluginExecuter and 
AbstractBioAssaySetExporter. The hard part will be to decide what should 
go into the new abstract classes. The existing code will not take us all 
the way. I think we also need Vegard's and Adam's use cases to find a 
common pattern that can be used when designing the abstract classes.

Other opinions on this matter and offers to help with the implementation 
are welcome.

/Nicklas

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
basedb-devel mailing list
basedb-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/basedb-devel