You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Dave Engberg (JIRA)" <ji...@apache.org> on 2010/08/31 02:57:54 UTC

[jira] Created: (THRIFT-880) JavaME code generator and runtime library

JavaME code generator and runtime library
-----------------------------------------

                 Key: THRIFT-880
                 URL: https://issues.apache.org/jira/browse/THRIFT-880
             Project: Thrift
          Issue Type: New Feature
          Components: Compiler (General)
    Affects Versions: 0.4
            Reporter: Dave Engberg
             Fix For: 0.5


There are a number of mobile devices that use use some variant of the "Java Micro Edition" (Java ME) platform for their development environments.
The JavaME platform is barely a second cousin of modern Java SE/EE, and most modern Java libraries like Thrift aren't even conceivable on those devices due to lack of things like generics, modern collection classes, etc.
This basically means that some simple "vanilla" Java code can be used in both places, but it's better to consider JavaME as just a separate platform with a historic overlap rather than a "subset."

We've been using a JavaME profile of Thrift (CLDC 1.1) for a while on some of our own platforms, and are now making it available to some partners.  I've cleaned up our code generator and JavaME libraries in this patch for (hopeful) inclusion into a Thrift release in the future.

This includes:
t_javame_generator.cc based on the 0.4.0 Java generator with heavy modifications for the generated code to comply with the ME profile.  
lib/javame - a runtime library for ME devices that is based on a fairly old version of the Java libraries (pre-incubation)

This patch does not modify the main Java generator at all ... this is a parallel project and runtime library.
These changes are too large to reasonably fold into the "Java" generator as an option (i.e. that would be a bit like trying to merge the C# and Java generators into one.)  I realize that results in a bit of a fork.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (THRIFT-880) JavaME code generator and runtime library

Posted by "Dave Engberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-880?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dave Engberg updated THRIFT-880:
--------------------------------

    Attachment: javame-v1.patch

> JavaME code generator and runtime library
> -----------------------------------------
>
>                 Key: THRIFT-880
>                 URL: https://issues.apache.org/jira/browse/THRIFT-880
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Compiler (General)
>    Affects Versions: 0.4
>            Reporter: Dave Engberg
>             Fix For: 0.5
>
>         Attachments: javame-v1.patch
>
>
> There are a number of mobile devices that use use some variant of the "Java Micro Edition" (Java ME) platform for their development environments.
> The JavaME platform is barely a second cousin of modern Java SE/EE, and most modern Java libraries like Thrift aren't even conceivable on those devices due to lack of things like generics, modern collection classes, etc.
> This basically means that some simple "vanilla" Java code can be used in both places, but it's better to consider JavaME as just a separate platform with a historic overlap rather than a "subset."
> We've been using a JavaME profile of Thrift (CLDC 1.1) for a while on some of our own platforms, and are now making it available to some partners.  I've cleaned up our code generator and JavaME libraries in this patch for (hopeful) inclusion into a Thrift release in the future.
> This includes:
> t_javame_generator.cc based on the 0.4.0 Java generator with heavy modifications for the generated code to comply with the ME profile.  
> lib/javame - a runtime library for ME devices that is based on a fairly old version of the Java libraries (pre-incubation)
> This patch does not modify the main Java generator at all ... this is a parallel project and runtime library.
> These changes are too large to reasonably fold into the "Java" generator as an option (i.e. that would be a bit like trying to merge the C# and Java generators into one.)  I realize that results in a bit of a fork.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-880) JavaME code generator and runtime library

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-880?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12906138#action_12906138 ] 

Bryan Duxbury commented on THRIFT-880:
--------------------------------------

OK, I understand where you're coming from. I wish there was at least some way for us to verify that the code all builds, but I'll accept it if there isn't.

If you make the other changes, I'll commit your next version.

> JavaME code generator and runtime library
> -----------------------------------------
>
>                 Key: THRIFT-880
>                 URL: https://issues.apache.org/jira/browse/THRIFT-880
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Compiler (General)
>    Affects Versions: 0.4
>            Reporter: Dave Engberg
>             Fix For: 0.5
>
>         Attachments: javame-v1.patch
>
>
> There are a number of mobile devices that use use some variant of the "Java Micro Edition" (Java ME) platform for their development environments.
> The JavaME platform is barely a second cousin of modern Java SE/EE, and most modern Java libraries like Thrift aren't even conceivable on those devices due to lack of things like generics, modern collection classes, etc.
> This basically means that some simple "vanilla" Java code can be used in both places, but it's better to consider JavaME as just a separate platform with a historic overlap rather than a "subset."
> We've been using a JavaME profile of Thrift (CLDC 1.1) for a while on some of our own platforms, and are now making it available to some partners.  I've cleaned up our code generator and JavaME libraries in this patch for (hopeful) inclusion into a Thrift release in the future.
> This includes:
> t_javame_generator.cc based on the 0.4.0 Java generator with heavy modifications for the generated code to comply with the ME profile.  
> lib/javame - a runtime library for ME devices that is based on a fairly old version of the Java libraries (pre-incubation)
> This patch does not modify the main Java generator at all ... this is a parallel project and runtime library.
> These changes are too large to reasonably fold into the "Java" generator as an option (i.e. that would be a bit like trying to merge the C# and Java generators into one.)  I realize that results in a bit of a fork.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (THRIFT-880) JavaME code generator and runtime library

Posted by "Dave Engberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-880?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dave Engberg updated THRIFT-880:
--------------------------------

    Attachment: javame-v2.patch

Sorry, here's a replacement patch with the old Facebook-era @author annotations removed from the JavaME runtime libs.

> JavaME code generator and runtime library
> -----------------------------------------
>
>                 Key: THRIFT-880
>                 URL: https://issues.apache.org/jira/browse/THRIFT-880
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Compiler (General)
>    Affects Versions: 0.4
>            Reporter: Dave Engberg
>             Fix For: 0.5
>
>         Attachments: javame-v1.patch, javame-v2.patch
>
>
> There are a number of mobile devices that use use some variant of the "Java Micro Edition" (Java ME) platform for their development environments.
> The JavaME platform is barely a second cousin of modern Java SE/EE, and most modern Java libraries like Thrift aren't even conceivable on those devices due to lack of things like generics, modern collection classes, etc.
> This basically means that some simple "vanilla" Java code can be used in both places, but it's better to consider JavaME as just a separate platform with a historic overlap rather than a "subset."
> We've been using a JavaME profile of Thrift (CLDC 1.1) for a while on some of our own platforms, and are now making it available to some partners.  I've cleaned up our code generator and JavaME libraries in this patch for (hopeful) inclusion into a Thrift release in the future.
> This includes:
> t_javame_generator.cc based on the 0.4.0 Java generator with heavy modifications for the generated code to comply with the ME profile.  
> lib/javame - a runtime library for ME devices that is based on a fairly old version of the Java libraries (pre-incubation)
> This patch does not modify the main Java generator at all ... this is a parallel project and runtime library.
> These changes are too large to reasonably fold into the "Java" generator as an option (i.e. that would be a bit like trying to merge the C# and Java generators into one.)  I realize that results in a bit of a fork.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-880) JavaME code generator and runtime library

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-880?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12906080#action_12906080 ] 

Bryan Duxbury commented on THRIFT-880:
--------------------------------------

I think we want to wipe all of the @author tags out.

There's no build.xml or tests in lib/javame. We can punt on tests for now (grudgingly...) but I think that we should at least provide a way to build the library into a jar. (I am assuming that JavaME still uses jars.)

Some of the classes in the library, for instance TFramedTransport, seem to be completely unchanged from the regular Java library. It feels wrong somehow to have two copies of the same file in our source tree. Could we possibly find a way to extract a common library of core classes that we can reuse? Might be more trouble than it's worth, but I'd hate to have to keep track of the same bugfixes in two locations.

> JavaME code generator and runtime library
> -----------------------------------------
>
>                 Key: THRIFT-880
>                 URL: https://issues.apache.org/jira/browse/THRIFT-880
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Compiler (General)
>    Affects Versions: 0.4
>            Reporter: Dave Engberg
>             Fix For: 0.5
>
>         Attachments: javame-v1.patch
>
>
> There are a number of mobile devices that use use some variant of the "Java Micro Edition" (Java ME) platform for their development environments.
> The JavaME platform is barely a second cousin of modern Java SE/EE, and most modern Java libraries like Thrift aren't even conceivable on those devices due to lack of things like generics, modern collection classes, etc.
> This basically means that some simple "vanilla" Java code can be used in both places, but it's better to consider JavaME as just a separate platform with a historic overlap rather than a "subset."
> We've been using a JavaME profile of Thrift (CLDC 1.1) for a while on some of our own platforms, and are now making it available to some partners.  I've cleaned up our code generator and JavaME libraries in this patch for (hopeful) inclusion into a Thrift release in the future.
> This includes:
> t_javame_generator.cc based on the 0.4.0 Java generator with heavy modifications for the generated code to comply with the ME profile.  
> lib/javame - a runtime library for ME devices that is based on a fairly old version of the Java libraries (pre-incubation)
> This patch does not modify the main Java generator at all ... this is a parallel project and runtime library.
> These changes are too large to reasonably fold into the "Java" generator as an option (i.e. that would be a bit like trying to merge the C# and Java generators into one.)  I realize that results in a bit of a fork.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-880) JavaME code generator and runtime library

Posted by "Dave Engberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-880?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12906125#action_12906125 ] 

Dave Engberg commented on THRIFT-880:
-------------------------------------

I'll yank the @author tags ... they're left over from the original pre-incubation files we adapted.

I don't think that JavaME libraries are designed to be built or tested with any common command-line tools.  The standard JavaSE tools wouldn't enforce the right constraints, and wouldn't have access to the right platform classes for JavaME/CLDC environments.  In particular, the JavaME tools I've used in the past seem to work off of *.java sources rather than libraries of *.jar files.

As an example of a problem we'd require trying to build and test JavaME using the standard JDK, if you look at  lib/javame/src/org/apache/thrift/transport/THttpClient.java, you'll see that the I/O uses:
import javax.microedition.io.Connector;
import javax.microedition.io.HttpConnection;

That uses completely different methods than desktop/server Java networking:
            HttpConnection connection = (HttpConnection)Connector.open(url_);

So I think that anyone who consumes this library would be doing so in source form, and there wouldn't be any good way to build a CLI unit test for this stuff without pulling in some uncommon compiler+emulator tools:
http://www.j2meforums.com/wiki/index.php/Development_Tools

I did some test code based on our IDL and our HTTP service interface, but that all went into a really fat Java ME IDE with emulated phone UIs, etc.


If any individual JavaME library files are identical to the "full" Java files, it would be kind of nice to unify them via a symlink, but the mechanics of this would be a little ugly, and I'd worry about innocent changes to the normal Java packages just breaking JavaME.  E.g. if you make use of any generics or modern collections (except Hashtable & Vector) anywhere in the Java library, it won't compile at all under Java ME.
I think it's safer to think of JavaME as a forked cousin of JavaSE/EE rather than a subset.


> JavaME code generator and runtime library
> -----------------------------------------
>
>                 Key: THRIFT-880
>                 URL: https://issues.apache.org/jira/browse/THRIFT-880
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Compiler (General)
>    Affects Versions: 0.4
>            Reporter: Dave Engberg
>             Fix For: 0.5
>
>         Attachments: javame-v1.patch
>
>
> There are a number of mobile devices that use use some variant of the "Java Micro Edition" (Java ME) platform for their development environments.
> The JavaME platform is barely a second cousin of modern Java SE/EE, and most modern Java libraries like Thrift aren't even conceivable on those devices due to lack of things like generics, modern collection classes, etc.
> This basically means that some simple "vanilla" Java code can be used in both places, but it's better to consider JavaME as just a separate platform with a historic overlap rather than a "subset."
> We've been using a JavaME profile of Thrift (CLDC 1.1) for a while on some of our own platforms, and are now making it available to some partners.  I've cleaned up our code generator and JavaME libraries in this patch for (hopeful) inclusion into a Thrift release in the future.
> This includes:
> t_javame_generator.cc based on the 0.4.0 Java generator with heavy modifications for the generated code to comply with the ME profile.  
> lib/javame - a runtime library for ME devices that is based on a fairly old version of the Java libraries (pre-incubation)
> This patch does not modify the main Java generator at all ... this is a parallel project and runtime library.
> These changes are too large to reasonably fold into the "Java" generator as an option (i.e. that would be a bit like trying to merge the C# and Java generators into one.)  I realize that results in a bit of a fork.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-880) JavaME code generator and runtime library

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-880?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12910767#action_12910767 ] 

Bryan Duxbury commented on THRIFT-880:
--------------------------------------

Dave - any chance you could make the changes we discussed soon? I'd like to get this committed so that it can make it into 0.5.

> JavaME code generator and runtime library
> -----------------------------------------
>
>                 Key: THRIFT-880
>                 URL: https://issues.apache.org/jira/browse/THRIFT-880
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Compiler (General)
>    Affects Versions: 0.4
>            Reporter: Dave Engberg
>             Fix For: 0.5
>
>         Attachments: javame-v1.patch
>
>
> There are a number of mobile devices that use use some variant of the "Java Micro Edition" (Java ME) platform for their development environments.
> The JavaME platform is barely a second cousin of modern Java SE/EE, and most modern Java libraries like Thrift aren't even conceivable on those devices due to lack of things like generics, modern collection classes, etc.
> This basically means that some simple "vanilla" Java code can be used in both places, but it's better to consider JavaME as just a separate platform with a historic overlap rather than a "subset."
> We've been using a JavaME profile of Thrift (CLDC 1.1) for a while on some of our own platforms, and are now making it available to some partners.  I've cleaned up our code generator and JavaME libraries in this patch for (hopeful) inclusion into a Thrift release in the future.
> This includes:
> t_javame_generator.cc based on the 0.4.0 Java generator with heavy modifications for the generated code to comply with the ME profile.  
> lib/javame - a runtime library for ME devices that is based on a fairly old version of the Java libraries (pre-incubation)
> This patch does not modify the main Java generator at all ... this is a parallel project and runtime library.
> These changes are too large to reasonably fold into the "Java" generator as an option (i.e. that would be a bit like trying to merge the C# and Java generators into one.)  I realize that results in a bit of a fork.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-880) JavaME code generator and runtime library

Posted by "Fred Potter (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-880?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12906118#action_12906118 ] 

Fred Potter commented on THRIFT-880:
------------------------------------

It's unfortunate that there's a lot of code duplication, but it might be best that way.  Development on the main Java library will never have to be constrained by what's possible on JavaME.

> JavaME code generator and runtime library
> -----------------------------------------
>
>                 Key: THRIFT-880
>                 URL: https://issues.apache.org/jira/browse/THRIFT-880
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Compiler (General)
>    Affects Versions: 0.4
>            Reporter: Dave Engberg
>             Fix For: 0.5
>
>         Attachments: javame-v1.patch
>
>
> There are a number of mobile devices that use use some variant of the "Java Micro Edition" (Java ME) platform for their development environments.
> The JavaME platform is barely a second cousin of modern Java SE/EE, and most modern Java libraries like Thrift aren't even conceivable on those devices due to lack of things like generics, modern collection classes, etc.
> This basically means that some simple "vanilla" Java code can be used in both places, but it's better to consider JavaME as just a separate platform with a historic overlap rather than a "subset."
> We've been using a JavaME profile of Thrift (CLDC 1.1) for a while on some of our own platforms, and are now making it available to some partners.  I've cleaned up our code generator and JavaME libraries in this patch for (hopeful) inclusion into a Thrift release in the future.
> This includes:
> t_javame_generator.cc based on the 0.4.0 Java generator with heavy modifications for the generated code to comply with the ME profile.  
> lib/javame - a runtime library for ME devices that is based on a fairly old version of the Java libraries (pre-incubation)
> This patch does not modify the main Java generator at all ... this is a parallel project and runtime library.
> These changes are too large to reasonably fold into the "Java" generator as an option (i.e. that would be a bit like trying to merge the C# and Java generators into one.)  I realize that results in a bit of a fork.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (THRIFT-880) JavaME code generator and runtime library

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-880?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Duxbury updated THRIFT-880:
---------------------------------

       Assignee: Dave Engberg
    Component/s: JavaME - Compiler
                 JavaME - Library

> JavaME code generator and runtime library
> -----------------------------------------
>
>                 Key: THRIFT-880
>                 URL: https://issues.apache.org/jira/browse/THRIFT-880
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Compiler (General), JavaME - Compiler, JavaME - Library
>    Affects Versions: 0.4
>            Reporter: Dave Engberg
>            Assignee: Dave Engberg
>             Fix For: 0.5
>
>         Attachments: javame-v1.patch, javame-v2.patch
>
>
> There are a number of mobile devices that use use some variant of the "Java Micro Edition" (Java ME) platform for their development environments.
> The JavaME platform is barely a second cousin of modern Java SE/EE, and most modern Java libraries like Thrift aren't even conceivable on those devices due to lack of things like generics, modern collection classes, etc.
> This basically means that some simple "vanilla" Java code can be used in both places, but it's better to consider JavaME as just a separate platform with a historic overlap rather than a "subset."
> We've been using a JavaME profile of Thrift (CLDC 1.1) for a while on some of our own platforms, and are now making it available to some partners.  I've cleaned up our code generator and JavaME libraries in this patch for (hopeful) inclusion into a Thrift release in the future.
> This includes:
> t_javame_generator.cc based on the 0.4.0 Java generator with heavy modifications for the generated code to comply with the ME profile.  
> lib/javame - a runtime library for ME devices that is based on a fairly old version of the Java libraries (pre-incubation)
> This patch does not modify the main Java generator at all ... this is a parallel project and runtime library.
> These changes are too large to reasonably fold into the "Java" generator as an option (i.e. that would be a bit like trying to merge the C# and Java generators into one.)  I realize that results in a bit of a fork.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (THRIFT-880) JavaME code generator and runtime library

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-880?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Duxbury closed THRIFT-880.
--------------------------------

    Resolution: Fixed

I just committed this.

> JavaME code generator and runtime library
> -----------------------------------------
>
>                 Key: THRIFT-880
>                 URL: https://issues.apache.org/jira/browse/THRIFT-880
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Compiler (General), JavaME - Compiler, JavaME - Library
>    Affects Versions: 0.4
>            Reporter: Dave Engberg
>            Assignee: Dave Engberg
>             Fix For: 0.5
>
>         Attachments: javame-v1.patch, javame-v2.patch
>
>
> There are a number of mobile devices that use use some variant of the "Java Micro Edition" (Java ME) platform for their development environments.
> The JavaME platform is barely a second cousin of modern Java SE/EE, and most modern Java libraries like Thrift aren't even conceivable on those devices due to lack of things like generics, modern collection classes, etc.
> This basically means that some simple "vanilla" Java code can be used in both places, but it's better to consider JavaME as just a separate platform with a historic overlap rather than a "subset."
> We've been using a JavaME profile of Thrift (CLDC 1.1) for a while on some of our own platforms, and are now making it available to some partners.  I've cleaned up our code generator and JavaME libraries in this patch for (hopeful) inclusion into a Thrift release in the future.
> This includes:
> t_javame_generator.cc based on the 0.4.0 Java generator with heavy modifications for the generated code to comply with the ME profile.  
> lib/javame - a runtime library for ME devices that is based on a fairly old version of the Java libraries (pre-incubation)
> This patch does not modify the main Java generator at all ... this is a parallel project and runtime library.
> These changes are too large to reasonably fold into the "Java" generator as an option (i.e. that would be a bit like trying to merge the C# and Java generators into one.)  I realize that results in a bit of a fork.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.