Thursday, July 26, 2012

Project Server

Microsoft's Project Server appears to be a good example of a combination of BLL/DAL and CQRS. See http://msdn.microsoft.com/en-us/library/office/ee767687.aspx

Saturday, July 21, 2012

Procedural Code Complements OO Objects

When we create applications we 1) Create classes that encapsulate behavior 2) Create procedural code to make objects interact
Source: AppDev

Friday, July 20, 2012

Predicate vs. Func

Predicate is just a special cased Func<T, bool> really, introduced before all of the Func and most of the Action delegates came along. I suspect that if we'd already had Func and Action in their various guises, Predicate wouldn't have been introduced... although it does impart a certain meaning to the use of the delegate, whereas Func and Action are used for widely disparate purposes.
Jon Skeet - http://stackoverflow.com/questions/4317479/func-vs-action-vs-predicate

See example usage in Array.Find<T>:
http://msdn.microsoft.com/en-us/library/bfcke1bz.aspx

Sunday, July 15, 2012

Try/catch logic = Code smell

be mindful of using the try/catch block as logic. It's a code smell that my nose has a particular dislike for, and often used by newbies or those of us in a big hurry to meet a deadline.
Chris Ballance
 http://stackoverflow.com/questions/248961/c-sharp-using-statement-catch-error

RAII

The replacement for RAII in .NET is the using-pattern, which works almost as well once you get used to it.
Rasmus Faber
http://stackoverflow.com/questions/173670/why-is-there-no-raii-in-net 

There's some similar threads if you search for them but basicly what it boils down to is that if you want to RAII on .NET simply implement an IDisposable type and use the "using" statement to get deterministic Disposal
Torbjörn Gyllebring

Saturday, July 7, 2012

BIO-ENV in practice - Brainstorming

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?!

Wednesday, July 4, 2012

Branches, Tags, and the Trunk -- and Stem


On a daily basis, developers in branches merge changes from the trunk into their branchMerge branch features back into trunk when you're ready to deployBug fixes are performed on the trunk then tagged and re-deployed
http://weblogs.asp.net/bsimser/archive/2008/05/06/day-to-day-with-subversion.aspx

So, development mostly occurs in the trunk (with the exception of cases where isolation e.g. of new features necessitates separation through branching), with branches corresponding to major releases (1.1, 1.2...).

The important takeaway is that for every main version of the software you are maintaining, you have a branch that contains the latest version of code for that version.
gregmac - http://stackoverflow.com/questions/16142/what-do-branch-tag-and-trunk-really-mean


Stem technique of version control: http://www.ronaldwidha.net/2009/10/04/branch-management-pattern-part-2-development-on-branch-stemming/

Never commit to master.The way of working that has worked well for us is the “never commit to master” approach (replace “master” with “default” if you use mercurial). 
http://www.stateofcode.com/2013/05/never-commit-to-master/