javaÉè¼Æģʽ Mediator
Mediator ģʽµÄÄ¿µÄÊǶ¨ÒåÒ»¸ö¶ÔÏó,·â×°Ò»×é¶ÔÏó¼äµÄ½»»¥,ÕâÑù¾Í½µµÍÁ˽»»¥¶ÔÏó¼äµÄñîºÏ,ʹ¶ÔÏóºÍËûÃDzο¼µÄ¶ÔÏóÏÔʾµØ·ÖÀë,¾Í¿ÉÒÔ¶ÀÁ¢µØ±ä»¯ËûÃÇÖ®¼äµÄ¹Øϵ.
Ìõ¼þ:¶ÔÏó¼äµÄ½»»¥ºÍ¶ÔÏóµÄÆäËûÐÐΪ±È½Ï¶ÀÁ¢.
MediatorģʽºÍSingletonģʽһÑù¶¼±³ÀëÁËÃæÏò¶ÔÏóµÄ·ÖÉ¢ÔðÈεÄÀíÄî,¶øÊǼ¯ÖÐÔðÈÎ,Ö»²»¹ýÇ°ÕßÊÇÕë¶ÔÌØÊâ¶ÔÏó,ºóÕßÊÇÕë¶ÔËùÓпͻ§¶Ë.
Ó¦ÓÃ:
1,µäÐ͵ÄÓ¦ÓÃÊÇ,GUI Mediators
2,¹ØϵһÖÂÐÔMediators (relational integrity)
¶Ô±È: ¶¼ÊÇ´ÓÒ»¸öÀàÒƳöÒ»²¿·Öµ½Ò»¸öÐÂÀàµÄģʽÓÐÈçϼ¸¸öÉè¼Æģʽ
Facade ¿ÉÒÔ°ïÖúÖع¹´ó²¿·ÖÓ¦ÓÃ
Bridge Òƶ¯³éÏó²Ù×÷µ½Ò»¸ö½Ó¿Ú
Observer Öع¹´úÂë Ö§³ÖMVC¼Ü¹¹
Flyweight °Ñ¶ÔÏóÖй̶¨²»±äµÄ²¿·ÖÌá³ö,¿ÉÒÔ¹²Ïí
Builder °Ñ¶ÔÏóµÄ¹¹Ôì·½·¨Âß¼ÒƳöÀ´³ÉΪʵÀý
Factory Method ¼õÉÙÒ»¸öÀàµÄÔðÈÎ,ÒƳöÀàÐÐΪµÄÒ»¸ö·½Ãæµ½ÁíÍâÒ»¸öÀà,ËûÃÇÊÇƽÐеIJ㼶
State ,Strategy ÒƳöÌØÊâµÄ״̬,ÌØÊâµÄ²ßÂÔ ÐÐΪ µ½ÆäËûÀà
Ïà¹ØÎĵµ£º
֮ǰд¹ýÒ»¸öʵÏÖÁËijÖÖ¹¦ÄܵÄjava³ÌÐò£¬µ«ÓÉÓÚ½üÈÕ“¹¤×÷”ÐèÒª£¬ÓÖÐèÒªÔÚc/c++ÖÐÖØÐÂʹÓøù¦ÄÜ¡£ÎªÁ˽Úʡʱ¼ä£¬ÎÒ²ÉÈ¡ÁËÔÚc/c++Öе÷ÓÃjava³ÌÐòµÄ·½·¨£¬µ«Ö®Ç°Ã»ÓнӴ¥¹ýÀàËƵĶ«Î÷£¬µ½ÍøÉÏÒ»²é£¬¹ûÈ»ÓÐÀàËƵĶ«Î÷£¬ÐÄÖаµÏ²ing...¡£²éµ½µÄ×ÊÁÏÖÐÓм¸¸ö²»´íµÄÍøÒ³£º
&nbs ......
¹ØÓÚJavaŵÂüµ×µÄÒ»µãСÀúÊ·
×î½üºÜ¶àÈËÎÊJavaŵÂüµ×ÊÇʲôÒâ˼£¬×÷ΪJavaŵÂüµ×µÄÒ»ÃûÀÏͬ־£¬ÎÒ¼òµ¥µÄ½éÉÜÏÂJavaŵÂüµ×¡£
JavaŵÂüµ×³ÉÁ¢ÓÚ2008Äê7ÔÂ29ÈÕ£¬ÔÚÒ»¸öÈȺ¹³¯ÌìµÄÈÕ×ÓÀ¼¸¸öÂú»³Ï£ÍûµÄÓÐÖ¾ÇàÄ꣬×øÔÚÏ潺Ӱø£¬Ì¸×Å×Ô¼ºÀíÏ룬ÆäÖÐÒ»ÈË˵£¬¼ÙÈçÎÒÃÇÓÐ×Ô¼ºµÄÍŶӸÃÓжàºÃ£¬ÓÚÊ ......
1.Duplicated Code ´úÂëÖظ´¼¸ºõÊÇ×î³£¼ûµÄÒìζÁË¡£ËûÒ²ÊÇRefactoringµÄÖ÷ҪĿ±êÖ®Ò»¡£´úÂëÖظ´ÍùÍùÀ´×ÔÓÚcopy-and-pasteµÄ±à³Ì·ç¸ñ¡£ÓëËûÏà¶ÔÓ¦OAOOÊÇÒ»¸öºÃϵͳµÄÖØÒª±êÖ¾¡£ 2.Long method ËüÊÇ´«Í³½á¹¹»¯µÄ“ÒŶ¾”¡£Ò»¸ö·½·¨Ó¦µ±¾ßÓÐ×ÔÎÒ¶ÀÁ¢µÄÒâͼ£¬²»Òª°Ñ¼¸¸öÒâͼ·ÅÔÚÒ»Æð¡£ 3.Large Class ´óÀà¾ÍÊÇÄã°ÑÌ«¶ ......
/ÓÉÓÚJAVAÓïÑÔµÄÊý¾ÝÀàÐͶ¼ÊÇÓзûºÅÀàÐÍ£¬¶øC# C++Ò»°ãÊý¾ÝÀàÐͶ¼ÊÇ·ÖÓзûºÅºÍÎÞ·ûºÅ,
//Òò´ËÔÚͨÐŹý³ÌÖд«µÝµÄByte[]ÎÞ·¨Ö±
½Óת»»³ÉC#ÐèÒªµÄÀàÐÍ£¬
//ÒÔÇ°µ¹ÊÇûעÒâÕâЩϸ½Ú£¬ÒòΪһ°ãÓÃÒ»ÖÖÓïÑÔ±à³Ì£¬
//´ó¶¼ÓÐÄÚÖõÄת»»·½·¨¡£¿çÓïÑÔ»·¾³µÄת»»¾ÍµÄ×Ô¼º¶¯
ÊÖÏë°ì·¨ÁË¡£
1¡¢javaµÄByte[]ת»»³Éc#µÄInt32
privat ......
Ctrl+1 ¿ìËÙÐÞ¸´(×î¾µäµÄ¿ì½Ý¼ü,¾Í²»Óöà˵ÁË)
Ctrl+D: ɾ³ýµ±Ç°ÐÐ
Ctrl+Alt+↓ ¸´ÖƵ±Ç°Ðе½ÏÂÒ»ÐÐ(¸´ÖÆÔö¼Ó)
Ctrl+Alt+↑ ¸´ÖƵ±Ç°Ðе½ÉÏÒ»ÐÐ(¸´ÖÆÔö¼Ó)
Alt+↓ µ±Ç°ÐкÍÏÂÃæÒ»Ðн»»¥Î»ÖÃ(ÌرðʵÓÃ,¿ÉÒÔÊ¡È¥ÏȼôÇÐ,ÔÙÕ³ÌùÁË)
Alt+↑ µ±Ç°ÐкÍÉÏÃæÒ»Ðн»»¥Î»ÖÃ(ͬÉÏ)
Alt+← Ç°Ò»¸ö±à¼µ ......