ÓÑÇéÌáʾ£ºÈç¹û±¾ÍøÒ³´ò¿ªÌ«Âý»òÏÔʾ²»ÍêÕû£¬Çë³¢ÊÔÊó±êÓÒ¼ü¡°Ë¢Ð¡±±¾ÍøÒ³£¡
¸»Ê¿¿µÐ¡ËµÍø ·µ»Ø±¾ÊéĿ¼ ¼ÓÈëÊéÇ© ÎÒµÄÊé¼Ü ÎÒµÄÊéÇ© TXTÈ«±¾ÏÂÔØ ¡ºÊղص½ÎÒµÄä¯ÀÀÆ÷¡»

VB2008´ÓÈëÃŵ½¾«Í¨(PDF¸ñʽӢÎÄ°æ)-µÚ33²¿·Ö

¿ì½Ý²Ù×÷: °´¼üÅÌÉÏ·½Ïò¼ü ¡û »ò ¡ú ¿É¿ìËÙÉÏÏ·­Ò³ °´¼üÅÌÉ쵀 Enter ¼ü¿É»Øµ½±¾ÊéĿ¼ҳ °´¼üÅÌÉÏ·½Ïò¼ü ¡ü ¿É»Øµ½±¾Ò³¶¥²¿! Èç¹û±¾ÊéûÓÐÔĶÁÍ꣬ÏëÏ´μÌÐø½Ó×ÅÔĶÁ£¬¿ÉʹÓÃÉÏ·½ "Êղص½ÎÒµÄä¯ÀÀÆ÷" ¹¦ÄÜ ºÍ "¼ÓÈëÊéÇ©" ¹¦ÄÜ£¡


he¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡difference¡¡between¡¡the¡¡two¡¡prices¡¡is¡¡subject¡¡to¡¡capital¡¡gains¡¡tax¡£¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡A¡¡variation¡¡of¡¡partial¡¡taxation¡¡is¡¡¡¡ine¡¡splitting£»¡¡so¡¡that¡¡a¡¡lower¡¡tax¡¡rate¡¡is¡¡achieved¡£¡¡Let¡¯s¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡say¡¡that¡¡you¡¡have¡¡a¡¡household¡¡of¡¡two¡¡people¡£¡¡One¡¡of¡¡the¡¡two¡¡earns¡¡the¡¡ine£»¡¡and¡¡the¡¡other¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡stays¡¡at¡¡home¡£¡¡In¡¡such¡¡a¡¡case£»¡¡the¡¡household¡¡would¡¡be¡¡taxed¡¡at¡¡the¡¡same¡¡level¡¡as¡¡a¡¡single¡­person¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡household¡£¡¡Yet¡¡the¡¡two¡­person¡¡household¡¡has¡¡more¡¡expenses¡£¡¡Thus£»¡¡some¡¡countries¡¡allow¡¡a¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡household¡¡to¡¡declare¡¡a¡¡single¡¡tax£»¡¡where¡¡in¡¡effect£»¡¡a¡¡single¡¡earner¡¡in¡¡a¡¡two¡­person¡¡household¡¡is¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡taxed¡¡at¡¡half¡¡the¡¡rate¡£¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡When¡¡calculating¡¡the¡¡total¡¡tax£»¡¡some¡¡countries¡¡linearly¡¡increase¡¡the¡¡taxation¡¡rate¡£¡¡Typically£»¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡the¡¡linear¡¡tax¡¡rate¡¡is¡¡less¡¡for¡¡lower¡¡ines¡¡and¡¡more¡¡for¡¡higher¡¡ines¡£¡¡Another¡¡approach¡¡is¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡to¡¡divide¡¡ine¡¡in¡¡chunks¡¡with¡¡different¡¡tax¡¡rates¡¡for¡¡each¡£¡¡This¡¡means¡¡that¡¡those¡¡monies¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡earned¡¡up¡¡to¡¡a¡¡certain¡¡amount¡¡are¡¡taxed¡¡at¡¡a¡¡certain¡¡rate¡£¡¡Monies¡¡above¡¡that¡¡amount¡¡and¡¡below¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡another¡¡higher¡¡amount¡¡are¡¡taxed¡¡at¡¡a¡¡higher¡¡rate¡£¡¡This¡¡chunking¡¡of¡¡the¡¡amounts¡¡and¡¡rates¡¡keeps¡¡on¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡being¡¡calculated¡¡until¡¡a¡¡highest¡¡tax¡¡rate¡¡is¡¡reached£»¡¡where¡¡any¡¡amounts¡¡over¡¡that¡¡upper¡¡limit¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡are¡¡taxed¡¡at¡¡the¡¡highest¡¡rate¡£¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Organizing¡¡the¡¡Tax¡¡Application¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡As¡¡a¡¡general¡¡rule£»¡¡in¡¡each¡¡country£»¡¡you¡¡must¡¡pay¡¡an¡¡ine¡¡tax£»¡¡which¡¡is¡¡calculated¡¡against¡¡your¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡total¡¡ine¡£¡¡From¡¡your¡¡ine£»¡¡you¡¡can¡¡deduct¡¡certain¡¡expenses£»¡¡thus¡¡lowering¡¡your¡¡taxable¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ine¡£¡¡The¡¡aspects¡¡that¡¡differ¡¡from¡¡country¡¡to¡¡country¡¡are¡¡what¡¡you¡¡can¡¡deduct¡¡and¡¡the¡¡indi

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡vidual¡¡tax¡¡rate¡£¡¡These¡¡will¡¡be¡¡addressed¡¡by¡¡the¡¡tax¡¡application¡¡we¡¡will¡¡build¡¡in¡¡this¡¡chapter¡£¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡For¡¡the¡¡tax¡¡application£»¡¡the¡¡following¡¡features¡¡will¡¡be¡¡implemented£º¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡o¡¡¡¡Define¡¡a¡¡taxable¡¡ine¡£¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡o¡¡¡¡Define¡¡a¡¡series¡¡of¡¡deductions¡£¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡o¡¡¡¡Implement¡¡a¡¡tax¡­calculation¡¡engine¡¡that¡¡has¡¡the¡¡ability¡¡to¡¡account¡¡for¡¡families¡¡or¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡single¡¡earners¡£¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡As¡¡in¡¡previous¡¡examples£»¡¡the¡¡project¡¡structure¡¡of¡¡the¡¡taxation¡¡application¡¡will¡¡consist¡¡of¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡two¡¡projects£º¡¡a¡¡console¡¡testing¡¡application¡¡and¡¡a¡¡library¡¡ponent¡¡that¡¡contains¡¡the¡¡function

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ality¡£¡¡The¡¡library¡¡ponent¡¡will¡¡be¡¡in¡¡a¡¡project¡¡called¡¡LibTax£»¡¡and¡¡the¡¡testing¡¡application¡¡will¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡be¡¡in¡¡a¡¡project¡¡called¡¡TestTax¡£¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Before¡¡we¡¡start¡¡coding£»¡¡however£»¡¡you¡¡need¡¡to¡¡understand¡¡the¡¡concepts¡¡of¡¡interfaces¡¡and¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ponents¡£¡¡


¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­Page¡¡187¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡CH¡¡AP¡¡T¡¡E¡¡R¡¡¡¡¡¡7¡¡¡¡¡¡¡ö¡¡¡¡¡¡¡¡L¡¡E¡¡AR¡¡N¡¡IN¡¡G¡¡¡¡¡¡AB¡¡O¡¡U¡¡T¡¡¡¡¡¡CO¡¡M¡¡P¡¡O¡¡N¡¡E¡¡N¡¡TS¡¡¡¡¡¡AN¡¡D¡¡¡¡¡¡C¡¡L¡¡AS¡¡S¡¡¡¡H¡¡I¡¡E¡¡R¡¡AR¡¡C¡¡HI¡¡E¡¡S¡¡165¡¡



Programming¡¡Using¡¡Ideas¡¡



At¡¡this¡¡moment£»¡¡we¡¡don¡¯t¡¡have¡¡a¡¡clue¡¡where¡¡to¡¡start¡¡building¡¡the¡¡tax¡¡application£»¡¡because¡¡the¡¡¡¡

problem¡¡is¡¡in¡¡the¡¡details¡¡of¡¡the¡¡implementation¡£¡¡Unlike¡¡previous¡¡examples£»¡¡where¡¡it¡¡was¡¡¡¡

possible¡¡to¡¡gauge¡¡what¡¡tests¡¡were¡¡needed£»¡¡in¡¡this¡¡example£»¡¡we¡¡simply¡¡do¡¡not¡¡know¡£¡¡We¡¡could¡¡¡¡

start¡¡by¡¡implementing¡¡the¡¡general¡¡tax¡¡rules¡¡and¡¡then¡¡applying¡¡them¡¡to¡¡a¡¡specific¡¡system¡£¡¡But¡¡¡¡

what¡¡if¡¡our¡¡general¡¡tax¡¡rule¡¡implementations¡¡didn¡¯t¡¡actually¡¡work¡¡out£¿¡¡We¡¡would¡¡have¡¡wasted¡¡¡¡

time¡¡writing¡¡code¡¡that¡¡we¡¡would¡¡end¡¡up¡¡throwing¡¡out¡£¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡Consider¡¡the¡¡following¡¡situation£º¡¡you¡¡write¡¡a¡¡series¡¡of¡¡base¡¡classes¡¡that¡¡represent¡¡a¡¡generic¡¡¡¡

taxation¡¡kernel¡¡based¡¡on¡¡the¡¡information¡¡in¡¡the¡¡¡°Understanding¡¡Some¡¡Basic¡¡Tax¡¡Concepts¡±¡¡¡¡

section¡£¡¡The¡¡base¡¡classes¡¡need¡¡a¡¡task£»¡¡and¡¡thus¡¡wait¡¡for¡¡a¡¡client¡£¡¡A¡¡little¡¡while¡¡later£»¡¡an¡¡individual¡¡¡¡

from¡¡the¡¡United¡¡Kingdom¡¡desires¡¡a¡¡tax¡¡program¡¡based¡¡on¡¡the¡¡base¡¡classes¡£¡¡The¡¡developers£»¡¡¡¡

eager¡¡to¡¡show¡¡off¡¡the¡¡usefulness¡¡of¡¡their¡¡base¡¡classes£»¡¡implement¡¡the¡¡tax¡¡program¡£¡¡The¡¡idea¡¡is¡¡¡¡

that¡¡you¡¡save¡¡time¡¡by¡¡using¡¡the¡¡base¡¡classes¡¡to¡¡implement¡¡something¡¡specific¡£¡¡Without¡¡the¡¡base¡¡¡¡

classes£»¡¡you¡¡would£»¡¡in¡¡theory£»¡¡have¡¡a¡¡longer¡¡development¡¡time¡£¡¡

¡¡¡¡¡¡¡¡¡¡¡¡Experience¡¡has¡¡shown¡¡that¡¡unless¡¡the¡¡base¡¡classes¡¡are¡¡developed¡¡from¡¡highly¡¡experienced¡¡¡¡

business¡¡analyses£»¡¡the¡¡odds¡¡of¡¡the¡¡base¡¡classes¡¡helping¡¡you¡¡are¡¡rather¡¡slim¡£¡¡What¡¡most¡¡likely¡¡¡¡

will¡¡happen¡¡is¡¡your¡¡base¡¡class¡¡code¡¡will¡¡need¡¡to¡¡be¡¡warped£»¡¡twisted£»¡¡and¡¡fitted¡¡to¡¡make¡¡the¡¡¡¡

program¡¡work¡£¡¡The¡¡result¡¡is¡¡that¡¡if¡¡another¡¡client¡¡from¡¡another¡¡country¡¡asks¡¡for¡¡a¡¡tax¡¡program£»¡¡¡¡

the¡¡base¡¡classes¡¡will¡¡yet¡¡again¡¡need¡¡to¡¡be¡¡warped£»¡¡twisted£»¡¡and¡¡fitted¡¡to¡¡make¡¡the¡¡program¡¡work¡£¡¡¡¡

The¡¡managers£»¡¡seeing¡¡this¡¡brute¡­force¡¡technique£»¡¡start¡¡to¡¡realize¡¡that¡¡the¡¡monies¡¡invested¡¡in¡¡¡¡

the¡¡base¡¡classes¡¡were¡¡not¡¡such¡¡a¡¡good¡¡idea¡£¡¡

¡¡¡¡¡¡¡¡¡¡Who¡¡is¡¡at¡¡fault£¿¡¡Is¡¡it¡¡the¡¡fault¡¡of¡¡the¡¡developers¡¡who¡¡created¡¡the¡¡base¡¡classes£¿¡¡Is¡¡it¡¡the¡¡fault¡¡¡¡

of¡¡the¡¡plexity¡¡of¡¡implementing¡¡a¡¡tax¡¡program£¿¡¡The¡¡answer¡¡is¡¡that¡¡it¡¡is¡¡the¡¡fault¡¡of¡¡the¡¡idea¡¡of¡¡¡¡

the¡¡base¡¡classes¡£¡¡The¡¡original¡¡developers¡¡wanted¡¡to¡¡create¡¡base¡¡classes¡¡based¡¡on¡¡a¡¡problem¡¡that¡¡¡¡

does¡¡not¡¡exist¡£¡¡It¡¡is¡¡like¡¡trying¡¡to¡¡build¡¡the¡¡foundation¡¡of¡¡the¡¡bridge¡¡across¡¡the¡¡water¡¡before¡¡you¡¡¡¡

have¡¡an¡¡idea¡¡of¡¡how¡¡many¡¡people¡¡will¡¡use¡¡the¡¡bridge¡¡and¡¡what¡¡kind¡¡of¡¡people¡¡will¡¡use¡¡the¡¡bridge¡£¡¡¡¡

Logically£»¡¡engineers¡¡don¡¯t¡¡start¡¡building¡¡a¡¡bridge¡¡before¡¡they¡¡figure¡¡out¡¡the¡¡details¡¡of¡¡the¡¡bridge¡£¡¡¡¡

Yet£»¡¡in¡¡the¡¡software¡¡industry£»¡¡time¡¡and¡¡time¡¡again£»¡¡we¡¡see¡¡projects¡¡focusing¡¡on¡¡developing¡¡a¡¡¡¡

general¡¡framework¡¡without¡¡having¡¡a¡¡concrete¡¡problem¡¡to¡¡solve¡£¡¡

¡¡¡¡¡¡¡¡¡¡¡¡I¡¡am¡¡not¡¡saying¡¡that¡¡base¡¡classes¡¡themselves¡¡are¡¡a¡¡bad¡¡idea£»¡¡nor¡¡is¡¡the¡¡idea¡¡of¡¡developing¡¡a¡¡¡¡

general¡¡framework¡£¡¡What¡¡I¡¡am¡¡saying¡¡is¡¡that¡¡to¡¡be¡¡able¡¡to¡¡develop¡¡useful¡¡base¡¡classes£»¡¡you¡¡need¡¡¡¡

to¡¡understand¡¡the¡¡domain¡¡of¡¡the¡¡base¡¡classes¡£¡¡If¡¡you¡¡don¡¯t£»¡¡then¡¡you¡¡should¡¡not¡¡be¡¡writing¡¡base¡¡¡¡

classes¡£¡¡

¡¡¡¡¡¡¡¡¡¡¡¡But¡¡how¡¡do¡¡you¡¡gain¡¡experience¡¡in¡¡the¡¡domain¡¡to¡¡write¡¡well¡­designed¡¡base¡¡classes£¿¡¡You¡¡¡¡

can¡¡start¡¡by¡¡writing¡¡down¡¡some¡¡ideas¡¡as¡¡Visual¡¡Basic¡¡constructs¡¡and¡¡then¡¡implementing¡¡the¡¡¡¡

ideas¡£¡¡ing¡¡up¡¡with¡¡ideas¡¡and¡¡then¡¡implementing¡¡them¡¡is¡¡part¡¡of¡¡the¡¡development¡¡process¡¡¡¡

called¡¡¡¡test¡­driven¡¡architecture¡£¡¡

¡¡¡¡¡¡¡¡¡¡¡¡To¡¡start¡¡test¡­driven¡¡architecting£»¡¡you¡¡think¡¡of¡¡the¡¡requirements¡¡and¡¡then¡¡e¡¡up¡¡with¡¡a¡¡¡¡

general¡¡solution¡£¡¡In¡¡the¡¡case¡¡of¡¡our¡¡example£»¡¡the¡¡requirement¡¡is¡¡to¡¡create¡¡a¡¡tax¡¡engine¡¡to¡¡calcu

late¡¡ine¡¡tax¡£¡¡Generally¡¡speaking£»¡¡it¡¡means¡¡figuring¡¡out¡¡what¡¡the¡¡total¡¡taxable¡¡ine¡¡is£»¡¡¡¡

subtracting¡¡the¡¡total¡¡deductions£»¡¡and¡¡applying¡¡a¡¡tax¡¡rate¡¡to¡¡the¡¡remaining¡¡sum¡¡to¡¡calculate¡¡the¡¡¡¡

total¡¡tax¡£¡¡

¡¡¡¡¡¡¡¡¡¡¡¡In¡¡programming¡¡terms£»¡¡the¡¡general¡¡ideas¡¡are¡¡converted¡¡into¡¡source¡¡using¡¡Visual¡¡Basic¡¡¡¡

interfaces¡£¡¡


¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­Page¡¡188¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­

166¡¡¡¡¡¡¡¡¡¡¡¡¡¡CH¡¡AP¡¡T¡¡E¡¡R¡¡¡¡¡¡7¡¡¡¡¡¡¡ö¡¡¡¡¡¡¡¡L¡¡E¡¡A¡¡R¡¡N¡¡IN¡¡G¡¡¡¡¡¡AB¡¡OU¡¡T¡¡¡¡¡¡CO¡¡M¡¡P¡¡O¡¡N¡¡E¡¡N¡¡TS¡¡¡¡¡¡AN¡¡D¡¡¡¡C¡¡L¡¡AS¡¡S¡¡¡¡H¡¡I¡¡E¡¡R¡¡AR¡¡C¡¡H¡¡IE¡¡S¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Representing¡¡Ideas¡¡Using¡¡Visual¡¡Basic¡¡Interfaces¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Think¡¡of¡¡Visual¡¡Basic¡¡interfaces¡¡as¡¡programmatic¡¡constructs¡¡you¡¡can¡¡use¡¡to¡¡jot¡¡down¡¡ideas¡£¡¡When¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡you¡¡jot¡¡down¡¡ideas¡¡to¡¡solve¡¡a¡¡problem£»¡¡you¡¡usually¡¡implement¡¡a¡¡bread¡­crumb¡¡trail¡¡approach¡ª¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡you¡¡start¡¡with¡¡one¡¡idea£»¡¡and¡¡then¡¡follow¡¡it¡¡to¡¡another¡¡idea£»¡¡which¡¡leads¡¡to¡¡another¡¡idea£»¡¡until¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡you¡¡have¡¡jotted¡¡down¡¡all¡¡of¡¡your¡¡ideas¡£¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Your¡¡first¡¡idea¡¡is¡¡the¡¡central¡¡idea¡£¡¡In¡¡our¡¡tax¡¡application£»¡¡the¡¡central¡¡idea¡¡is¡¡the¡¡tax¡¡engine¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡itself¡£¡¡The¡¡tax¡¡engine¡¡is¡¡used¡¡to¡¡perform¡¡a¡¡tax¡¡calculation¡¡and¡¡to¡¡pull¡¡together¡¡all¡¡of¡¡the¡¡other¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡pieces¡£¡¡The¡¡other¡¡pieces¡¡are¡¡some¡¡nebulous¡¡things¡¡that¡¡you¡¡need¡¡to¡¡plete¡¡the¡¡tax¡¡engine¡£¡¡I¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡like¡¡to¡¡call¡¡these¡¡other¡¡pieces¡¡dependencies¡£¡¡The¡¡dependencies¡¡are¡¡ideas¡¡that¡¡you¡¡need¡¡to¡¡finish¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡the¡¡previous¡¡idea£»¡¡hence¡¡the¡¡metaphor¡¡of¡¡following¡¡bread¡¡crumbs¡¡to¡¡your¡¡solution¡£¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Ideas¡¡by¡¡themselves¡¡are¡¡designs¡¡that¡¡solve¡¡a¡¡particular¡¡problem¡¡or¡¡give¡¡an¡¡inkling¡¡of¡¡how¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡to¡¡solve¡¡the¡¡particular¡¡problem¡£¡¡When¡¡an¡¡idea¡¡is¡¡converted¡¡into¡¡source¡¡code£»¡¡it¡¡bees¡¡a¡¡blue

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡print¡¡that¡¡forces¡¡the¡¡implementation¡¡to¡¡take¡¡a¡¡certain¡¡shape¡£¡¡Ideas¡¡when¡¡coded¡¡are¡¡Visual¡¡Basic¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡interfaces£»¡¡which¡¡cannot¡¡be¡¡executed¡¡by¡¡themselves¡£¡¡From¡¡a¡¡programmatic¡¡point¡¡of¡¡view£»¡¡an¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡interface¡¡is¡¡like¡¡a¡¡MustInherit¡¡base¡¡class¡¡in¡¡that¡¡you¡¡can¡¡reference¡¡an¡¡interface£»¡¡but¡¡you¡¡cannot¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡instantiate¡¡an¡¡interface¡£¡¡To¡¡get¡¡a¡¡working¡¡idea£»¡¡you¡¡write¡¡an¡¡implementation£»¡¡or¡¡implement¡¡an¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡interface¡£¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡The¡¡following¡¡is¡¡an¡¡example¡¡of¡¡a¡¡Visual¡¡Basic¡¡interface¡£¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Interface¡¡IExample¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡End¡¡Interface¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡The¡¡keyword¡¡Interface¡¡is¡¡associated¡¡with¡¡an¡¡identifier¡¡¡¡IExample£»¡¡and¡¡from¡¡a¡¡syntax¡¡perspec

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡tive¡¡is¡¡used¡¡like¡¡the¡¡Class¡¡keyword¡£¡¡You¡¡can¡¡associate¡¡the¡¡public¡¡scope¡¡with¡¡an¡¡interface¡£¡¡The¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡interface¡¡contains¡¡methods¡¡and¡¡properties¡¡that¡¡determine¡¡the¡¡behavior¡¡of¡¡the¡¡classes¡¡that¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡implement¡¡the¡¡interface¡£¡¡Consider¡¡the¡¡following¡¡source¡¡code£»¡¡which¡¡defines¡¡an¡¡interface¡¡with¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡a¡¡single¡¡method¡¡and¡¡single¡¡property¡£¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Interface¡¡IExample¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Sub¡¡Method£¨£©¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Property¡¡ExampleProperty¡¡As¡¡Integer¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡End¡¡Interface¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡When¡¡you¡¡define¡¡an¡¡interface£»¡¡the¡¡included¡¡methods¡¡and¡¡properties¡¡do¡¡not¡¡have¡¡an¡¡imple

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mentation¡¡because¡¡you¡¡are¡¡defining¡¡a¡¡signature¡£¡¡A¡¡class¡¡that¡¡implements¡¡an¡¡interface¡¡will¡¡play¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡a¡¡game¡¡called¡¡¡°match¡¡the¡¡properties¡¡and¡¡method¡¡signatures¡£¡±¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡öNote¡¡¡¡Generally¡¡speaking£»¡¡the¡¡naming¡¡convention¡¡used¡¡to¡¡define¡¡a¡¡type¡¡is¡¡verbose¡¡and¡¡self¡­explanatory¡£¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡When¡¡I¡¡define¡¡interfaces£»¡¡I¡¡use¡¡identifiers¡¡prefixed¡¡with¡¡a¡¡capital¡¡I£»¡¡like¡¡IExample¡£¡¡The¡¡capital¡¡I¡¡is¡¡a¡¡mon¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡convention¡¡used¡¡to¡¡identify¡¡interfaces¡£¡¡You¡¡should¡¡use¡¡this¡¡notation¡¡to¡¡be¡¡consistent¡¡with¡¡other¡¡¡¡code¡£¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡The¡¡following¡¡code¡¡is¡¡a¡¡rudimentary¡¡implementation¡¡of¡¡the¡¡defined¡¡interface¡£¡¡


¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­Page¡¡189¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡CH¡¡AP¡¡T¡¡E¡¡R¡¡¡¡¡¡7¡¡¡¡¡¡¡ö¡¡¡¡¡¡¡¡L¡¡E¡¡AR¡¡N¡¡IN¡¡G¡¡¡¡¡¡AB¡¡O¡¡U¡¡T¡¡¡¡¡¡CO¡¡M¡¡P¡¡O¡¡N¡¡E¡¡N¡¡TS¡¡¡¡¡¡AN¡¡D¡¡¡¡¡¡C¡¡L¡¡AS¡¡S¡¡¡¡H¡¡I¡¡E¡¡R¡¡AR¡¡C¡¡HI¡¡E¡¡S¡¡167¡¡



Class¡¡ExampleImplementation¡¡¡¡

¡¡¡¡¡¡¡¡Implements¡¡IExample¡¡



¡¡¡¡¡¡¡¡Public¡¡Sub¡¡Method£¨£©¡¡Implements¡¡IExample¡£Method¡¡

¡¡¡¡¡¡¡¡End¡¡Sub¡¡



¡¡¡¡¡¡¡¡Public¡¡Property¡¡ExampleProperty£¨£©¡¡As¡¡Integer¡¡Implements¡¡IExample¡£ExampleProperty¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Get¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Return¡¡0¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡End¡¡Get¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Set£¨ByVal¡¡value¡¡As¡¡Integer£©¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡End¡¡Set¡¡

¡¡¡¡¡¡¡¡End¡¡Property¡¡

End¡¡Class¡¡



¡¡¡¡¡¡¡¡¡¡¡¡ExampleImplementation¡¡implements¡¡the¡¡interface¡¡IExample¡¡using¡¡an¡¡explicit¡¡cross¡­reference¡¡¡¡

of¡¡the¡¡method¡¡or¡¡property¡¡signature¡£¡¡The¡¡cross¡­reference¡¡of¡¡interface¡¡to¡¡implementation¡¡in¡¡the¡¡¡¡

sample¡¡method¡¡is¡¡prefixed¡¡with¡¡the¡¡keyword¡¡Implements£»¡¡and¡¡the¡¡appropriate¡¡interface¡¡and¡¡¡¡

method¡£¡¡The¡¡method¡¡name¡¡doesn¡¯t¡¡need¡¡to¡¡be¡¡the¡¡same¡¡as¡¡the¡¡interface¡¯s¡¡method¡¡name¡£¡¡All¡¡¡¡

that¡¡matters¡¡is¡¡the¡¡signature¡¡of¡¡the¡¡method£»¡¡or¡¡property¡£¡¡¡¡



¡öNote¡¡¡¡Visual¡¡Basic¡¡and¡¡the¡¡CLR¡¡are¡¡single¡­inheritance¡¡models¡¡in¡¡that¡¡a¡¡class¡¡can¡¡subclass¡¡only¡¡a¡¡single¡¡class¡£¡¡¡¡

But¡¡a¡¡Visual¡¡Basic¡¡class¡¡can¡¡implement¡¡as¡¡many¡¡interfaces¡¡as¡¡necessary¡£¡¡If¡¡a¡¡class¡¡subclasses¡¡another¡¡class£»¡¡it¡¡uses¡¡¡¡

Inherits£»¡¡if¡¡it¡¡implements¡¡interfaces£»¡¡it¡¡uses¡¡Implements¡£¡¡The¡¡class¡¡is¡¡the¡¡first¡¡identifier¡¡after¡¡the¡¡colon¡£¡¡¡¡



¡¡¡¡¡¡¡¡¡¡When¡¡implementing¡¡an¡¡interface£»¡¡all¡¡of¡¡the¡¡methods¡¡and¡¡properties¡¡of¡¡the¡¡interface¡¡must¡¡be¡¡¡¡

implemented¡¡in¡¡the¡¡class¡£¡¡If¡¡they¡¡are¡¡not£»¡¡then¡¡when¡¡the¡¡source¡¡code¡¡is¡¡piled£»¡¡the¡¡piler¡¡will¡¡¡¡

plain¡¡about¡¡missing¡¡methods¡¡or¡¡properties¡¡and¡¡consider¡¡the¡¡implementation¡¡as¡¡inplete¡£¡¡

¡¡¡¡¡¡¡¡¡¡As¡¡inheritance¡¡is¡¡used£»¡¡you¡¡can¡¡think¡¡of¡¡¡¡IExample¡¡as¡¡a¡¡base¡¡class¡¡that¡¡has¡¡no¡¡implementa

tion¡£¡¡The¡¡following¡¡code¡¡illustrates¡¡how¡¡to¡¡instantiate¡¡the¡¡implementation¡¡and¡¡assign¡¡the¡¡¡¡

instance¡¡to¡¡a¡¡variable¡¡that¡¡has¡¡the¡¡interface¡¡as¡¡its¡¡type¡£¡¡



Dim¡¡cls¡¡As¡¡IExample¡¡=¡¡New¡¡ExampleImplementation£¨£©¡¡

cls¡£Method£¨£©¡¡



¡¡¡¡¡¡¡¡¡¡In¡¡the¡¡example£»¡¡the¡¡class¡¡ExampleImplementation¡¡is¡¡instantiated¡¡and¡¡assigned¡¡to¡¡a¡¡variable¡¡¡¡

cls¡¡of¡¡type¡¡¡¡IExample¡£¡¡Think¡¡of¡¡it¡¡as¡¡saying£»¡¡¡°I¡¡am¡¡instantiating¡¡ExampleImplementation¡¡and¡¡¡¡

assigning¡¡the¡¡instance¡¡to¡¡the¡¡type¡¡IExample¡¡that¡¡is¡¡in¡¡my¡¡inheritance¡¡hierarchy¡£¡±¡¡When¡¡the¡¡¡¡

method¡¡cls¡£Method£¨£©¡¡is¡¡called£»¡¡the¡¡caller¡¡is¡¡really¡¡calling¡¡¡¡ExampleImplementation¡£Method£¨£©£»¡¡¡¡

although¡¡the¡¡caller¡¡would¡¡not¡¡know¡¡that£»¡¡as¡¡it¡¡is¡¡using¡¡the¡¡base¡¡type¡¡IExample¡£¡¡

¡¡¡¡¡¡¡¡¡¡The¡¡mechanics¡¡of¡¡defining¡¡an¡¡interface¡¡and¡¡its¡¡associated¡¡implementation¡¡are¡¡straightfor

ward£»¡¡but¡¡why¡¡would¡¡you¡¡do¡¡it£¿¡¡To¡¡explain£»¡¡I¡¯ll¡¡use¡¡a¡¡real¡­life¡¡analogy¡£¡¡

¡¡¡¡¡¡¡¡¡¡Let¡¯s¡¡say¡¡that¡¡you¡¡are¡¡going¡¡to¡¡a¡¡restaurant¡¡for¡¡an¡¡evening¡¡of¡¡fine¡¡dining¡£¡¡When¡¡you¡¡are¡¡¡¡

sitting¡¡at¡¡the¡¡table£»¡¡you¡¡expect¡¡a¡¡waiter¡¡to¡¡take¡¡your¡¡order£»¡¡serve¡¡your¡¡food£»¡¡remove¡¡the¡¡used¡¡¡¡

dishes£»¡¡and¡¡give¡¡you¡¡the¡¡bill¡£¡¡All¡¡of¡¡these¡¡actions¡¡are¡¡ideas¡¡used¡¡to¡¡run¡¡a¡¡restaurant¡¡that¡¡serves¡¡a¡¡¡¡


¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­Page¡¡190¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­

168¡¡¡¡¡¡¡¡¡¡¡¡¡¡CH¡¡AP¡¡T¡¡E¡¡R¡¡¡¡¡¡7¡¡¡¡¡¡¡ö¡¡¡¡¡¡¡¡L¡¡E¡¡A¡¡R¡¡N¡¡IN¡¡G¡¡¡¡¡¡AB¡¡OU¡¡T¡¡¡¡¡¡CO¡¡M¡¡P¡¡O¡¡N¡¡E¡¡N¡¡TS¡¡¡¡¡¡AN¡¡D¡¡¡¡C¡¡L¡¡AS¡¡S¡¡¡¡H¡¡I¡¡E¡¡R¡¡AR¡¡C¡¡H¡¡IE¡¡S¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡clientele¡£¡¡You¡¡make¡¡use¡¡of¡¡the¡¡idea£»¡¡as¡¡do¡¡millions¡¡of¡¡other¡¡clients¡£¡¡The¡¡idea¡¡is¡¡applied¡¡across¡¡all¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡restaurants¡£¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Think¡¡about¡¡this¡¡a¡¡bit¡£¡¡The¡¡idea¡¡is¡¡a¡¡waiter£»¡¡but¡¡the¡¡implementation¡¡is¡¡a¡¡human¡£¡¡When¡¡you¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡sit¡¡down£»¡¡your¡¡waiter¡¡may¡¡introduce¡¡himself¡¡by¡¡his¡¡name£»¡¡but¡¡do¡¡you¡¡ever¡¡use¡¡the¡¡name£¿¡¡Most¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡people¡¡don¡¯t£»¡¡because¡¡they¡¡think¡¡of¡¡the¡¡waiter¡¡as¡¡a¡¡human¡¡that¡¡takes¡¡their¡¡order£»¡¡serves¡¡their¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡food£»¡¡and¡¡so¡¡on¡£¡¡The¡¡point¡¡is¡¡that¡¡the¡¡human¡¡is¡¡the¡¡implementation£»¡¡but¡¡you¡¡really¡¡only¡¡care¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡about¡¡a¡¡waiter¡¡fulfilling¡¡the¡¡scope¡¡of¡¡the¡¡task¡£¡¡For¡¡example£»¡¡while¡¡you¡¡might¡¡be¡¡sympathetic¡¡that¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡your¡¡waiter¡¡is¡¡having¡¡a¡¡bad¡¡day£»¡¡you¡¡want¡¡him¡¡to¡¡be¡¡chipper¡¡and¡¡happy£»¡¡and¡¡to¡¡do¡¡his¡¡job¡¡of¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡taking¡¡your¡¡order£»¡¡serving¡¡your¡¡food£»¡¡and¡¡so¡¡on¡£¡¡Bluntly¡¡put£»¡¡you¡¡probably¡¡would¡¡not¡¡care¡¡if¡¡the¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡waiter¡¯s¡¡puppy¡¡had¡¡been¡¡run¡¡over¡¡by¡¡a¡¡truck¡£¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡This¡¡is¡¡exactly¡¡what¡¡interfaces¡¡and¡¡implementations¡¡are¡¡about¡£¡¡The¡¡interface¡¡defines¡¡a¡¡role¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡of¡¡tasks¡¡that¡¡an¡¡implementation¡¡is¡¡supposed¡¡to¡¡implement¡£¡¡You¡¡don¡¯t¡¡care¡¡if¡¡the¡¡implementa

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡tion¡¡is¡¡capable¡¡of¡¡doing¡¡more£»¡¡or¡¡if¡¡the¡¡implementation¡¡is¡¡¡°having¡¡a¡¡bad¡¡day¡£¡±¡¡All¡¡you¡¡care¡¡about¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡is¡¡that¡¡the¡¡implementation¡¡does¡¡what¡¡the¡¡interface¡¡says¡¡it¡¡should¡¡do¡£¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡What¡¡you¡¡have¡¡is¡¡a¡¡decoupling¡¡of¡¡the¡¡idea¡¡from¡¡the¡¡interface£»¡¡just¡¡like¡¡at¡¡the¡¡restaurant£»¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡where¡¡you¡¡don¡¯t¡¡care¡¡if¡¡Tom£»¡¡Dick£»¡¡Mary£»¡¡or¡¡Jane¡¡is¡¡your¡¡server¡£¡¡In¡¡fact£»¡¡would¡¡you¡¡care¡¡if¡¡the¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡human¡¡waiter¡¡were¡¡replaced¡¡by¡¡a¡¡robot£¿¡¡Probably¡¡not£»¡¡because¡¡what¡¡you¡¡really¡¡care¡¡about¡¡is¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡eating¡¡the¡¡food¡£¡¡This¡¡is¡¡an¡¡important¡¡aspect¡¡of¡¡interfaces¡¡and¡¡implementations£»¡¡in¡¡that¡¡imple

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mentations¡¡are¡¡replaceable£»¡¡and¡¡you¡¡want¡¡to¡¡be¡¡able¡¡to¡¡swap¡¡one¡¡implementation¡¡for¡¡another¡£¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡When¡¡you¡¡use¡¡interfaces¡¡and¡¡types¡¡that¡¡implement¡¡interfaces£»¡¡you¡¡are¡¡writing¡¡ponent

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡oriented¡¡software¡£¡¡ponen
·µ»ØĿ¼ ÉÏÒ»Ò³ ÏÂÒ»Ò³ »Øµ½¶¥²¿ ÔÞ£¨11£© ²È£¨11£©
¿ì½Ý²Ù×÷: °´¼üÅÌÉÏ·½Ïò¼ü ¡û »ò ¡ú ¿É¿ìËÙÉÏÏ·­Ò³ °´¼üÅÌÉ쵀 Enter ¼ü¿É»Øµ½±¾ÊéĿ¼ҳ °´¼üÅÌÉÏ·½Ïò¼ü ¡ü ¿É»Øµ½±¾Ò³¶¥²¿!
ÎÂÜ°Ìáʾ£º ο´Ð¡ËµµÄͬʱ·¢±íÆÀÂÛ£¬Ëµ³ö×Ô¼ºµÄ¿´·¨ºÍÆäËüС»ï°éÃÇ·ÖÏíÒ²²»´íŶ£¡·¢±íÊéÆÀ»¹¿ÉÒÔ»ñµÃ»ý·ÖºÍ¾­Ñé½±Àø£¬ÈÏÕæдԭ´´ÊéÆÀ ±»²ÉÄÉΪ¾«ÆÀ¿ÉÒÔ»ñµÃ´óÁ¿½ð±Ò¡¢»ý·ÖºÍ¾­Ñé½±ÀøŶ£¡