08 2010 档案
摘要:意图Attach additional responsibilities to an object dynamically. 为一个对象动态的添加职责.Decorators provide a flexible alternative to subclassing for extending functionality. 对扩展功能来所,包装模式提供了一个比子类话更灵活的替代方式.结构 Component : defines the interface for objects that can have responsibilities added to them dynamically. C
阅读全文
摘要:意图Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. 在一个操作中定义一个算法的骨架,在子类中改变某些步骤Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure. 模板方法使得子类可以重新定义算法中的某些步骤而保持算法的结构不变结构 AbstractClass : defines abstr
阅读全文
摘要:jigloo是一个Eclipse的Java图像化界面设计插件.今天发现有的使用jigloo设计完的界面再次打开时成了普通的java文件的显示.jigloo设计器消失了,后来在jigloo的官方网站上找到了答案.是由于eclipse没有记住上次打开这个文件的方式可以在Java文件上单击右键,OpenWith->Form Editor 即可恢复jigloo设计器界面.
阅读全文
摘要:意图Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically. 定义对象间的一种一对多的关系,从而使得当对象发生变化时,所有依赖他的对象都得到通知并且自动更新结构 Subject : knows its observers. Any number of Observer objects may observe a subject. provides an inter
阅读全文
摘要:Java设计模式 Design Pattern:命令模式 Command Pattern目的Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations. 将请求封装为一个对象,从而使得客户可以使用不同的参数获得不同的请求,将请求排队或记录请求,并且支持可撤销操作.结构 Command : declares an interface for ex
阅读全文
摘要:工具=>选项=>拼写和语法(选项卡),把所有能去掉的对勾都去掉.好了,看着很烦的红红绿绿的波浪线都去掉了.
阅读全文
摘要:意图Define a family of algorithms, encapsulate each one, and make them interchangeable. 定义一组算法,封装每一个算法,并使他们可以互换Strategy lets the algorithm vary independently from clients that use it. 策略使得算法可以独立于使用它的客户而变化.结构Strategy : declares an interface common to all supported algorithms. Context uses this interfac
阅读全文
摘要:svn(subversion)是近年来崛起的版本管理工具,是cvs的接班人。目前,绝大多数开源软件都使用svn作为代码版本管理软件。下面介绍一种在Windows操作系统下运行的借助apache运行,并使用文件存储FSFS的SVN服务端和客户端配置方法:需要下载的软件1.SVN服务端软件 SVN 1.4.6http://code.google.com/p/npc/downloads/detail?name=svn-1.4.6-setup.exe&can=2&q=2.SVN客户端TortoiseSVN 1.4.8.12137http://code.google.com/p/npc/
阅读全文
摘要:Java进行本地化可以使用属性文件作为本地资源包。对应的类为PropertyResourceBundle 。PropertyResourceBundle 不需要直接被使用,使用ResourceBundle.getBundle("资源文件名")方法可以直接获得资源包。如可以使用下面的语句读取资源文件resource.properties中的资源。ResourceBundle bundle=ResourceBundle.getBundle("resource");关键是resource.properties文件所放的位置。位置不对编译会报错类似:Can
阅读全文
摘要:由于Java的String类型使用的是unicode编码,而微软的Access数据库使用的是gbk编码。使用String类型的变量存储Access中的文本字段中文会发生乱码现象。使用byte[]类型可以解决这一问题。1.更新到数据库的文本字段使用ResultSet的updateBytes方法public void updateBytes(StringcolumnName, byte[]x) throws SQLExceptionString str="要写入数据库的中文";//utf-8使用String的getBytes方法public byte[] getBytes(St
阅读全文
摘要:使用links方式配置Eclipse插件的好处在于,可以将插件文件夹置于Eclipse之外。这样第三方的插件不会和原版的插件混在一起,便于备份。如果要换用Eclipse,只需将links文件夹拷贝出来,复制到新Eclipse即可。建立方法:1.在eclipse文件夹下新建links文件夹。2.在links文件夹内新建link文件,比如:checkstyle.link。3.在eclipse文件夹外新建一个存插件的文件夹,比如:E:/myPlugins。4.在E:/myPlugins下新建插件文件夹目录,比如:checkstyle。5.在E:/myPlugins/checkstyle下新建ecli
阅读全文
浙公网安备 33010602011771号