Search the web
Sign In
New User? Sign Up
lisa-its · XML Internationalization Tag Set
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Re: Digest Number 66   Message List  
Reply | Forward Message #150 of 191 |
Re: Localization Directives - Working Example

Although I'm a Windows developer, I can see some advantages in
developing filters in Java. First, they would offer a better cross-
platform support, but I think one of the main interests also reside
in the good i18n functionality Java provides. MLANG and standard
Windows API do offer a lot, and you can also use ICU if needed, but
it may be less organized and consistent than the Java support
(although Unicode support in Java needs to be updated).

This said, I think the callers of filters are often developed for a
single platform (often Windows), and when it comes to GUI
applications Java -from my modest experience- seems to be 'a little
behind'.

Overall we should have a way to access Java filters from Windows
applications and it could be done as follow:

- Java filters implement a filter interface Java class.
- A JNI layer, wrapped in a C++ class, allows you to access the Java
interface from C++. A single class is enough to access any filter.
- A thin COM layer wraps the C++ class and allows any COM-enable
application to also access the filters.

or, in image:

+-----------------------+
| Java filter(s) | =====> Java apps
| +-------------------+ |
| | Filter interface | |<-+
| +-------------------+ | |
+-----------------------+ |
|
+-----------------------+ |
| +-------------------+ | |
| | JNI Layer | |<-+
| +-------------------+ | =====> C++ apps
| C++ wrapper |<-+ (not using COM)
+-----------------------+ |
|
+-----------------------+ |
| COM interface |<-+
+-----------------------+ =====> COM apps


There is a price to this interoperability: The JNI layer has some
overhead in passing parameters (especially strings), but hopefully
this won't be to noticeable especially for high-level calls where the
calls are not numerous anyways.

There are also a number of issues (for example: how to use callback
in such architecture) that also need to be addressed, but they should
be resolved anyway to make C++ implementations be flexible.

I've done some experimentations this week-end: JNI lacks of good
documentation and is definitively 'unsavory' to program with, but it
seems to do the job. I've looked at other alternatives: cxxwrap, CNI,
SWIG, etc. but most of them are to call C++ from Java, not the
reverse.

Okapi would provide:
- the Java interface class
- the JNI/C++ class wrapper
- the COM object that wraps the JNI/C++ class

All this obviously doesn't prevent to write filters in C++ if it is
your preference: the important part is to have a common interface so
layers for interoperability can be also constructed and re-used.

Cheers,
-yves






Mon Jan 21, 2002 8:29 pm

yves_savourel
Offline Offline
Send Email Send Email

Forward
Message #150 of 191 |
Expand Messages Author Sort by Date

Hello Tim, ... The COM implementation of the Okapi API interface wouldn't be transportable but the underlying Filters are pure C++ which isn't tied to Win32 in...
John Wm. Wicks
john_wicks
Offline Send Email
Jan 20, 2002
5:20 am

Hi All, ... I would agree with this. We develop some cross-platform software and we use C/C++ to write the main code. Once this is done, we can then wrap this...
David Pooley
david_pooley...
Offline Send Email
Jan 21, 2002
9:31 am

Hi All, ... Swing is still the slowest part of java I believe, so comparing a heavyweight gui app to a file parsing library isn't fair. Along with that, j2se...
Tim Foster
timatsun
Offline Send Email
Jan 21, 2002
11:29 am

Although I'm a Windows developer, I can see some advantages in developing filters in Java. First, they would offer a better cross- platform support, but I...
yves_savourel
Offline Send Email
Jan 21, 2002
8:31 pm

Hi All, I'll keep it short - I promise. I'm not going to get into a comp.lang.misc my impl. language is bigger/ better/ faster/ smaller/ slower/ more...
Tim Foster
timatsun
Offline Send Email
Jan 22, 2002
10:18 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help