how to synchronize data between DAL and classes that created the object
For example, I have three classes named TriggerBLL. TriggerDAL and Scheduler.
1.TriggerBLL.LoadFrom(string xmlContent) method will create a Trigger
object from xml string such as
<trigger id="15" name="trigger1" />
2. TriggerDAL.AddTrigger(Trigger t) will save a trigger object into a
table in database which id is set to auto increase.
3. Scheduler will use trigger's id to do some operations.
Thus the question is, when the trigger table in database is empty. it's
trigger id may start from 1, but the trigger object created from
TriggerBLL may have its id set to 15, how can Scheduler get the trigger
object which owns database's id instead of TriggerBLL's ?
No comments:
Post a Comment