MR3Y
Jan 13, 2021

Neat Approach, but I think more clever solution would be to create a custom property delegate (i.e `ReadWriteProperty`) and delegate the fields to it, benefits of this approach would be:

1- reusable we can use it with more than just a viewmodel

2- significantly less boilerplate compared to many interfaces approach

3- well encapsulated, it will not allow the consumer to modify the property

4- last but not least, it will be more elegant, cleaner and readable to anyone reads the code.

What do you think about it?

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

MR3Y
MR3Y

Written by MR3Y

Eager to learn more and more! I hate boilerplate. I blog to share some tips & tricks and to talk about my humble opinion.

No responses yet

Write a response