Sharpen
Sharpen is...
Sharpen is an Eclipse plugin for multi-platform development from one codebase.
Functionality
Sharpen currently compiles Java to C#, with some special syntax that allows to
- ignore classes
- ignore documentation
- merge classes with others
- translate specific methods to .net properties
- translate specific methods to .net events
Deploying to multiple Java JDKs
Sharpen could be extended to allow developing on the Java platform with the most advanced API (JDK5 with generics) and to "backport" applications to other JDKs with less functionality like
- JDK 1.4 (Generics not available)
- JDK 1.2 (File locking not available)
- JDK 1.1 (Collections not available)
- J2ME CLDC (Reflection not available)
For a list of the JDK functionality that db4o currently uses see JDK Dependancies.
A blunt approach for an implementation would be to
- remove all methods that do not compile
- remove all base classes from "extends" statements, if the base class does not exist
- remove all interfaces from "implements" statements, if the interface does not exist
- change the type of declared objects to "Object" if the declared type does not exist
It could also be a viable approach to modify methods that do not compile to do their calls by reflection. This way there would be no hard links to functionality that does not exist.
It is desirable that Sharpen creates a Java source code version of the backport, to allow debugging on the respective platforms.
Benefits
- We no longer have to maintain the same Java code in multiple projects for multiple Java dialects.
- We can use the most recent Java version (with generics, future: with closures) to develop db4o.
- db4o can be packaged into multiple libraries, without having to maintain a huge matrix of source projects
- Additional switches for additional versions can be part of the tool (long pointers for huge databases)
- The tool could either be a costly dDN plus service, or it could attract the open source community (or both) (in the latter case, it could help to attract talents for our team).
- J2ME CLDC can become "just a build switch", instead of extra work to support
- Sharpen could build in real-time, to inform developers whenever they write code that is incompatible with any specific version.
- Contributing to db4o becomes easier.
- Old legacy code can stay in the main db4oj project, without a negative impact on library size.
- All of the above leads to more productivity and higher quality.