You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _wikis/BioJava3_Design.mediawiki
+45-2Lines changed: 45 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,11 +12,15 @@ This document was based on comments made on the following pages:
12
12
* Modular design without any cyclic dependencies, with separate JARs for key components (IO, databases, genetic algorithms, sequence manipulation, etc.)
13
13
* Separation of APIs from implementation code by means of packages.
14
14
* Base package name: org.biojava3 (to prevent clashes with org.biojava and org.biojavax, both of which will have backwards-compatibility extensions to BJ3 in order to make old code reusable).
15
-
* Use of JavaBeans concepts wherever possible, e.g. getters/setters. This would enhance Java EE compliance and improve integration into larger things.
15
+
* Use of JavaBeans concepts wherever possible, e.g. getters/setters. This would enhance Java EE compliance and improve integration into larger things. DON'T do this where immutability is key to efficiency though, like with Strings.
16
16
* Fully commented code in LOTS of detail INCLUDING package-level docs AND wiki-docs such as the cookbook.
17
17
* Use of annotations for things like database mappings.
18
18
* A consistent coding style to be developed and applied.
19
19
* No Swing code to be included, but graphics code is OK for obviously useful things such as protein structures or sequence traces. Swing code is impossible to write in a way that will integrate fully with each different individual's own program requirements.
20
+
* Keep It Simple Stupid (KISS) - don't object-ify things unless absolutely necessary. Sequences are perfectly happy as Strings unless you want to do complex things like store base quality information, and only at that point should you want to convert them into more complex object models.
21
+
* Separation of functionality - don't make sequences load features, and don't make features load their sequence by default. This saves memory and allows work to be done independently on the specific parts of interest.
** API module contains object builder signature (builder builds objects from events, much like a SAX parser does).
57
+
** Listeners can choose to cache data in memory, on disk, keep a pointer to the source and read it back later, or whatever. Up to them. Optimisation becomes easier this way as listeners can choose exactly what to keep in memory and what not to.
58
+
59
+
* Sequence module
60
+
** API module defines entire BioJava sequence object model (similar to current one but allowing for non-symbol based sequences and separation of sequences from features).
61
+
** API has subclasses of object builders for sequences. Builder can specify it is only interested in certain events, and parsers can query this to optimise parsing by skipping irrelevant sections.
62
+
** Conversion to symbol-based sequences on demand to/from strings.
63
+
** Simplified alphabet concept, made easier by avoiding use of XMLs to configure them.
64
+
** WATCH OUT for localised strings when manipulating sequences.
65
+
** WATCH OUT for singletons and multi-processor environments. Consider using JNDI if they are absolutely necessary.
66
+
67
+
* Feature module
68
+
** API module defines entire BioJava feature object model (similar to current one but allowing for separation of sequences from features).
69
+
** API has subclasses of object builders for features. Builder can specify it is only interested in certain events, and parsers can query this to optimise parsing by skipping irrelevant sections.
70
+
** Allow feature naming using any of the standard ontologies.
71
+
72
+
* IO module
73
+
** API module contains basic read() and write() function signatures.
74
+
** API has concept of RecordSource which is either a file, a group of files (e.g. directory), a database, a web service, etc. - all of which implement some kind of RecordProvider interface for iterating over objects. Those objects can be sequences, features, etc.
75
+
** Implementation module - one per sequence format - e.g. Genbank, FASTA, etc.
76
+
** Use of event listeners to fire events at an object builder.
77
+
** Each implementation has default object model and builder that exactly matches that format, along with a converter that will 'read' the object model and fire events as if it was being read again (to allow for conversion to other formats via the listener framework).
78
+
** BioSQL is an IO module. So are other dbs, e.g. Entrez, ebEye.
79
+
** A RecordSearch API to be implemented to search for matching records in any RecordSource.
80
+
** LazyLoading where possible.
81
+
** Input AND Output achieved by SAX-like event firing. Reading a file fires events at an object builder containing bits of data as they are read. Writing a file causes an object parser to parse an object and fire events at a file writer. Any listener can listen to any other source of events, so you can short-circuit file conversion by reading GenBank and specifying the reader-listener as an instance of a FASTA writer-listener.
82
+
** RecordSources to be versioned to cope with changing formats over time.
83
+
** Each IO module to be entirely independent and agnostic of the way it is used. This allows modules to optimise themselves for random access etc., if they see fit. By using the methods on the API to check what the listener is interested in receiving, they can also cut out the work of parsing uninteresting stuff.
0 commit comments