I have a general question regarding normalizing behavior
I have a Order object which has the option to be Active or Inactive. There are 2 ways how I would change the status of the order. 1) I would open the order and change it status to Active/Inactive. I can also change anything else and call the save function, which will call the update SP. 2) I would select an order in a list and click on change status, allowing to change it and save. Do I need to load the full Order object or can I create a new Object ChangeOrderStatus which will have a SP to change the status only or now it's not normalized because we have 2 places where we can change the order status.
white911:Do I need to load the full Order object or can I create a new Object ChangeOrderStatus which will have a SP to change the status only or now it's not normalized because we have 2 places where we can change the order status.
Its up to you if you want both objects to have the "responsibility" to change the status of a given order. I would tend to think that the "Change Status" responsibility be its own object like your second example. For this you can create your ChangeOrderStatus (inherits from CommandBase) that sets the status accordingly. Your CommandBase object will need the order pk value as a criteria.
I am working with VB.Net 2003 and CSLA 1.53 which does not have yet the command object.
However if I create a seperate class which handles updating the status, do I also include it in the main Order Object when we update a full order to use the new class to update the status?
Copyright (c) Marimer LLC