All Questions
7 questions
0
votes
3
answers
3k
views
How to handle a new method in the interface that is not applicable for all classes?
I am faced with an interesting OOD problem: I have an interface with 3 methods:
interface TestInterface {
String action1();
String action2();
String action3();
}
and 3 classes that ...
1
vote
1
answer
76
views
Modeling objects that behave in different ways so that they can be stored in a collection?
Suppose I have a Player class with an Inventory:
public abstract class Player {
private final List<GameObject> gameObjects;
public Player(){
this.gameObjects = new ArrayList&...
3
votes
1
answer
4k
views
Should an abstract class implement an interface, as opposed to defining its own abstract methods?
I'm defining a class structure for persisting to our cassandra database, and I'm unsure about using a combination of an abstract class and an interface. I have two concrete classes, one for persisting ...
6
votes
4
answers
11k
views
Are empty interfaces (but not marker interfaces) a bad programming practice?
I'm designing an architecture in which I have:
public interface IObjectReader{
public Object read();
}
public class ConcreteObjectReader implements IObjectReader{
@Override
public ...
-1
votes
3
answers
2k
views
Can I say Interface is a set of general behavior? [duplicate]
I'm new to OOP. Can I say Interface is a set of general behavior that may be have and act uniquely by a set of objects that have in common? And Abstract class has similarity with Interface but it have ...
1
vote
1
answer
2k
views
How to generalize a classes that has identical function plus some additional function
I have some designing problems with my project. To illustrate my problem, I'll use the following two classes from my project.
public class RAM_UserManagement{
private Map<int,User> userList;
...
42
votes
9
answers
4k
views
Programming for future use of interfaces
I have a colleague sitting next to me who designed an interface like this:
public interface IEventGetter {
public List<FooType> getFooList(String fooName, Date start, Date end)
...