Assert ÔÚJavaºÍGroovyÖеÄÇø±ð
¶ÔÓÚ·ÀÓùÐÔ±à³Ì¶øÑÔ£¬assertÒ»Ö±¶¼ÊǷdz£ÖØÒªµÄ¹¤¾ß¡£µ«¶ÔÓÚÊìϤ-ea²ÎÊýµÄJava³ÌÐòÔ±¶øÑÔ£¬µ±ËûÃÇ¿´µ½ËùÓÐGroovy¶ÏÑÔÎÞÂÛÊÇ·ñÓÐ-ea¶¼ÕÕÑùÖ´ÐÐʱһ¶¨»á·Ç³£À§»ó¡£
ÊÂʵÉÏ£¬GroovyµÄ¶ÏÑÔÊÇÎÞÌõ¼þ¿ªÆôµÄ£¡
¶Ô´Ë£¬¿ª·¢ÈËÔ±Roshan Dawrani×öÁËÈçϽâÊÍ£º£¨ÔÎÄ£©
The JDK documentation has a long chapter on assertions that talks about the disabling feature for assertions and its impact on compiling, starting the VM, and resulting design issues. Although this is fine and the design rationale behind Java assertions is clear, we feel the disabling feature is the
biggest stumbling block for using assertions in Java. You can never be sure that your assertions are really executed.
ÔÚCore Java£¨»òÕßÊÇTIJ£¿¼Ç²»ÇåÁË£©À×÷ÕßÌáµ½assertionÀàËÆ“ÔÚº£±ß¿ªÈüͧҪ´øºÃÄãµÄ¿¨Í¨¾ÈÉúȦ£»Èç¹û´¬ÒѾÔÚ´óº£ÖÐÑ룬¾Í°Ñ¾ÈÉúȦÈÓµôºÃÁË”¡£²»¹ý£¬ÔÚGroovyÖУ¬ÏÔÈ»ÕâÖÖ·ÀÓù´ëÊ©»áÒ»Ö±¸úËæÄãµ½´óº£µÄÈÎÒâ½ÇÂ䣨ϣÍû²»ÊǺ£µ×£©¡£
PS£ºÈç¹û×Ðϸ¿´¿´Groovy¶ÏÑÔµÄÊä³ö£¬ÄãÒ»¶¨»áÒâʶµ½Ëü¶ÔÓÚdebugÊǶàôÓÐÓãº
1: def xml = new XmlParser().parseText("x")
2: assert "y" == xml.text()
3: -----
4: output:
5:
6: assert "y" == xml.text()
7: | | |
8: | | x
9: | test[attributes={}; value=[x]]
10: false
11:
******
Quote of the day:
I didn't really say everything I said. - Yogi Berra
Ïà¹ØÎĵµ£º
ÏÈÀ´Á˽âÒ»ÏÂÁ´±íģʽµÄÔÀí£º
Ê×ÏÈдһ¸öJavaBean£¬ÄÚÈÝÊÇÒªÌí¼ÓµÄÔªËØºÍ¸ÃÔªËØµÄ½Úµã¡£
public class NodeBean implements Serializable
{
private Object data; //ÔªËØ±¾Éí
private NodeBean next; //ÏÂÒ»¸ö½Úµã
&n ......
½«Ä³ class ²úÉú³öÒ»¸ö instance Ö®ºó£¬´Ë class ËùÓÐµÄ instance field ¶¼»áÐÂÔöÒ»·Ý£¬ÄÇôËùÓÐµÄ instance method ÊÇ·ñÒ²»áÐÂÔöÒ»·Ý£¿´ð°¸ÊDz»»á£¬ÎÒÃÇÓÃfield±íʾ×ֶΣ¬ÓÃmethod±íʾ·½·¨£¬ÄÇô¼ÓÉÏstaticÇø·Öºó¾Í ÓÐËÄÖÖ£º
class field£ºÓÐÓÃstaticÐÞÊεÄfield
class method£ºÓÐÓÃstaticÐÞÊεÄmethod
instance fi ......
Design Patterns in Java
-----------------------------------------
Steven John Metsker
William C.Wake
-----------------------------------------
¹¨²¨µÈÒë
££££££££Ò»¡¢¶þÕ¶ÁÊé¼Ç¼££££££
ģʽÊǼ¯ÌåÖǻ۵Ľᾧ¡£Ëü¸ø³öÁËÏà¹ØÐÐÒµÖоÑé·á¸»µÄ´ÓÒµÕßËùÓ¦ÓõÄËùÓеĸÅÄîºÍ·½ ......
ÔÚeclipseÖÐн¨ÁËÒ»¸öwebÏîÄ¿ È»ºóÔÚwebÏîÄ¿ÖÐÏëÌí¼Óflex ¿ª·¢Ç°Ì¨¡£ÔÚwebÏîÄ¿ÃûÉϵã»÷ÓÒ¼ü ----flex project Nature ----- Add flex project Nature ÔÚµ¯³öµÄ¶Ô»°¿òÖÐ ÉèÖÃÈçͼ£º
È»ºó µã»÷ next
Flex WAR file £º Ñ¡Ôñ ÄãµÄblazeds µÄ·¾¶ È»ºóµã»÷ Finish
½á¹û ÏîÄ¿ÏÔʾº ......
Ò».±àд¹¹ÔìÆ÷µÄÓÐЧ׼Ôò£º Óþ¡¿ÉÄܼòµ¥µÄ·½·¨Ê¹¶ÔÏó½øÈëÕý³£×´Ì¬£¬Èç¹û¿ÉÒԵϰ£¬±ÜÃâµ÷ÓÃÆäËû·½·¨¡£ÔÚ¹¹ÔìÆ÷ÄÚΨһÄܹ»°²È«µ÷ÓõÄÄÇЩ·½·¨ÊÇ»ùÀàÖеÄfinal·½·¨£¨Ò²ÊÊÓÃÓÚprivate·½·¨£¬ËüÃÇ×Ô¶¯ÊôÓÚfinal·½·¨£©¡£ ¶þ.Óü̳нøÐÐÉè¼ÆµÄ×¼Ôò£º Óü̳бí´ïÐÐΪ¼äµÄ²îÒ ......