Java design issue -Threads, interfaces and inheritance [duplicate]
Possible Duplicate:
Java: “implements Runnable” vs. “extends Thread”
I have two classes called "Hierarchical" and "RS" which extends another class called "Encode". The first two classes also implements Runnable. Which interfaces should I implement, the EncodeInterface or the other two? I also have a number of business objects, do I have to implement an Interface for them as well? Business Object are in a seperat开发者_运维百科e package. Thanks in advance
I am trying to develop using the facade pattern. That requires one to have at least three packages for each subsystem right, one for the business objects, one for logic and another for data access right?
I have two classes called "Hierarchical" and "RS" which extends another class called "Encode". The first two classes also implements Runnable. Which interfaces should I implement, the EncodeInterface or the other two? I also have a number of business objects, do I have to implement an Interface for them as well?
What interfaces you should define and implement depends on what you're trying to do, which isn't very clear from your question.
I am trying to develop using the facade pattern. That requires one to have at least three packages for each subsystem right, one for the business objects, one for logic and another for data access right?
It sounds like you're jumping to the facade pattern without actually knowing that you need it.
The pattern does not dictate what packages or subsystems you have to have. It is a technique for dealing with a situation when you already have a complex system with multiple subsystems and you want to provide a simpler interface for the uses of the system.
精彩评论