Tagged Questions
45
votes
4answers
1k views
Why were Java collections implemented with “optional methods” in the interface?
During my first implementation extending the Java collection framework, I was quite surprised to see that the collection interface contains methods declared as optional. The implementer is expected ...
15
votes
11answers
2k views
Is it a really required skill to program without API documentation?
I barely passed my Java programming exam today. I had to answer some general questions about threading which I did well and to write a little threaded program which was worse. I had to connect my ...
14
votes
3answers
401 views
Does decoupling trump DRY in REST?
I am building a REST API to expose most of functionality of an existing Java API. Both APIs are for internal use within my organization; I do not have to design for external use. I have influence ...
9
votes
3answers
621 views
Joda Time vs Java Time
Although Joda is feature rich and more sophisticated than standard Java time, it may not always be the best thing to use. How do I decide if I should use Joda Time or Java Time in any Java code?
Is ...
9
votes
6answers
2k views
Are Java's public fields just a tragic historical design flaw at this point?
It seems to be Java orthodoxy at this point that one should basically never use public fields for object state. (I don't necessarily agree, but that's not relevant to my question.) Given that, would ...
8
votes
8answers
593 views
Examples of Java APIs that demand an action sequence
As part of a research I'm working on, I'm looking for public APIs that only work correctly when you apply a certain sequence of actions on them.
For example, the java.nio.channels.SocketChannel ...
6
votes
6answers
374 views
Should I continue teaching old Java input methods alongside the new ones?
I've been imparting a Java introduction course for several years. Some slides explain how to read from files and keyboard using BufferedReaders, InputStreams, FileInputStreamReaders etc.
I'm adding ...
5
votes
2answers
462 views
Why does the add() method of a Linkedlist return true in Java?
Why does the add method of a Linkedlist return true in Java?
http://docs.oracle.com/javase/1.5.0/docs/api/java/util/LinkedList.html#add(E)
Why not just make it a void method? I know it says "per the ...
5
votes
2answers
128 views
API design involving standard and custom settings
Suppose a class allows some kind of configuration that has some well-known default values but also has the option of defining a custom value. For example, suppose you want to let users configure a ...
4
votes
2answers
426 views
What are the best patterns/designs for stateful API development?
I am about to implement a API for my TCP/IP server written in Java. Right now I have a temporary method that takes a String, executes a command based on the String and returns a String basically like ...
4
votes
1answer
290 views
Eloqua API Full Code Example in JAVA
Is there anyone out there who has mastered to retrieve some data programmatically from Eloqua?
First of all, I'm more or less a newbie, as far as JAVA. I can follow tutorials, take directions and ...
3
votes
7answers
2k views
What is the best way to remember Java APIs? [duplicate]
I have been doing Java for nearly a year now and I have difficulty remembering Java APIs and method names. What is the best way to remember them?
3
votes
7answers
2k views
How do I search the Java API? [closed]
Since the Java API pages have no search function, at least not one that I see, how do I find out what methods are in which packages?
3
votes
1answer
2k views
What is the best way to comment a deprecated class in Java?
I would like to know the best way to add a comment to identify a deprecated class in Java. Should I remove the previous comment added to the top of the class that helps another programmer to know what ...
3
votes
3answers
421 views
Designing an API on top with Java RMI and Rest APIs
I'm working on the backend of a java web application. We have a document repository (Fedora Commons specifically) where we house xml files. I want to abstract the API of the repository internally so ...