Attached is a raw listing of which packages import which packages in Jalview. It may spark some comments like "that shouldn't be there!" (e.g. jalview.datamodel importing from Varna).
Generated by running the following bash command in the src folder (feel free to enhance!): * traverse directories * grep *.java for "import" lines * remove duplicates * remove "import " * remove the class name by reversing, removing the first field by '.', reversing back * remove duplicates * remove "import java.*" for file in $(find . -type d); do echo -e "\n$file" imports; grep -sh ^import $file/*.java | sort -u | cut -c 8- | rev | cut -f2- -d. | rev | sort -u; done | grep -v ^java\. mungo Mungo Carstairs Jalview Computational Scientist The Barton Group Division of Computational Biology College of Life Sciences University of Dundee, Dundee, Scotland, UK. www.jalview.org<http://www.jalview.org/> www.compbio.dundee.ac.uk<http://www.compbio.dundee.ac.uk/> ________________________________ From: [email protected] <[email protected]> on behalf of Jim Procter <[email protected]> Sent: 17 June 2015 12:13 To: Jalview Development List Subject: [Jalview-dev] [RFC] Jalview 2.9-> 3.0 architecture: package coding guidelines Hi all. This is a request for comments. I thought it worth resurrecting a conversation Mungo and I started back in January about deciding what packages should have what code. For OSGi, we need to have clear separation between concrete GUI implementations, and core modules implementing the datamodel, IO, analysis, rendering, and view/model/controller functions. Please have a look at the discussion below. Email comments/revisions to this thread, and I'll integrate all into a master document as we develop our 3.0 vision. For now, its also worth reviewing code you've created to see how it fits with these guidelines.... Jim. On 07/01/2015 11:06, Mungo Carstairs (Staff) wrote: I don't know if you are online today, but if so could you remind me of the rules about what is, or in particular isn't, allowed to go in the jbgui classes? The rule with jbgui is that it should only include platform gui implementation code. No application GUI logic (although there are some exceptions which should be fixed re certain menus), and absolutely no controller/datamodel/view logic. There's a much longer braindump below that I'd like to refine to some working rules for all of us. But.. read on first. Reason: I have been refactoring the duplicated code in AppJmol and ChimeraViewFrame into GStructureViewer in my local branch. I suspect I may have overdone it, and need instead to create a common base class in the gui package. nooo! The refactoring strategy here needs to be independent of the jbgui package. As I see it, the parallels are that Chimera is a peer for viewing structure data mapped to sequences shaded according to current alignment view state and can take commands to create superpositions according to alignments. All these functions are GUI independent, but map to logical structureViewer operations so they should be in a non-gui controller package that implements a structureViewerModel API that Jalview's GUI can employ. Unlike Jmol and MView, Chimera doesn't provide a rendering window, so the concrete GUI implementation for Chimera only serves as a proxy for the external chimera instance. Its geometry needs to be preserved on restore, but the way that chimera sessions are saved and restored is different to Jmol, so that functionality shouldn't be shoehorned into the same inheritance model. More generally, thre refactoring rule I'm following is to introduce a non-GUI dependent model wherever possible that is employed by a GUI class to maintain state, allowing multiple GUI implementations to employ the same core logic. This gets around Java's lack of support for multiple inheritance, and to avoid lockin to particular Java platform APIs that may not always be available. jbgui classes are only necessary for concrete swing windows, and it only makes sense to inherit from the same jbgui class if the end products are different flavours of the same swing window. Now, the braindump.. which - as mentioned is a work in progress.. The basic rules I have been following are: 1. Refactor or implement data views and associated get/set/modify logic to concrete classes which implement interfaces defined in jalview.api. The first one of these was the Viewport. 2. Keep Desktop or applet specific model/state logic in gui and appletgui. This bit needs to change [in order to create Jalview 3.0]. Originally, each one contained runtime/setup logic, actions to execute data analysis steps and construct new views from the results, and view state analysis code to make the GUI reflect current model state. What we ideally want is a full separation... so: 3. Refactor any control logic to classes in jalview.controller - should only import from non-gui packages. 4. Place any code dependent on both jalview and non-jalview APIs in ext. 5. Insulate GUI API dependent code (e.g. swing, awt, etc) from jalview by creating flyweight or wrapper classes implementing jalview interfaces. ** these are UI interfaces, not model interfaces - suggest these will live in a separate subpackage of the api ** Currently, the jalview2xml logic doesn't follow the above at all. Ideally we should have a factory/GUI service interface which takes jalview view/datamodel objects, that is initialised at runtime according to jalview's mode (e.g. running on swing, android, web, etc...). For OSGi, I envision one or more Jalview executable modules that can be told which GUI implementation to use, and autodiscover any other available modules for runtime functionality (database accession sources, database search interfaces, file parsers, alignment and analysis methods, rendering systems) that are compatible with runtime configuration (e.g. sandboxed applet, full desktop application, headless commandline analysis engine, android app, etc). The University of Dundee is a registered Scottish Charity, No: SC015096
. imports ./com imports ./com/stevesoft imports ./com/stevesoft/pat imports com.stevesoft.pat.wrap jalview.util ./com/stevesoft/pat/wrap imports com.stevesoft.pat jalview.util ./ext imports ./ext/edu imports ./ext/edu/ucsf imports ./ext/edu/ucsf/rbvi imports ./ext/edu/ucsf/rbvi/strucviz2 imports ext.edu.ucsf.rbvi.strucviz2.StructureManager ext.edu.ucsf.rbvi.strucviz2.port jalview.bin jalview.gui jalview.ws org.apache.http org.apache.http.message org.slf4j ./ext/edu/ucsf/rbvi/strucviz2/port imports ext.edu.ucsf.rbvi.strucviz2 org.slf4j ./ext/vamsas imports jalview.util ./jalview imports ./jalview/analysis imports com.stevesoft.pat jalview.analysis.SecStrConsensus jalview.api jalview.api.analysis jalview.datamodel jalview.datamodel.BinarySequence jalview.io jalview.math jalview.renderer jalview.schemes jalview.util jalview.ws jalview.ws.seqfetcher ./jalview/analysis/scoremodels imports jalview.analysis jalview.api.analysis jalview.datamodel jalview.schemes jalview.util ./jalview/api imports jalview.analysis jalview.commands jalview.datamodel jalview.schemes jalview.structure ./jalview/api/analysis imports jalview.api jalview.datamodel ./jalview/api/structures imports jalview.schemes jalview.structures.models ./jalview/appletgui imports jalview.analysis jalview.analysis.AnnotationSorter jalview.api jalview.api.analysis jalview.bin jalview.commands jalview.commands.EditCommand jalview.datamodel jalview.datamodel.SearchResults jalview.ext.jmol jalview.gui jalview.io jalview.math jalview.renderer jalview.schemes jalview.structure jalview.structures.models jalview.util jalview.viewmodel jalview.viewmodel.annotationfilter org.jmol.api org.jmol.popup ./jalview/bin imports jalview.api jalview.appletgui jalview.datamodel jalview.gui jalview.io jalview.javascript jalview.structure jalview.util jalview.ws.dbsources.das.api jalview.ws.dbsources.das.datamodel jalview.ws.jws2 netscape.javascript org.apache.log4j ./jalview/binding imports jalview.util org.exolab.castor.xml ./jalview/commands imports jalview.analysis jalview.datamodel jalview.util ./jalview/controller imports jalview.analysis jalview.api jalview.commands jalview.datamodel jalview.util ./jalview/datamodel imports fr.orsay.lri.varna.models.rna jalview.analysis jalview.analysis.SecStrConsensus jalview.io jalview.schemes jalview.util jalview.viewmodel.annotationfilter jalview.viewmodel.annotationfilter.AnnotationFilterParameter ./jalview/datamodel/xdb imports ./jalview/datamodel/xdb/embl imports jalview.datamodel org.exolab.castor.mapping org.exolab.castor.xml ./jalview/exceptions imports ./jalview/ext imports ./jalview/ext/jmol imports jalview.api jalview.datamodel jalview.io jalview.schemes jalview.structure jalview.structures.models jalview.util org.jmol.adapter.smarter org.jmol.api org.jmol.constant org.jmol.modelset org.jmol.modelsetbio org.jmol.popup org.jmol.viewer org.openscience.jmol.app ./jalview/ext/paradise imports jalview.util jalview.ws org.apache.http org.apache.http.message org.json.simple org.json.simple.parser ./jalview/ext/rbvi imports ./jalview/ext/rbvi/chimera imports ext.edu.ucsf.rbvi.strucviz2 ext.edu.ucsf.rbvi.strucviz2.StructureManager jalview.api jalview.bin jalview.datamodel jalview.httpserver jalview.schemes jalview.structure jalview.structures.models jalview.util ./jalview/ext/varna imports fr.orsay.lri.varna.models.rna jalview.api jalview.datamodel jalview.structure jalview.structures.models ./jalview/gui imports com.stevesoft.pat compbio.metadata ext.edu.ucsf.rbvi.strucviz2 fr.orsay.lri.varna fr.orsay.lri.varna.components fr.orsay.lri.varna.exceptions fr.orsay.lri.varna.interfaces fr.orsay.lri.varna.models fr.orsay.lri.varna.models.annotations fr.orsay.lri.varna.models.rna jalview.analysis jalview.analysis.AnnotationSorter jalview.api jalview.api.analysis jalview.api.structures jalview.bin jalview.binding jalview.commands jalview.commands.EditCommand jalview.datamodel jalview.datamodel.SearchResults jalview.datamodel.StructureViewerModel jalview.ext.jmol jalview.ext.rbvi.chimera jalview.ext.varna jalview.gui.Help jalview.gui.OptsAndParamsPage jalview.gui.StructureViewer jalview.gui.ViewSelectionMenu jalview.io jalview.io.packed.DataProvider jalview.jbgui jalview.math jalview.renderer jalview.schemabinding.version2 jalview.schemes jalview.structure jalview.structures.models jalview.util jalview.util.GroupUrlLink jalview.viewmodel jalview.viewmodel.annotationfilter jalview.viewmodel.seqfeatures jalview.ws jalview.ws.dbsources jalview.ws.dbsources.PDBRestClient jalview.ws.dbsources.das.api jalview.ws.jws1 jalview.ws.jws2 jalview.ws.jws2.dm jalview.ws.jws2.jabaws2 jalview.ws.params jalview.ws.params.ValueConstrainI jalview.ws.rest jalview.ws.seqfetcher jalview.ws.uimodel jalview.ws.uimodel.PDBRestResponse net.miginfocom.swing org.apache.log4j org.apache.log4j.spi org.biodas.jdas.schema.sources org.exolab.castor.xml org.jibble.epsgraphics org.jmol.api org.jmol.i18n org.jmol.popup org.jmol.util org.openscience.jmol.app.jmolpanel org.robsite.jswingreader.action org.robsite.jswingreader.model org.robsite.jswingreader.ui org.robsite.jswingreader.ui.util uk.ac.vamsas.client uk.ac.vamsas.client.picking uk.ac.vamsas.objects.core ./jalview/httpserver imports jalview.rest org.eclipse.jetty.server org.eclipse.jetty.server.handler org.eclipse.jetty.util.thread ./jalview/io imports com.stevesoft.pat fr.orsay.lri.varna.exceptions fr.orsay.lri.varna.factories fr.orsay.lri.varna.models.rna jalview.analysis jalview.analysis.SecStrConsensus jalview.api jalview.bin jalview.datamodel jalview.exceptions jalview.gui jalview.io.vamsas jalview.json.binding.v1 jalview.json.binding.v1.AlignmentPojo jalview.math jalview.schemes jalview.structure jalview.util jalview.viewmodel org.jfree.graphics2d.svg org.json.simple org.json.simple.parser org.jsoup org.jsoup.nodes uk.ac.ebi.www uk.ac.vamsas.client uk.ac.vamsas.objects.core uk.ac.vamsas.objects.utils ./jalview/io/packed imports jalview.datamodel jalview.io jalview.io.packed.DataProvider ./jalview/io/vamsas imports jalview.analysis jalview.bin jalview.datamodel jalview.gui jalview.io jalview.util jalview.viewmodel uk.ac.vamsas.client uk.ac.vamsas.objects.core uk.ac.vamsas.objects.utils ./jalview/javascript imports jalview.api jalview.appletgui jalview.bin jalview.datamodel jalview.ext.jmol jalview.structure netscape.javascript ./jalview/jbgui imports jalview.analysis.AnnotationSorter jalview.api jalview.api.structures jalview.bin jalview.datamodel jalview.gui jalview.gui.StructureViewer jalview.io jalview.jbgui.PDBDocFieldPreferences jalview.schemes jalview.util jalview.ws.dbsources.PDBRestClient net.miginfocom.swing ./jalview/json imports ./jalview/json/binding imports ./jalview/json/binding/v1 imports jalview.schemes org.json.simple org.json.simple.parser ./jalview/math imports jalview.util ./jalview/renderer imports com.stevesoft.pat jalview.analysis jalview.api jalview.datamodel jalview.schemes ./jalview/renderer/seqfeatures imports jalview.datamodel ./jalview/rest imports jalview.httpserver ./jalview/schemabinding imports ./jalview/schemabinding/version2 imports org.exolab.castor.xml ./jalview/schemabinding/version2/descriptors imports jalview.schemabinding.version2 ./jalview/schemes imports jalview.analysis jalview.analysis.scoremodels jalview.api jalview.api.analysis jalview.datamodel jalview.io jalview.schemes jalview.util ./jalview/structure imports MCview jalview.analysis jalview.api jalview.commands jalview.datamodel jalview.io jalview.util ./jalview/structures imports ./jalview/structures/models imports jalview.api jalview.datamodel jalview.structure jalview.util ./jalview/util imports com.stevesoft.pat jalview.analysis jalview.api jalview.commands jalview.commands.EditCommand jalview.datamodel jalview.datamodel.SearchResults jalview.gui jalview.io org.jfree.graphics2d.svg org.jibble.epsgraphics ./jalview/viewmodel imports jalview.analysis jalview.analysis.AnnotationSorter jalview.api jalview.commands jalview.datamodel jalview.schemes jalview.structure jalview.util jalview.viewmodel.styles jalview.workers ./jalview/viewmodel/annotationfilter imports ./jalview/viewmodel/seqfeatures imports jalview.api jalview.datamodel jalview.renderer.seqfeatures jalview.schemes jalview.viewmodel ./jalview/viewmodel/styles imports jalview.api ./jalview/workers imports jalview.analysis jalview.api jalview.datamodel jalview.schemes ./jalview/ws imports com.lowagie.text.html jalview.analysis jalview.bin jalview.datamodel jalview.gui jalview.util jalview.util.GroupUrlLink jalview.viewmodel.seqfeatures jalview.ws.dbsources.das.api jalview.ws.seqfetcher org.apache.http org.apache.http.client org.apache.http.client.entity org.apache.http.client.methods org.apache.http.entity.mime org.apache.http.entity.mime.content org.apache.http.impl.client org.apache.http.params org.biodas.jdas.client org.biodas.jdas.client.adapters.features org.biodas.jdas.client.adapters.features.DasGFFAdapter org.biodas.jdas.client.threads org.biodas.jdas.schema.features org.biodas.jdas.schema.sources org.xml.sax org.xml.sax.helpers uk.ac.ebi.picr.model ./jalview/ws/dbsources imports com.stevesoft.pat com.sun.jersey.api.client com.sun.jersey.api.client.config jalview.datamodel jalview.datamodel.xdb.embl jalview.io jalview.util jalview.ws.ebi jalview.ws.seqfetcher jalview.ws.uimodel jalview.ws.uimodel.PDBRestResponse org.exolab.castor.xml org.json.simple org.json.simple.parser ./jalview/ws/dbsources/das imports ./jalview/ws/dbsources/das/api imports jalview.ws.seqfetcher org.biodas.jdas.client.threads org.biodas.jdas.schema.sources ./jalview/ws/dbsources/das/datamodel imports com.stevesoft.pat jalview.bin jalview.datamodel jalview.util jalview.ws.dbsources.das.api jalview.ws.seqfetcher org.biodas.jdas.client org.biodas.jdas.client.adapters.sequence org.biodas.jdas.client.threads org.biodas.jdas.dassources org.biodas.jdas.dassources.utils org.biodas.jdas.schema.sequence org.biodas.jdas.schema.sources ./jalview/ws/ebi imports jalview.util ./jalview/ws/io imports ./jalview/ws/io/mime imports jalview.io.packed jalview.io.packed.DataProvider org.apache.james.mime4j org.apache.james.mime4j.descriptor org.apache.james.mime4j.parser ./jalview/ws/jws1 imports ext.vamsas jalview.analysis jalview.bin jalview.datamodel jalview.gui jalview.io jalview.util jalview.ws vamsas.objects.simple ./jalview/ws/jws2 imports compbio.data.msa compbio.data.sequence compbio.data.sequence.RNAStructReader compbio.data.sequence.ScoreManager compbio.metadata compbio.ws.client jalview.analysis jalview.api jalview.bin jalview.datamodel jalview.gui jalview.schemes jalview.util jalview.workers jalview.ws jalview.ws.jws2.dm jalview.ws.jws2.jabaws2 jalview.ws.params jalview.ws.uimodel org.jmol.util ./jalview/ws/jws2/dm imports compbio.metadata jalview.util jalview.ws.jws2 jalview.ws.jws2.jabaws2 jalview.ws.params ./jalview/ws/jws2/jabaws2 imports compbio.data.msa compbio.metadata jalview.gui jalview.util jalview.ws.jws2 jalview.ws.params jalview.ws.uimodel ./jalview/ws/params imports ./jalview/ws/params/simple imports jalview.ws.params ./jalview/ws/rest imports jalview.bin jalview.datamodel jalview.gui jalview.io jalview.io.packed jalview.io.packed.DataProvider jalview.io.packed.JalviewDataset jalview.util jalview.ws jalview.ws.io.mime jalview.ws.params jalview.ws.params.simple jalview.ws.rest.params org.apache.axis.transport.http org.apache.http org.apache.http.client org.apache.http.client.methods org.apache.http.entity.mime org.apache.http.entity.mime.content org.apache.http.impl.client org.apache.http.protocol org.apache.http.util org.apache.james.mime4j org.apache.james.mime4j.parser ./jalview/ws/rest/params imports jalview.datamodel jalview.util jalview.ws.params jalview.ws.params.simple jalview.ws.rest org.apache.http.entity.mime.content ./jalview/ws/seqfetcher imports com.stevesoft.pat jalview.datamodel jalview.io jalview.util ./jalview/ws/uimodel imports jalview.ws.dbsources.PDBRestClient org.json.simple ./MCview imports jalview.analysis jalview.appletgui jalview.datamodel jalview.gui jalview.io jalview.schemes jalview.structure jalview.util jalview.ws.ebi ./org imports ./org/jibble imports ./org/jibble/epsgraphics imports jalview.util ./uk imports ./uk/ac imports ./uk/ac/ebi imports ./uk/ac/ebi/picr imports ./uk/ac/ebi/picr/model imports ./uk/ac/ebi/www imports jalview.util ./uk/ac/ebi/www/picr imports ./uk/ac/ebi/www/picr/AccessionMappingService imports jalview.util ./vamsas imports vamsas.objects.simple ./vamsas/objects imports ./vamsas/objects/simple imports
_______________________________________________ Jalview-dev mailing list [email protected] http://www.compbio.dundee.ac.uk/mailman/listinfo/jalview-dev
