From: Arne Vajhøj on
On 28-07-2010 09:05, Fencer wrote:
> Hello, I'm writing a front-end to a library (that's in a jar file). The
> library actually comes in two forms, an open-source one and a commercial
> one with extra functionality. Does that mean I have to have two
> frontends, one for each version?
>
> I have access to both versions myself but some of my supposed users only
> have the open source edition. I would like to have one eclipse project
> that can act as a frontend to either version. How do I handle this? Is
> my question even clear? :-)

If the two versions have different API's even for the common stuff,
then you will need two front ends.

If the commercial version is a pure super set of the open source
version, then you can build against the commercial version and ship
that front end to open source users as well.

You will just need to catch various exceptions for missing classes
and methods.

Arne
From: Tom Anderson on
On Wed, 28 Jul 2010, Arne Vajh?j wrote:

> On 28-07-2010 09:05, Fencer wrote:
>
>> Hello, I'm writing a front-end to a library (that's in a jar file). The
>> library actually comes in two forms, an open-source one and a
>> commercial one with extra functionality. Does that mean I have to have
>> two frontends, one for each version?
>>
>> I have access to both versions myself but some of my supposed users
>> only have the open source edition. I would like to have one eclipse
>> project that can act as a frontend to either version. How do I handle
>> this? Is my question even clear? :-)
>
> If the two versions have different API's even for the common stuff,
> then you will need two front ends.

Or you could write two middle ends, with a common API, and write the
front end on top of the middle end.

> You will just need to catch various exceptions for missing classes and
> methods.

And perhaps prevent the user from using the features which require those
classes and methods in the first place.

tom

--
vote love
From: Roedy Green on
On Wed, 28 Jul 2010 15:05:14 +0200, Fencer
<no.i.dont(a)want.mail.from.spammers.com> wrote, quoted or indirectly
quoted someone who said :

>Hello, I'm writing a front-end to a library (that's in a jar file). The
>library actually comes in two forms, an open-source one and a commercial
>one with extra functionality. Does that mean I have to have two
>frontends, one for each version?

Typically what you do is define a general interface, the write two
implementations of it. That allows for adding still more formats
later.
--
Roedy Green Canadian Mind Products
http://mindprod.com

You encapsulate not just to save typing, but more importantly, to make it easy and safe to change the code later, since you then need change the logic in only one place. Without it, you might fail to change the logic in all the places it occurs.
From: jebblue on
On Wed, 28 Jul 2010 15:05:14 +0200, Fencer wrote:

> Hello, I'm writing a front-end to a library (that's in a jar file). The
> library actually comes in two forms, an open-source one and a commercial
> one with extra functionality. Does that mean I have to have two
> frontends, one for each version?
>
> I have access to both versions myself but some of my supposed users only
> have the open source edition. I would like to have one eclipse project
> that can act as a frontend to either version. How do I handle this? Is
> my question even clear? :-)
>
> - Fencer

There is an Eclipse newsgroup site, here's the general URL, it's
another resource since you mentioned Eclipse:

http://www.eclipse.org/forums/

--
// This is my opinion.