Confluence of e-commerce application and Employee time tracking system (ETTS).
- In E-commerce, there are products, orders, and customers.
- In ETTS, there are
days employees, employee-days, and
employees employer
If using an e-commerce software, utilize products screen -- for managing products for ETTS purposes where a product is a day, or maybe the other way around, employee should be a product? No, because there is only one "customer", i.e. Employer? Actually, that's fine so:
"Employees, EmployeeDays, Employer (single)
EmployeeDay has status attribute ("present," "late", "sick").
Employee day time span (i.e. equiv "order") has status enum.
Who filled the order? i.e. Who marked attendance? Another order attribute or member collection based on who updated version controlled item in Sharepoint list?
Event sourcing solution? MyEDB with Sharepoint list backing store? Silverlight front-end calling Sharepoint WS?
Event = "any change of the state of a system sub-environment"
Responders responsible for creating events or alternatively Environment triggrs/invokes a change event.
Different types of events have different attributes. So EmployeeDayRecordedEvent e, has e.personwhorecordedthis, e.calendarday, e.employeeid
:= Event types = SP Content Types?
Events track state changes.
BLL? i.e. where to put rule that only first login of day creates EmplDayRecEvent? In the presentation logic? One of the environments?
Events generated in the
client environment (persisted in local log files via Client App Log File Repository)
Event types = Environments ?
All business rules (BR) are represented by responder definition, i.e. responder "responds to given environment state by changing that state"
Biological Environment in Code (BEinC, pron. "Bank").
How to set Global Employee Day Record Env State with new state (Employee X set for present today).
"Passive entities" - Client responder for posting events observes that login event occured, looks through local event logs for another one from today; if none, does ajax post or WS call, which inserts event to
Global Shared record store for client side events.
So essentially, client controls synchronization of select events to shared Event store, itself an environment - "Shared Event Store Environment" (SESE).
Global Env subscribes to any SESE state it chooses. i.e. to update its own state resulting in a state update event (Base event type).
E.g. event tuple: (eventid, employeeid, status, calendarday)
EmplStateChangeEvent.
How to pivot this event store to view resembling the original spreadsheet file?
A "Service" (e.g. WCF service) is a collection of operations (service is made available from a service host) that facilitate synchronization of events between environments (e.g. a client event store, a user's mental model, or the global Env).
Service synchronizes both ways, i.e. a query would be the reverse direction (see Seemann's 'IContractMapper' example).
In SP can code responders as workflows?
Lists:
SharedClientEnv (person, machine, loginorlogout); attach workflow: if first in day, insert EmplStateChangeEvent to EmplDayRecordEnv
EmployeeDayRecordEnv (Sharepoint event list type for calendar view?) (person, calday, status)
If a DDD entity can be identified by primary key in DB table (see Seemann p.214), i.e. a DDD Entity can be a record, then a EmployeeDayRecordEnv record can be an Entity?!
Does this sound like something that warrents DDD or am I trying to fit something in that just doesnt fit, I cant believe this, as nearly all web based systems are just reflections over data at their core and merely provide facilities for the users to perform basic crud methods on a system. Would you model the crud methods e.g. AddRegion as a domain method or just at the service level?
Sorry to be a pain, but this is one of the biggest hurdles I always have with DDD, if you can suggest any reading or articles, I would be extremely grateful (where did I put Erics book…)
January 23rd, 2010 at 9:32 pm Andrew,
That kind of behavior can be built using the Active Record pattern instead of the Domain Model pattern. As you said, it is simple data manipulation and, as such, doesn’t require it. That said, DDD is broader than the Domain Model pattern and there are many other useful elements to it that can still be applicable.