TEST DRIVEN DEVELOPMENT

本文探讨了控制器模式在软件架构中的作用,详细介绍了其主要职责包括接收请求、选择合适的处理程序并执行业务逻辑。此外,还讨论了控制器在错误处理中的角色,并提到了存根作为一种测试工具的应用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

core j2ee patterns describes a controller as a component that interacts with a client,controlling and managing the handling of each request. and tells us that it is used in both presentation-tier and business-tier patterns. in general, a controller does the following: accepts requests;performs any common computations on the request;select an appropriate request handler;routes the request so that the hanlder can execute the relevant business logic; may provide a top-level hanlder for errors and exceptions. a controller is a handy class and can be found in a variety of applications.
stubs are a mechanism for faking the behavior of real code that may exist or that may not have been wrritten yet. stubs allow you to test a portion of a system without the other part being avaiable. they usually do not change the code you are testing ,but instead adapt to provide seamless integration.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值