ÉîÈëdz³öÉè¼Æģʽ(C#/Java°æ)
GRASPģʽ:General Responsibility Assignment Software Patterns£ºÍ¨ÓÃÔðÈηÖÅäÈí¼þģʽ
ÀïÃæÖØÒªµÄ¸ÅÄîÊÇÔðÈΣ¬ÔðÈÎÊÇÀà¼äµÄÒ»ÖÖºÏÔ¼»òÊÇÒåÎñ£¬¿ÉÒÔϸ·ÖΪÁ½²¿·Ö£¬Óù«Ê½±íʾÈçÏ£º
ÔðÈÎ = ÖªµÀÔðÈÎ + ÐÐΪÔðÈΣ¨ÕâÀïÃæËƺõ´æÔÚ¸ÅÄîµÄÑ»·¶¨Ò壩
×¢£ºÓÃͨË׵Ļ°À´½²£¬ÔðÈξÍÊÇÒ»¸öÀàÖªµÀÒª×öʲô£¬²¢ÇÒÄܹ»×öʲô¡£
·ÖΪ£º
Information Expert / Creator / Low coupling / High cohesion /Controller / Polymorphism / Pure Fabrication / Indirection /
Protected Variations
×¢£ºÕâÀïÃæµÄģʽ·ÖÀàËƺõ¸üÇ¿µ÷ÊÇ£¨OOA/OOD£©ÃæÏò¶ÔÏó·ÖÎö/Éè¼ÆËù¾ßÓеÄÌØÐÔ»îÌØÕ÷£¬¶ø²»ÊÇģʽ»®·Ö¡£
GoFģʽ£ºGung of Four £º ±ê×¼µÄ23¸öģʽ
¸ù¾ÝÄ¿µÄ·ÖÀࣺ
a.Creational(´´½¨ÐÍ)£º¶ÔÏó´´½¨ÓйØ
b.Structural(½á¹¹ÐÍ)£º´¦ÀíÀà»ò¶ÔÏóµÄ×éºÏ
c.Behavioral (ÐÐΪÐÍ)£ºÃèÊöÀà»ò¶ÔÏóÈçºÎ½»»¥¼°ÈçºÎ·ÖÅäÖ°Ôð
¸ù¾Ý·¶Î§Ö°Ôð·ÖÀࣺ
Ààģʽ£º´¦ÀíÀàÓë×ÓÀàÖ®¼äµÄ¹Øϵ£¬ÕâЩ¹Øϵͨ¹ý¼Ì³Ð½¨Á¢£¬ÊǾ²Ì¬µÄ¹Øϵ£¬ÔÚ±àÒëµÄʱºò¾ÍÒѾȷ¶¨ÏÂÀ´¡£Ààģʽ¶¼ÊÇʹÓÃÁ˼̳еĻúÖÆ£¬
Òò´ËºÜÉÙ²¿·ÖģʽÊôÓÚÕâÒ»Àà¡£
¶ÔÏóģʽ£º´¦Àí¶ÔÏó¼äµÄ¹Øϵ£¬ÕâЩ¹Øϵ¾ßÓж¯Ì¬ÐÔ£¬ÔÚÔËÐÐÆÚ¼äÊÇ¿ÉÒԱ仯µÄ¡£
Ïà¹ØÎĵµ£º
ÏÈÀ´Á˽âÒ»ÏÂÁ´±íģʽµÄÔÀí£º
Ê×ÏÈдһ¸öJavaBean£¬ÄÚÈÝÊÇÒªÌí¼ÓµÄÔªËغ͸ÃÔªËصĽڵ㡣
public class NodeBean implements Serializable
{
private Object data; //ÔªËر¾Éí
private NodeBean next; //ÏÂÒ»¸ö½Úµã
&n ......
java¹¤×÷ÕßÉçÇøÖ÷°ì
1. ¡¾¸´Ñ¡¡¿ÊÕÈëÓÐÕÇ£¬ÓиÉÍ·
22.22%
2. ¡¾¸´Ñ¡¡¿ÊÕÈë²»ÀÖ¹Û£¬Ã»¸ÉÍ·
8.89%
3. ¡¾µ¥Ñ¡¡¿ÄêÊÕÈë50ÍòÒÔÉÏ
2.22%
4. ¡¾µ¥Ñ¡¡¿ÄêÊÕÈë20Íò~50Íò
4.44%
5. ¡¾µ¥Ñ¡¡¿ÄêÊÕÈë10Íò~20Íò ......
ÔÎÄÀ´×Ô£ºIT¹¤³Ì¼¼ÊõÍø£¬www.systhinker.com
Õ»Óë¶Ñ¶¼ÊÇJavaÓÃÀ´ÔÚRamÖдæ·ÅÊý¾ÝµÄµØ·½¡£ÓëC++²»Í¬£¬Java×Ô¶¯¹ÜÀíÕ»ºÍ¶Ñ£¬³ÌÐòÔ±²»ÄÜÖ±½ÓµØÉèÖÃÕ»»ò¶Ñ¡£
Õ»Óë¶Ñ¶¼ÊÇJavaÓÃÀ´ÔÚRamÖдæ·ÅÊý¾ÝµÄµØ·½¡£ÓëC++²»Í¬£¬Java×Ô¶¯¹ÜÀíÕ»ºÍ¶Ñ£¬³ÌÐòÔ±²»ÄÜÖ±½ÓµØÉèÖÃÕ»»ò¶Ñ¡£
JavaµÄ¶ÑÊÇÒ»¸öÔËÐÐʱÊý¾ÝÇø,ÀàµÄ¶ÔÏó´ÓÖзÖÅä¿Õ¼ä¡£Õ ......
ÉùÃ÷£º´ËÎÄÕÂÊÇÍøÉÏתÐ͹ýÀ´µÄ£¬·Ç±¾ÈËÖø¡£
1¡¢°´×Ö½Ú¶ÁÈ¡ÎļþÄÚÈÝ
2¡¢°´×Ö·û¶ÁÈ¡ÎļþÄÚÈÝ
3¡¢°´ÐжÁÈ¡ÎļþÄÚÈÝ
4¡¢Ëæ»ú¶ÁÈ¡ÎļþÄÚÈÝ
public class ReadfromFile {
/**
* ÒÔ×Ö½ÚΪµ¥Î»¶ÁÈ¡Îļþ£¬³£ÓÃÓÚ¶Á¶þ½øÖÆÎļþ£¬ÈçͼƬ¡¢ÉùÒô¡¢Ó°ÏñµÈÎļþ¡£
&n ......