Nate Ebel
1 min readFeb 9, 2018

--

Ahh yes.

You’re spot on with the examples here. The ToastData and SnackData could absolutely be modeled as a single class

We’ve used it for another case internally where each class type doesn’t have the same data types, in which case the simplified approach you described wouldn’t work. I didn’t include it though because it would have just been a lot more code/text to show.

For the Toast and Snackbar example we are probably better off using a single class, and possibly some default argument values.

--

--

Nate Ebel
Nate Ebel

Written by Nate Ebel

Building great software and helping others do the same.

No responses yet