Tasks layer

174 views
Skip to first unread message

Péter Szél

unread,
Mar 16, 2012, 4:07:19 PM3/16/12
to sharp...@googlegroups.com
Hi!

I'm new on this list, and new to SharpLite. I red through the basics article, but couldn't understand the reason for the Tasks layer. Why do we need a separate layer for that, we could just put all those logic to the domain layer. Could you please explain me that?

Thank you for your help!

Péter

Billy McCafferty

unread,
Mar 16, 2012, 6:43:55 PM3/16/12
to S#arp Lite
Hi Péter,

Use of the .Tasks layer isn't a necessity for application
development. The purpose of it is to encapsulate coordination
activities (e.g., talking to repositories and web services) within a
separate layer.

Alternatively, the coordination logic could live directly within
controller classes or within the domain. The benefit of getting rid
of it is, of course, reduction in architectural complexity. The
drawback is that the controller is typically seen as being part of the
web layer; so putting the logic in the controller can quickly lead to
concerns bleeding together.

As another alternative, the coordination logic could live directly
within the domain layer, as you suggested. If I had to choose between
putting it in the controller layer or domain layer, I would choose the
domain layer and suffix these "coordination classes" with xxxTasks,
xxxServices, or some other identifiable prefix.

IMO, a separate .Tasks layer is great for larger projects, overkill
for the smaller ones.

Billy McCafferty
Reply all
Reply to author
Forward
0 new messages