Implement interfaces and abstract classes
See original GitHub issueAt the moment we have classes that are named like ConnectionInterface
, using an Interface
suffix to indicate that they have implementation expectations.
Those classes are actually abstract
classes and should be refactored to behave like one. There are a few exceptions which are or should actually be interfaces
that are implemented by other classes instead of extending an abstract
class.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Implement Interface using Abstract Class in Java
Interface contains only abstract methods that can't be instantiated and it is declared by keyword interface. A class that is declared with ...
Read more >Why an abstract class implementing an interface can miss the ...
Interface means a class that has no implementation of its method, but with just declaration. Other hand, abstract ...
Read more >Java Interface and Abstract Class Tutorial With Examples
When an interface is implemented by a class, then it provides an implementation for all the abstract methods of the interface. Similarly, all ......
Read more >Abstract Class vs Interface in Java – Difference Between Them
An abstract class permits you to make functionality that subclasses can implement or override whereas an interface only permits you to state ...
Read more >Using an Interface vs. Abstract Class in Java - Baeldung
Any interface with a single abstract method other than static and default methods is considered a functional interface. We can use this feature ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
They would be managed in the same repository. I would restructure the repository to contain 3 folders that are managed by lerna as
essentials
,optional
andtypes
.essentials
would be packages that are required to run a node like blockchain, pool, etc.optional
would be packages like api, webhooks, etc.types
would be packages that contain only the type defsSo, I thought about it some more, and even in their own types modules, you’d still have the circular dependency problem if your interfaces need to reference each other(method parameters or instance properties). If they’re all in a single module, they can all see each other so it’s all good, but if they’re in different modules, the types modules would have to have dependencies on each other and you run into the same problem, introducing a circular dependency among the types modules.
The only way that would work is if the dependencies are realized(so
app.resolvePlugin<ImportedType>
) in the concrete implementation, not on the interface layer, i.einterface Blockchain { get transactionPool() : TransactionPool }
. But that isn’t a good approach because it restricts how you write your interfaces(to make sure you don’t reference a type what would result in a circular dependency)