Implementing an existing interface

G

golem

Hi!

Assume that I want to create my own implementation of an existing
interface, eg. java.lang.ArrayList. Will it be OK if I use the
interface
designed by Sun, ie. won't it be in violation with copyright law?

Thanks in advance
 
O

Oliver Wong

golem said:
Hi!

Assume that I want to create my own implementation of an existing
interface, eg. java.lang.ArrayList. Will it be OK if I use the
interface
designed by Sun, ie. won't it be in violation with copyright law?

I am not a lawyer, but I've seen lots of people implement interfaces
written by Sun. That's sort of the whole point behind having an interface.
Sun, for example, publishes some interfaces for parsing XML files, and it's
only 3rd parties, such as Apache, who actually writes the implementation for
those interfaces (e.g. the Xerces parser).

So unless you have some special reason to worry, I wouldn't worry too
much about it.

- Oliver
 
G

golem

Nice to hear that.. then I understand it would be all legal if I made a
port of the whole Sun's API to another platform or even implemented it
in another language? Nice...

Thx
 
D

Dave Glasser

Nice to hear that.. then I understand it would be all legal if I made a
port of the whole Sun's API to another platform or even implemented it
in another language? Nice...

First you should learn what "interface" means in the Java language.
Then you might understand the answer you were given.




--
Check out QueryForm, a free, open source, Java/Swing-based
front end for relational databases.

http://qform.sourceforge.net

If you're a musician, check out RPitch Relative Pitch
Ear Training Software.

http://rpitch.sourceforge.net
 
T

Thomas Kellerer

golem wrote on 13.02.2006 19:41:
Hi!

Assume that I want to create my own implementation of an existing
interface, eg. java.lang.ArrayList. Will it be OK if I use the
interface
designed by Sun, ie. won't it be in violation with copyright law?

ArrayList is *not* an interface.

Thomas
 
T

tom fredriksen

golem said:
Nice to hear that.. then I understand it would be all legal if I made a
port of the whole Sun's API to another platform or even implemented it
in another language? Nice...

What you are talking about here is probably reimplementing the jdk API.

An interface in java is an abstract programming construct (such as List
or Iterable), while the API is a concrete implementation (such as
ArrayList and BufferedWriter) and under a Sun license. I.e. you are not
allowed to call such a software package anything Java or Java API unless
it is licensed by Sun and has passed the conformance tests. (Thats why
microsoft in the end, had to stop supporting java and then created C# as
a replacement in its product line)

So, if you want to port the entire jdk to another platform etc, I think
you should talk with Sun about it first.
But, if you are just talking about creating a 3rd party implementation
of one of javas framework etc, such as a cryptolib or collections
package, then go right ahead, thats what those frameworks and interfaces
are there for.

/tom
 
I

Ian Pilcher

golem said:
Assume that I want to create my own implementation of an existing
interface, eg. java.lang.ArrayList. Will it be OK if I use the
interface
designed by Sun, ie. won't it be in violation with copyright law?

ArrayList is not an interface. It is a class which implements the List
interface, among others.
 
O

Oliver Wong

golem said:
Nice to hear that.. then I understand it would be all legal if I made a
port of the whole Sun's API to another platform or even implemented it
in another language? Nice...

See the Gnu ClassPath. They are essentially doing what you are doing.
Might want to ask them what legal issues they have considered before
starting their project.

http://www.gnu.org/software/classpath/

- Oliver
 
G

golem

ArrayList *provides* an interface, similarily every (not necessarily
public) class does. Don't think of an interface as a Java-exclusive
term.
 
G

golem

First you should learn what "interface" means in the Java language.
Then you might understand the answer you were given.

I was talking about "interface" in the context of object oriented
programming, not java interface.
 
G

golem

Hm.. to make it clear:

"An interface defines the communication boundary between two entities,
such as a piece of software, a hardware device, or a user. It generally
refers to an abstraction that an entity provides of itself to the
outside. (...)" (wikipedia)

As you can see, the term is not strictly related with java or even with
a programming language. Furthermore:

"The Java programming language takes a *different* approach to the
concept of the interface normally existing in other object-oriented
programming languages (ie., that the interface specified is the
interface to the class), in that an interface specifies a set of
methods which implement some specific functionality, common to a set of
classes. See protocol (object-oriented programming)." (wikipedia)

In my post I have been talking about an interface in its wider sense.
Hope this made the issue clear :)
 
I

Ian Pilcher

golem said:
As you can see, the term is not strictly related with java or even with
a programming language. Furthermore:

This, however, comp.lang.JAVA.programmer.
 
T

tom fredriksen

golem said:
ArrayList *provides* an interface, similarily every (not necessarily
public) class does. Don't think of an interface as a Java-exclusive
term.

I think you need to be more specific about your question and what yoyu
want to achieve for us to be able to help you. Questions that come to
mind are:
- are you just talking about creating a similar class or
- are you reimplementing this class only or a larger part of the jdk
 
N

Nigel Wade

golem said:
ArrayList *provides* an interface, similarily every (not necessarily
public) class does.

The term API is commonly used for this, and avoids confusion.
Don't think of an interface as a Java-exclusive
term.

Unfortunately a Java "interface" is a very specific part of the language spec.
and is different from an API. Hence the confusion.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top