Skip to content

Question: Is it good form to Dispatch a signal in a Model "setter" for poor man's Data Binding? #4

Description

@travisbrownjohn

Hi, Thanks for all the great work on StrangeIoC so far! I'm part of an experienced dev team looking to make the switch from a proprietary in house engine to Unity, and Strange has really helped inform our architecture decisions.

I'm new to MVC and C# in general but I was wondering if it makes sense to hook a signal to a set method of a Model's property?

private int _score;
public int score 
{ 
   get { return _score; } 
   set 
   { 
       _score = value; 
      updateScoreSignal.Dispatch (_score); 
   } 
}

This seems simpler to me than having to remember call
updateScoreSignal.Dispatch (model.score); everytime I update the Model.score property.

Thoughts?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions