Controller & # 8596; Component component interaction

UPDATED:

I have a desktop application with the following interacting components:

  • Winforms UI.
  • Service (an in-process C # class containing business logic is actually done ).
  • Controller (C # class that coordinates events generated by the user interface and calls service methods).

If the dispatcher asks the service to do something, but this service needs something else from the controller (i.e. the data that the controller must use the user interface to receive from the user), how should the service get the controller to do this?


I agree with the concept that

  • User is contacting
  • User interface that communicates with
  • Controller that communicates with
  • Service component (not to be confused with a web service or a service outside the process) that communicates with
  • Data / Repositories that compile ...

etc.

However, as for the controller communicating with the Service, which method is best for this? If:

  • Service methods should be fairly fine-grained and throw exceptions if something is wrong, so the dispatcher knows whether to move or tell the user that something went wrong? Or...
  • Service methods return objects that the controller can check to decide what to do next.

I like the first option, because the second can mean a class explosion, where you need the ServiceResult-style class for each service method.

, - , , , , , , .

?

+5
5

- , " " . , (, ..).

? , , , , .

+2

, /, - . , , .

:

  • ?
    , ... , . - . inject ( IOC), .

  • ?
    , . , -, . , .

  • ?
    , . , , . ? , (, flex, silverlight desktop app). ( , / ) , , .

, . .

+2

, :

- ?

- ? (, ) ?

- - 1.0? ( ) ? (AJAX, Flex, SilverLight), ? (Flex)

.

, ?

0

MVC ( - Java), , , - . , - , (.. ).

, , ? , .

, , , . , , , .

, , . , , .

№1, . , , . , . ( , , , .)

0

Model View Presenter?

The user interface views will implement the interfaces, and these interfaces will be known to your services. In this way, your services can access the user interface to request additional information to complete their tasks. This is a kind of dependency inversion (pdf) .

0
source