Model-engineering implementation and expansion (Design Mode C #) template method template-Self-Test"

Source: Internet
Author: User
Transferred from: Model-engineering implementation and expansion (Design Mode C)

Http://www.cnblogs.com/callwangxiang/

 

 

Self-Test

1,Calculation of inflation rate is generally applicable3This includes the use of the Consumer Price Index (CPI), Producer Price Index (PPI),GDPThe contraction index is calculated using the following formula:

 

π _ T = (cpi_t-CPI _ (t-1)/cpi _ (t-1)
π _ T = (ppi_t-PPI _ (t-1)/PPI _ (t-1)
π _ T = (gdp_t-GDP _ (t-1)/GDP _ (t-1) (T: generally expressed as the year)

 

BecauseGDP,PPI,CPIThe acquisition and production of data is very complex, but in order to develop the calculation module of inflation rate, you cannot expect the calculation modules of these three indicators to be completed before you, use the template method described in this chapter to design a computing interface and pass unit test verification.

 

 

2. one OA the project needs to process many different files, and all types of file entities have implemented IDOC Ument interface. Now you need to define an intermediate processing object ( broker ), the intermediate processing object is responsible for receiving and issuing documents.

UseEvent (Event)As an operation template for receiving and sending texts, describe an abstractBrokerThe object template is verified by the test Type and unit test.

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.