I will display a grid of a view model class M {string A, int B, float C, int D, .....}
:
- Render the number in red if it's negative.
- Highlight the background of the cell if
A is in 'xxx', 'zzz' and B = 0 or D > 200...
- Set the background of the row to grey if
E > 100 and F < 0....
Are these considered business logic? Where to put these logic if they are? For (3), I guess a new read-only property can be created in in the view model? But it make the M not POJO/POCO any more? I read that the business logic should be in domain object. Is the domain object implemented using POJO/POCO?
Is there any code sample shows how the business logic is stored in domain objects?