daostack / arc.js

DAOstack JavaScript Client
https://daostack.github.io/arc.js/
GNU General Public License v3.0
14 stars 17 forks source link

Add vote and votes methods to `ICompetitionSuggestion` #352

Open dkent600 opened 4 years ago

dkent600 commented 4 years ago

Would be nice if ICompetitionSuggestion contained the vote and votes methods. I guess this is an effect of how the client lib entities are architected in general, where entity's static and dynamic properties are stored in class fields rather than the class itself, whereas the entity methods are stored elsewhere in the class. This is awkward for the user to code and not intuitive as it does not follow the usual object-oriented design pattern everyone is used-to.

jellegerbrandy commented 4 years ago

I think there is a clear pattern, and i am not sure what "usual object-oriented design pattern averyone is used to" you mean that we can use here (but I am curious to learn, because I agree that there is something a bit awkward here)

explanation:

So, with that terminlogy, what you are proposing (perhaps) is to have a pattern that looks like this:

class Entity implements IEntityState

public state(): Observable<Entity>

Is that what you hae in mind?