39.3k views
3 votes
What design pattern is applied in ADO .Net to encapsulate the requests of actions as an object?

A.Command
B. Iterator
C. Mediator
D. Observer

User Pietrodito
by
8.0k points

1 Answer

4 votes

Final answer:

The design pattern applied in ADO .Net to encapsulate the requests of actions as an object is A. Command. This pattern allows decoupling of the requester and receiver.

Step-by-step explanation:

The design pattern that is applied in ADO .Net to encapsulate the requests of actions as an object is A. Command.

The Command design pattern is a behavioral pattern that converts a request into a separate object, allowing the requester to be decoupled from the receiver. In ADO .Net, the DbCommand class is an example of this pattern. It represents a command to be executed against a data source, encapsulating the details of the operation.

For example, in ADO .Net, you can create a DbCommand object to encapsulate a SQL query and execute it using the ExecuteNonQuery method. The CommandText property of the DbCommand object holds the query, and the ExecuteNonQuery method sends the query for execution.

User Nico Liu
by
7.3k points