decoration decoration
Stories

GROKLAW
When you want to know more...
decoration
For layout only
Home
Archives
Site Map
Search
About Groklaw
Awards
Legal Research
Timelines
ApplevSamsung
ApplevSamsung p.2
ArchiveExplorer
Autozone
Bilski
Cases
Cast: Lawyers
Comes v. MS
Contracts/Documents
Courts
DRM
Gordon v MS
GPL
Grokdoc
HTML How To
IPI v RH
IV v. Google
Legal Docs
Lodsys
MS Litigations
MSvB&N
News Picks
Novell v. MS
Novell-MS Deal
ODF/OOXML
OOXML Appeals
OraclevGoogle
Patents
ProjectMonterey
Psystar
Quote Database
Red Hat v SCO
Salus Book
SCEA v Hotz
SCO Appeals
SCO Bankruptcy
SCO Financials
SCO Overview
SCO v IBM
SCO v Novell
SCO:Soup2Nuts
SCOsource
Sean Daly
Software Patents
Switch to Linux
Transcripts
Unix Books

Gear

Groklaw Gear

Click here to send an email to the editor of this weblog.


You won't find me on Facebook


Donate

Donate Paypal


No Legal Advice

The information on Groklaw is not intended to constitute legal advice. While Mark is a lawyer and he has asked other lawyers and law students to contribute articles, all of these articles are offered to help educate, not to provide specific legal advice. They are not your lawyers.

Here's Groklaw's comments policy.


What's New

STORIES
No new stories

COMMENTS last 48 hrs
No new comments


Sponsors

Hosting:
hosted by ibiblio

On servers donated to ibiblio by AMD.

Webmaster
Practical Example | 214 comments | Create New Account
Comments belong to whoever posts them. Please notify us of inappropriate comments.
Programs vs Bodies of Code vs (sub)Programs
Authored by: Anonymous on Tuesday, May 22 2012 @ 12:06 PM EDT
I am not a java programmer, but from what I think I understand from what I have
read by others who claim to be java programmers, the term "interface"
has a very specific meaning in the java programming language.

[ Reply to This | Parent | # ]

Salad Bar analogy
Authored by: Anonymous on Tuesday, May 22 2012 @ 12:20 PM EDT
Your "Salad Bar" analogy highlights almost everything wrong with
thinking of "The API" in a nice simple to understand way. Thank you!

Now I know to ask "How many salads are there a salad bar" when someone
brings this stupidity up.

Or, to put things a completely different way:

Read the following line of brackets:
((()(()()))()((()())()))

Each of those matched pairs of brackets (including everything between them) is
representative of "an API".

[ Reply to This | Parent | # ]

Practical Example
Authored by: BitOBear on Tuesday, May 22 2012 @ 12:30 PM EDT

Consider this valid java file "Porrage.java" made just for this example. (creative commons terms apply).

import java.lang.*;

class Porrage {
public class Exceptional extends Throwable { };
public class TooCold extends Exceptional { };
public class TooHot extends Exceptional { };
public final
void Acceptable(int temp) throws Exceptional {
if (temp < 68) throw new TooCold();
if (temp > 130) throw new TooHot();
return;
}
}

This exports a class "Porrage" and the following "API"

public final void Acceptable(int) throws Excpetional

Plain reading of the code shows that "Exceptional" is never thrown. The user will have to "catch" it however, or pass it on. This may or may not be a good API for this. [ASIDE: and note the similarity to rangeCheck() /snark.].

Now, does the "API" throw one, two, or three exceptions?

By formal definition it throws one. By factual analysis it throws two. By proper coding you will need to deal with all three since you will either have to catch all three; "TooHot" and/or "TooCold" are the data you want to know, but since the signature says "Exceptional", someone somewhere is going to have to write a catch for Exceptional to use this code.

This goes directly back to the whole "formal API" vs "defacto API" discussion I previously declaimed. Also, without a documentation element (or decompiling in the case of Java per se) the API user would have to discover "TooHot" and "TooCold" by trial and error.

So the defacto (true) API is whatever the java compiler gets by cracking open and looking in the resulting .class files, and not any other external definition. But the API is ALSO the formal spec, and/or the "rules" and who knows what else.

This whole question is a result of lawyering and not a result of the facts of the technology as it exists. Any answer that is "responsive" to the question as written will compound the errors.

[ Reply to This | Parent | # ]

Groklaw © Copyright 2003-2013 Pamela Jones.
All trademarks and copyrights on this page are owned by their respective owners.
Comments are owned by the individual posters.

PJ's articles are licensed under a Creative Commons License. ( Details )