Is there a difference between ASP.NET N-Layered / DDD architecture and a Window service software architecture? [closed]

StackOverflow https://stackoverflow.com/questions/8169682

Вопрос

I am reading a lot of architecture (N-Layered and DDD) yet most of the articles are about web site architecture and develop mostly windows services.
Can the architecture be used the same way?

Это было полезно?

Решение

The primary goal of "layers" in software architectures are to separate concerns; your program logic should be separate from your data persistence, and from your user interface.

A Windows Service will not have a UI, but you can still gain efficiency, supportability and reduce the impact of future changes by separating your functionality logically. For example:

  • Windows Service Layer: responsible for launching the service, handles defined events and exceptions - sort of analogous to the UI layer in a Web application, but obviously without UI
  • Business Layer: Classes to execute your processing and encapsulate logic
  • Persistence Layer: Abstracts persistence of data and state to database, xml, registry, whatever

So most of the Web architecture concepts you read about can be applied, and most of the tools can be used for Windows services as well.

Другие советы

Yes of course, except the Windows Service will likely not have much of a UI tier, if at all. Just a lightweight runnner method or so.

Although the services are different as they do not have a UI element to them, however there are ways to use the principles that apply in (N-Layered, DDD) i.e. development principles.

So for e.g. Services Share Schema and Contract, Not Class i.e. they are designed on Interfaces so a windows service can be a REST BASED service as well as a WCF Service but than again it can also call a repository underneath.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top