Giter Club home page Giter Club logo

Comments (6)

lontivero avatar lontivero commented on August 17, 2024

It is not redundant, IMO. The abstract class ClassName : IInterface is a very convenient pattern that gives you the flexibility to change your code with less pain. It also allows you to create your own INodeBehavior implementation directly without using the abstract class, if you want/need to.

from nbitcoin.

NicolasDorier avatar NicolasDorier commented on August 17, 2024

Even though I don't use it in my code, the main problem is that changing that now can break lots of code for not a lot of upside.
Looking back I would probably not have used an interface as it makes things more complicated to change in the future, but well... at least we can have any class be a behavior as lontivero said.

My decision back then to be an interface was that the contract was very simple: Attach and Detach.

from nbitcoin.

plimxx avatar plimxx commented on August 17, 2024

OK, we can maintain INodeBehavior if we want -it does not hinder-, but this question appeared for me thinking of 'NodeBehaviorsCollection'.
If NodeBehaviorsCollection is a collection of NodeBehaviors... I think it has nothing to do to do with INodeBehavior, which is for "another uses we want/need" as lontivero says.
So, in my humble opinion, a collection of NodeBehaviors must have exactly NodeBehaviors and must exactly inherits a ThreadSafeCollection of NodeBehavior, not a ThreadSafeCollection of INodeBehavior, which may have little -or somewhat stranges- relationships with NodeBehaviorsCollection in a future.
I suggest making at least this little change in NodeBehaviorsCollection. I think this will make the code more accurate.

from nbitcoin.

Varmetric avatar Varmetric commented on August 17, 2024

Peleando!!

El 1 may 2016, a las 7:09, Carlos J. Díez [email protected] escribió:

OK, we can maintain INodeBehavior if we want -it does not hinder-, but this question appeared for me thinking of 'NodeBehaviorsCollection'.
If NodeBehaviorsCollection is a collection of Nodes... I think it has nothing to do to do with INodeBehavior, which is for "another uses we want/need" as lontivero says.
So, in my humble opinion, a collection of Nodes must have exactly Nodes and must exactly inherits a ThreadSafeCollection of NodeBehavior, not a ThreadSafeCollection of INodeBehavior, which may have little -or somewhat stranges- relationships with NodeBehaviorsCollection in a future.
I suggest making at least this little change in NodeBehaviorsCollection. I think this will make the code more accurate.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub

from nbitcoin.

NicolasDorier avatar NicolasDorier commented on August 17, 2024

We can't make a NodeBehaviorsCollection a collection of NodeBehavior without breaking lots of existing code for little upside. I don't think it is worth changing it for only easthetic reasons. Especially that users never deal directly deal with the interface and always ends up using Find<TBehavior>.

I don't think changing to collection of NodeBehavior will make their life easier, and at worse may break some of their code.

from nbitcoin.

plimxx avatar plimxx commented on August 17, 2024

Thanks Nicolas. I understand and agree.

from nbitcoin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.