Mar-03-2021, 05:19 PM
(This post was last modified: Mar-03-2021, 05:55 PM by deanhystad.)
Glue code is a bit of code that ties two things together. In your example you might have a database object and a tab page object. Ideally the tab page shouldn't have to know anything about the database, or the database know anything about the tab page. To make the two parts work together you write a little bit of code that knows just enough about both pieces to "glue" them together and do something.
The glue code can be quite substantial and given fancy names. In the MVVM design pattern the Model would be your database. The View your tab page. And the View Model is the glue code that gets info from the tab page and modifies the database. You were attempting to make a View Model (glue) when you wrote the enterNewHardware class.
The glue code can be quite substantial and given fancy names. In the MVVM design pattern the Model would be your database. The View your tab page. And the View Model is the glue code that gets info from the tab page and modifies the database. You were attempting to make a View Model (glue) when you wrote the enterNewHardware class.