For an internal project (C# / NHibernate / ASP.NET MVC / JQuery) there was a request that users could be able to mark parts of the data with colors to indicate parts of the data have changed.
If I had to incorporate this into my domain model, it would be quite complex. I would have to keep track of statuses of every property of every object, and every action should know which status data is relevant to that particular action.
I decided that this would be a simple solution: the coloring will be purely a user-interface feature. There will be a table in the database with the columns "URL", "ElementId", "Color" to store the coloring data. The userinterface will be querying this data after the page has been loaded and store the data using AJAX calls.
I am not 100% sure about this. It is clearly the simplest solution. But the colors are really statusinfo about the data in the application, while the statusinfo will never be associated with the data, only with user interface elements. But I decided in favor of the UI solution taking into account that
- the coloring data is cursory
- the request is purely a visual one
- the ASP.NET MVC application will be the only user of the data
See if I will regret this later.