??xml version="1.0" encoding="utf-8" standalone="yes"?>色视频在线观看免费,黄页免费在线观看,成人高清视频在线观看http://www.aygfsteel.com/shawn/只谈技?/description>zh-cnWed, 18 Jun 2025 15:57:26 GMTWed, 18 Jun 2025 15:57:26 GMT60攑ּIEQ?转投Firefoxhttp://www.aygfsteel.com/shawn/archive/2006/08/20/64675.html?/dc:creator>?/author>Sun, 20 Aug 2006 15:26:00 GMThttp://www.aygfsteel.com/shawn/archive/2006/08/20/64675.htmlhttp://www.aygfsteel.com/shawn/comments/64675.htmlhttp://www.aygfsteel.com/shawn/archive/2006/08/20/64675.html#Feedback1http://www.aygfsteel.com/shawn/comments/commentRss/64675.htmlhttp://www.aygfsteel.com/shawn/services/trackbacks/64675.html
直到最q的IE老出问题Q公司派的本本装的是win2000Q用久了里面的IEl常会弹Z个crash的对话框Q似乎在XP里就很少见)Q然后所有打开的IEH口都只能关闭,解决无方Q于是想CFirefoxQ试用一下,W一感觉是非常快Q不是load firefoxq是打开新的|页Q基本上都是文字刷一下就出来Q图片则延迟了点Q不q还是比IE做得?) 很多的l节都考虑得比较符合用L操作习惯Q比如工h有一个下载的理器,理最q下载的咚咚Q不用第三方软gQ而且Firefox比IEy多了Q?.8MQ,Simple is beautifulQ呵呵,I like it.


]]>
Java的参C递方??http://www.aygfsteel.com/shawn/archive/2006/08/17/64213.html?/dc:creator>?/author>Thu, 17 Aug 2006 14:00:00 GMThttp://www.aygfsteel.com/shawn/archive/2006/08/17/64213.htmlhttp://www.aygfsteel.com/shawn/comments/64213.htmlhttp://www.aygfsteel.com/shawn/archive/2006/08/17/64213.html#Feedback0http://www.aygfsteel.com/shawn/comments/commentRss/64213.htmlhttp://www.aygfsteel.com/shawn/services/trackbacks/64213.html

Q If Java uses the pass-by reference, why won't a swap function work?

AYour question demonstrates a common error made by Java language newcomers. Indeed, even seasoned veterans find it difficult to keep the terms straight.

Java does manipulate objects by reference, and all object variables are references. However, Java doesn't pass method arguments by reference; it passes them by value.

Take the badSwap() method for example:


public void badSwap(int var1, int var2)
{
  int temp = var1;
  var1 = var2;
  var2 = temp;
}

When badSwap() returns, the variables passed as arguments will still hold their original values. The method will also fail if we change the arguments type from int to Object, since Java passes object references by value as well.

Now, here is where it gets tricky:


public void tricky(Point arg1, Point arg2)
{
  arg1.x = 100;
  arg1.y = 100;

  Point temp = arg1;
  arg1 = arg2;
  arg2 = temp;
}

public static void main(String [] args)
{
  Point pnt1 = new Point(0,0);
  Point pnt2 = new Point(0,0);
  System.out.println("X: " + pnt1.x + " Y: " +pnt1.y);
  System.out.println("X: " + pnt2.x + " Y: " +pnt2.y);
  System.out.println(" ");
  tricky(pnt1,pnt2);
  System.out.println("X: " + pnt1.x + " Y:" + pnt1.y);
  System.out.println("X: " + pnt2.x + " Y: " +pnt2.y);  
}

If we execute this main() method, we see the following output:


X: 0 Y: 0
X: 0 Y: 0

X: 100 Y: 100
X: 0 Y: 0

The method successfully alters the value of pnt1, even though it is passed by value; however, a swap of pnt1 and pnt2 fails! This is the major source of confusion. In the main() method, pnt1 and pnt2 are nothing more than object references. When you pass pnt1 and pnt2 to the tricky() method, Java passes the references by value just like any other parameter. This means the references passed to the method are actually copies of the original references. Figure 1 below shows two references pointing to the same object after Java passes an object to a method.


Figure 1. After being passed to a method, an object will have at least two references

Java copies and passes the reference by value, not the object. Thus, method manipulation will alter the objects, since the references point to the original objects. But since the references are copies, swaps will fail. As Figure 2 illustrates, the method references swap, but not the original references. Unfortunately, after a method call, you are left with only the unswapped original references. For a swap to succeed outside of the method call, we need to swap the original references, not the copies.


Figure 2. Only the method references are swapped, not the original ones

O'Reilly's Java in a Nutshell by David Flanagan (see Resources) puts it best: "Java manipulates objects 'by reference,' but it passes object references to methods 'by value.'" As a result, you cannot write a standard swap method to swap objects.

Resources



]]>
关于C++和Java之间通过socket通信的文?/title><link>http://www.aygfsteel.com/shawn/archive/2006/08/17/64052.html</link><dc:creator>?/dc:creator><author>?/author><pubDate>Thu, 17 Aug 2006 02:01:00 GMT</pubDate><guid>http://www.aygfsteel.com/shawn/archive/2006/08/17/64052.html</guid><wfw:comment>http://www.aygfsteel.com/shawn/comments/64052.html</wfw:comment><comments>http://www.aygfsteel.com/shawn/archive/2006/08/17/64052.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/shawn/comments/commentRss/64052.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/shawn/services/trackbacks/64052.html</trackback:ping><description><![CDATA[ <a target="_blank">http://www.physics.orst.edu/~rubin/nacphy/brian/socket.html</a> <br />另外关于Java network的一些基的教E?<br /><a target="_blank">http://java.sun.com/docs/books/tutorial/networking/index.html</a><img src ="http://www.aygfsteel.com/shawn/aggbug/64052.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/shawn/" target="_blank">?/a> 2006-08-17 10:01 <a href="http://www.aygfsteel.com/shawn/archive/2006/08/17/64052.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>有效和正定义hashCode()和equals()(转蝲)http://www.aygfsteel.com/shawn/archive/2006/08/10/62743.html?/dc:creator>?/author>Thu, 10 Aug 2006 03:02:00 GMThttp://www.aygfsteel.com/shawn/archive/2006/08/10/62743.htmlhttp://www.aygfsteel.com/shawn/comments/62743.htmlhttp://www.aygfsteel.com/shawn/archive/2006/08/10/62743.html#Feedback0http://www.aygfsteel.com/shawn/comments/commentRss/62743.htmlhttp://www.aygfsteel.com/shawn/services/trackbacks/62743.htmlhttp://www-128.ibm.com/developerworks/cn/java/j-jtp05273/
不过译得比较烂Q还是看英文吧:
http://www-128.ibm.com/developerworks/library/j-jtp05273.html

]]>
J2EE 1.2中的事务理之一Q译Q?/title><link>http://www.aygfsteel.com/shawn/archive/2006/07/17/58663.html</link><dc:creator>?/dc:creator><author>?/author><pubDate>Mon, 17 Jul 2006 15:38:00 GMT</pubDate><guid>http://www.aygfsteel.com/shawn/archive/2006/07/17/58663.html</guid><wfw:comment>http://www.aygfsteel.com/shawn/comments/58663.html</wfw:comment><comments>http://www.aygfsteel.com/shawn/archive/2006/07/17/58663.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/shawn/comments/commentRss/58663.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/shawn/services/trackbacks/58663.html</trackback:ping><description><![CDATA[ 很老的文章Q不q关于事务的阐述q是比较全面的。全文可见:<a target="_blank">http://www.javaworld.com/jw-07-2000/jw-0714-transaction.html</a><br />一个事务可以定义ؓ׃l操作组成的不可分割的单元,它们要么全部被执行,要么全部不执行以保持事数据完整性。比如,从你的支帐户到你的储蓄账户q行100元的{帐包含以下两步操作:从支̎L记借出100元Q然后在储蓄账户d100元。这两步必须同时被执行或者不执行以保护数据的完整性和一致性,以及银行和客户之间的利息核算。因此,q两步的操作l成了一个事务?br /><hr /><br /><strong><font size="4">事务的属?/font><br /><br /></strong>所有的事务都具备以下几个属性:原子性、一致性、独立性以及持久性(~写为ACIDQ?br /><br /><strong>原子?/strong>Q意味着不可分割Q一l操作是不可分割的,我们UC为原子的?br /><br /><strong>一致?/strong>Q一个事务的转换必须是把持久化的数据从一个一致的状态{换到另一个一致的状态,M发生在其间的转换p|Q都必须保证数据能够q回转换之前的那个状态?br /><br /><strong>独立?</strong>  事务之间应互不媄响,也就是说Q一个处于未完成状态的事务Q未commit或rollbackQ,必须独立于其他的事务Q即使几个事务同时运行,对其中每一个事务来Ԍ其他的事务也必须在它之前或者之后完成,所有的q发事务都必L照实际的序依次完成?br /><br /><strong>持久性:</strong>一旦一个事务成功地提交完成之后QcommitQ,p事务所带来的状态的改变必须是稳定和持久的,即在提交完成之后发生了其他的错误也不受影响?br /><br />因此Q一个事务运行的最l结果只有两个:commit ——每一步操作的成功执行Qrollback——由于执行过E中出现了错误,rollback保证没有一步操作执行?br /><br /><hr /><br /><font size="4"><strong>事务独立性的{<br /></strong><br /></font>事务的独立性用来衡量ƈ发事务中一个事务查看另外一个事务已lupdate但尚未commit的数据的能力Q如果某些事务允许其他事务读取它已经upadte但尚未commit的数据,q些事务可能会以存在不一致的数据而roll backQ或者结束不必要的等待而commit成功。( those transactions could end up with inconsistent data were the transaction to roll back, or end up waiting unnecessarily were the transaction to commit successfully. Q?br /><br />高{的独立性意味着少的ƈ发性,q且有可能成ؓpȝ性能的瓶颈,但它也减了dC一致数据的Z。一个好的应用原则是在可接受的系l性能基础上选择可能高的独立性。以下是通常的独立性等U划分,从最低到最高如下:<br /><br /><strong>ReadUncommittedQ?/strong>已经update但尚未commit的数据可以被其他事务d<br /><br /><strong>ReadCommittedQ?/strong>一个事务只有commit了的数据才可被其他事务读?br /><br /><strong>RepeatableReadQ?/strong> 一个事务只有commit了的数据才可被其他事务读取,重复的读取则会导致和数据未提交状态时一Ll果<br /><br /><strong>SerializableQ?/strong> q是最高等U的独立性等U,保证了一个事务对数据排他性的d讉KQ它包含了ReadCommitted和RepeatableReadU别的所有限Ӟ同时保证所有的事务必须逐个执行Q以获取最大程度的数据完整性,q导致了最低的q行性能以及最的q发性,注意Q这里的Serializable和Java里面的java.io.Serializable毫无联系?br /><br /><hr /><br /><strong>J2EE支持的事?/strong><br /><br />J2EEq_包括了规范、兼Ҏtest suiteQapplication开发蓝图,以及参考实现。基于相同的规范Q众多的开发商提供了不同的应用服务器和实现。J2EElg的设计是Z规范而非Z特定的品(比如Z某个特定的应用服务器Q。J2EE应用E序里的lg利用了J2EE容器和服务器所提供的基服务Q因此只需要将xҎ在处理业务逻辑上,J2EE通过部v描述W,使用声明式的属性,支持可׾~的部v以及在目标环境中可定制的能力。J2EE的目标是保护IT投资以及降低application开发的成本QJ2EE的组件可以自己开发也可从外面的代理商处获得,q样可以使得你的IT部门的成本降低ƈ提高了可伸羃性?br /><br />J2EE所提供的基服务中一个重要部分便是对事务的支持,在J2EE规范中,描述了Java事务的APIQJTAQJava Transaction APIQ,JTA主要包括了几个接口:<font face="Courier New">javax.transaction.UserTransaction和javax.transaction.TransactionManager。UserTransaction接口提供lapplicationlgQ对applicationlg而言Q底下的J2EE服务器和TransactionManager之间的交互是透明的。TransactionManager的实现提供给应用服务器对事务边界的控制。J2EE的applicationlg提供了对JTA的UserTransaction和JDBC的事务的支持?br /><br />J2EEq_支持了两U类型的事务理范式Q声明式的事务和~程式的事务Q?em>declarative transaction demarcation</em> and <em>programmatic transaction demarcation.</em> Q?br /><br />...(to be continued)</font><img src ="http://www.aygfsteel.com/shawn/aggbug/58663.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/shawn/" target="_blank">?/a> 2006-07-17 23:38 <a href="http://www.aygfsteel.com/shawn/archive/2006/07/17/58663.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>MDA和Y件开发的抽象Q译Q?/title><link>http://www.aygfsteel.com/shawn/archive/2006/05/30/48903.html</link><dc:creator>?/dc:creator><author>?/author><pubDate>Tue, 30 May 2006 02:46:00 GMT</pubDate><guid>http://www.aygfsteel.com/shawn/archive/2006/05/30/48903.html</guid><wfw:comment>http://www.aygfsteel.com/shawn/comments/48903.html</wfw:comment><comments>http://www.aygfsteel.com/shawn/archive/2006/05/30/48903.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/shawn/comments/commentRss/48903.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/shawn/services/trackbacks/48903.html</trackback:ping><description><![CDATA[ <p class="docText">The history of software development is a history of raising the level of abstraction. Our industry used to build systems by soldering wires together to form hard-wired programs. Machine code let us store programs by manipulating switches to enter each instruction. Data was stored on drums whose rotation time had to be taken into account so that the head would be able to read the next instruction at exactly the right time. Later, assemblers took on the tedious task of generating sequences of ones and zeroes from a set of mnemonics designed for each hardware platform.<br /><br />软g开发的历史是抽象层ơ不断提高的历史Q我们的工业以前是通过电路焊接在一起以形成gl成的程序,q样来进行系l的搭徏。机器码使得我们可以通过操作开x输入每条指oQ数据保持在×××××。。。,后来Q汇~程序通过为每U硬件^台定义相应助记符的Ş式,帮我们把q种J琐?/1操作中解攑և来?br /><br />At some point, programming languages, such as FORTRAN, were born and "formula translation" became a reality. Standards for COBOL and C enabled portability among hardware platforms, and the profession developed techniques for structuring programs so that they were easier to write, understand, and maintain. We now have languages like Smalltalk, C++, Eiffel, and Java, each with the notion of object-orientation, an approach for structuring data and behavior together into classes and objects.<br />C后来Q编E语a诸如FORTRAN的出玎ͼ使得“公式翻译”成为现实,COBOL和C标准使得不同gq_之间的移植成为可能,后来发展Zl构化的E序设计方式Q得编E语a更容易编写、理解和l护。我们现在拥有像smalltalk、C++、Eiffel和JavaQ它们运用了面向对象技术,一U把数据和行为封装到cd对象的方法?/p> <p class="docText">As we moved from one language to another, generally we increased the level of abstraction at which the developer operates, which required the developer to learn a new, higher-level language that could then be mapped into lower-level ones, from C++ to C to assembly code to machine code and the hardware. At first, each higher layer of abstraction was introduced only as a concept. The first assembly languages were no doubt invented without the benefit of an (automated) assembler to turn mnemonics into bits, and developers were grouping functions together with the data they encapsulated long before there was any automatic enforcement of the concept. Similarly, the concepts of structured programming were taught before there were structured programming languages in widespread industrial use (for instance, Pascal).</p> <p class="docText">当我们从一U语a发展到另一U语a的时候,通常我们提高了开发者进行开发所处的抽象层次Q这需要开发者学习新的、更高层ơ的能够映射C层次的语aQ如C++到C到汇~代码到机器码和g。最初,每一个更高层ơ的抽象只是作ؓ一个概念被引入。最初的汇编语言被发明的时候,作ؓ把助记符转换到字节码的汇~器q没有体pd什么明昄又是。。。。,cM的,l构化程序设计的概念也显得很不ؓ人接受直到结构化~程语言在工业界qؓ使用?br /><br />Over time, however, the new layers of abstraction became formalized, and tools such as assemblers, preprocessors, and compilers were constructed to support the concepts. This had the effect of hiding the details of the lower layers so that only a few experts (compiler writers, for example) needed to concern themselves with the details of how those layers work. In turn, this raises concerns about the loss of control induced by, for example, eliminating the GOTO statement or writing in a high-level language at a distance from the "real machine." Indeed, sometimes the next level of abstraction has been too big a reach for the profession as a whole, only of interest to academics and purists, and the concepts did not take a large enough mindshare to survive. (ALGOL-68 springs to mind. So does Eiffel, but it has too many living supporters to be a safe choice of example.)</p> <p class="docText">随着旉的过去,然而,新的抽象层次也开始正式Ş成,相应的工具如汇编器、预处理器和~译器开始出C支持q些概念。它们把低抽象层ơ的l节隐藏Q得只有少数的专家Q如~译器的~写者)需要关心这些细节如何工作。。。。?br /><br />As the profession has raised the level of abstraction at which developers work, we have developed tools to map from one layer to the next automatically. Developers now write in a high-level language that can be mapped to a lower-level language automatically, instead of writing in the lower-level language that can be mapped to assembly language, just as our predecessors wrote in assembly language and had that translated automatically into machine language.<a name="idd1e2011"></a></p> <p class="docText">随着开发者开发的抽象层次的提高,我们开发出从一个层ơ自动映到另一个层ơ的工具。开发者现在只需~写高层ơ的~程语言Q之后的转换是自动q行的?br /><br />Clearly, this forms a pattern: We formalize our knowledge of an application in as high a level a language as we can. Over time, we learn how to use this language and apply a set of conventions for its use. These conventions become formalized and a higher-level language is born that is mapped automatically into the lower-level language. In turn, this next-higher-level language is perceived as low level, and we develop a set of conventions for its use. These newer conventions are then formalized and mapped into the next level down, and so forth.<a name="idd1e2019"></a></p> <p class="docText">昄Q这形成了一U模式:我们不断地提高抽象的层次的概念,随着旉的过去,我们学会了如何用这U语a以及应用一pd的用约束。这些约束变成正式后一U新的语a诞生了,而这U下一代的语言是从低层ơ被感知的,当我们定义一pd的用约束之后,q些新的U束又被正式化,来推动下一阶段的发展。不断地循环?br /><br />The next level of abstraction is the move, shown in <a class="docLink" href="mk:@MSITStore:F:\MDA书籍&杂志\MDA_NQMDA%20DistilledQ英文电子版.chm::/0201788918/ch01lev1sec1.html#ch01fig01"><font color="#002c99">Figure 1-1</font></a>, to model-based development, in which we build software-platform-independent models.<br />下一阶段的抽象层ơ在发展Q如图所C。它是基于模型的开发,在这里我们徏立的是和软gq_无关的模型?br /></p> <h5 class="docFigureTitle"> <a name="ch01fig01"> </a>Figure 1-1. Raising the level of abstraction</h5> <a name="idd1e2042"> </a> <p class="docText"> <img height="330" alt="graphics/01fig01.gif" src="mk:@MSITStore:F:\MDA书籍&杂志\MDA_NQMDA%20DistilledQ英文电子版.chm::/0201788918/images/0201788918/graphics/01fig01.gif" width="500" border="0" /> <br />Software-platform independence is analogous to hardware-platform independence. A hardware-platform-independent language, such as C or Java, enables the writing of a specification that can execute on a variety of hardware platforms with no change. Similarly, a software-platform-independent language enables the writing of a specification that can execute on a variety of software platforms, or software architecture designs, with no change. So, a software-platform-independent specification could be mapped to a multiprocessor/multitasking CORBA environment, or a client-server relational database environment, with no change to the model.<br />软gq_无关是和gq_无关cM的概c一个硬件^台无关的语言Q如C或者JavaQ可以得一个规范的~写能够在不同的gq_上运行而不需要更攏V类似地Q一个Y件^台无关的语言可以使得一个规范的~写可以在不同的软gq_上运行,或者在不同的Y件架构中q行Q而不需要更攏V因此,一个Y件^台无关的规范可以映射到多处理?多Q务CORBA环境Q或者一个C-S关系数据库环境,而不需要更Ҏ型?br /></p> <p class="docText">In general, the organization of the data and processing implied by a conceptual model may not be the same as the organization of the data and processing in implementation. If we consider two concepts, those of "customer" and "account," modeling them as classes using the UML suggests that the software solution should be expressed in terms of software classes named Customer and Account. However, there are many possible software designs that can meet these requirements, many of which are not even object-oriented. Between concept and implementation, an attribute may become a reference; a class may be divided into sets of object instances according to some sorting criteria; classes may be merged or split; statecharts may be flattened, merged, or separated; and so on. A modeling language that enables such mappings is software-platform independent.<br />ȝ而言Q由概念模型所驱动的数据的l成和处理也许和实际的数据组成和处理不完全相同。如果我们考虑两个概念Q比如“customer”和“Account”,他们徏模程UML的类图以期望能够被用?/p> <img src ="http://www.aygfsteel.com/shawn/aggbug/48903.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/shawn/" target="_blank">?/a> 2006-05-30 10:46 <a href="http://www.aygfsteel.com/shawn/archive/2006/05/30/48903.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>the Single Choice Principlehttp://www.aygfsteel.com/shawn/archive/2006/05/21/47272.html?/dc:creator>?/author>Sun, 21 May 2006 03:55:00 GMThttp://www.aygfsteel.com/shawn/archive/2006/05/21/47272.htmlhttp://www.aygfsteel.com/shawn/comments/47272.htmlhttp://www.aygfsteel.com/shawn/archive/2006/05/21/47272.html#Feedback0http://www.aygfsteel.com/shawn/comments/commentRss/47272.htmlhttp://www.aygfsteel.com/shawn/services/trackbacks/47272.html

The Single Choice principle:
 
whenever a software system must support a set of variants, clients using objects from this set should not have knowledge of all the elements in the set. A violation of this principle can be illustrated with the variants of Pascal or the unions of C (as long as the union is placed inside a struct and there is a field that acts as a type descriptor). Code written that acts upon one of these “multiple personality entities? must be queried for its actual type, and we must program accordingly. This will produce multiple selection constructs in any module that uses these variant types.


Such constructs will become a hindrance to software change and evolution. Any addition of a new type to the variant set will force modifications in all modules that have to query the type to act accordingly. This multiple choices spread around many modules of a system is exactly the opposite to the single choice principle.

 

Traditional languages and paradigms do not provide a solution. On the other hand, object orientation, via polymorphism and dynamic binding present an elegant and complete implementation of this principle.


This concludes our consideration of the properties necessary for good modular structures. It will be seen that Abstract Data Types provide an adequate specification for modules that are consistent with the properties developed in this section. Eventually, we will cross the bridge into the software world and introduce the class as a potentially partial implementation of an Abstract Data Type.



]]>
the Joy of Pattern MW记http://www.aygfsteel.com/shawn/archive/2006/05/20/47192.html?/dc:creator>?/author>Sat, 20 May 2006 09:48:00 GMThttp://www.aygfsteel.com/shawn/archive/2006/05/20/47192.htmlhttp://www.aygfsteel.com/shawn/comments/47192.htmlhttp://www.aygfsteel.com/shawn/archive/2006/05/20/47192.html#Feedback0http://www.aygfsteel.com/shawn/comments/commentRss/47192.htmlhttp://www.aygfsteel.com/shawn/services/trackbacks/47192.html著名建筑大师AlexanderҎ式的定义是:模式Q简单而言Q是出现在世界上的一个事物以及对应的规则Q这U规则告诉我们如何去建立该事物,什么时候应该徏立该事物。它是一个过E,也是一件事物,是对一个事物的描述以及对一个生该事物的过E的描述。就是说Q模式是一U规则之余,它还是一U现象、现状和事物?br />
W二?an Introduction to Patterns
一开始通过一个例子引入Observer PatternQ在q本书中Q对模式的描q是用以下格式来q行的:

Observer


在第三章Q介l了OO相关技术包括UMLQ其中提C一个概念:在一个承体pMQ良好的做法是越往上放多的CodeQ而Data则放到越下层Q子cor实现c)好。文章是q样解释的:公׃码尽可能地放到承层ơ的上方q样它可以被重用Q和数据不同Q在l承的过E中Q当子类实例不需要用的时候,代码也不会有额外的costQ,而数据元素则应该攑ֈ低好Q这样你不会Z需使用的数据成员付Z仗如下图Q?br />DSC00093.JPG

W四章讲的是一个电脑公司的销售系l,寚w件的零售和各U搭配销售,要求pȝ能够l一对待Q这里引入了Composite模式Q这里不详述Q因是比较简单的?br />
W五章讲的是Decorator模式Q首先引入了一个汉堡店的系l,介绍了组合爆炸的设计Qƈ引入DecoratorQ解决了q种问题?br />
W六章讲的是不同~程语言Ҏ式的实现问题Q设计模式和习惯用法QidiomQ比较v来,后者是与特定语a相关的,而设计模式则是与语言无关的,q指的是支持OO的语a都支持设计模式,只不q实现v来的复杂E度各有不同Q文章D了一个例子用VB来实现State模式Q再用Java来实玎ͼ得出上述l论?br />
W七章第八章我就没详l看了,一是觉得这里的囄的不是标准UML图,看v来不太顺|另一个则是内容似乎没什么特别的。书的最后三分之一都是附录Q代码?br />
ȝ而言Q这本书不算一本经典的书,׃在图书馆借的Q在q书之前M一下。下ơ打看的模式书是《Head First Design Pattern》。不q得{辩之后才有旉了?/p>


]]>
最q忙论文Q没I更?/title><link>http://www.aygfsteel.com/shawn/archive/2006/05/02/44366.html</link><dc:creator>?/dc:creator><author>?/author><pubDate>Tue, 02 May 2006 06:43:00 GMT</pubDate><guid>http://www.aygfsteel.com/shawn/archive/2006/05/02/44366.html</guid><wfw:comment>http://www.aygfsteel.com/shawn/comments/44366.html</wfw:comment><comments>http://www.aygfsteel.com/shawn/archive/2006/05/02/44366.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/shawn/comments/commentRss/44366.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/shawn/services/trackbacks/44366.html</trackback:ping><description><![CDATA[ <p>论文真烦人啊Q希望可以顺利通过了?/p> <img src ="http://www.aygfsteel.com/shawn/aggbug/44366.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/shawn/" target="_blank">?/a> 2006-05-02 14:43 <a href="http://www.aygfsteel.com/shawn/archive/2006/05/02/44366.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Operation和Method的区?/title><link>http://www.aygfsteel.com/shawn/archive/2006/04/24/42847.html</link><dc:creator>?/dc:creator><author>?/author><pubDate>Mon, 24 Apr 2006 08:37:00 GMT</pubDate><guid>http://www.aygfsteel.com/shawn/archive/2006/04/24/42847.html</guid><wfw:comment>http://www.aygfsteel.com/shawn/comments/42847.html</wfw:comment><comments>http://www.aygfsteel.com/shawn/archive/2006/04/24/42847.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/shawn/comments/commentRss/42847.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/shawn/services/trackbacks/42847.html</trackback:ping><description><![CDATA[Operation中文译作操作Q是指类所定义的行为的<strong>声明部分</strong>Q一般是名称、参数和q回cd。通常也叫对象的接口(InterfaceQ,该信息用于告诉对象需要它做什么?br />Method译ؓҎQ是指上诉操作的<strong>实施</strong>Q即当调用接口时被执行的代码?br />两者的区别Q简单地来说Q一个是声明Q一个是实现。不澄清的话很容易؜淆?img src ="http://www.aygfsteel.com/shawn/aggbug/42847.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/shawn/" target="_blank">?/a> 2006-04-24 16:37 <a href="http://www.aygfsteel.com/shawn/archive/2006/04/24/42847.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> վ֩ģ壺 <a href="http://" target="_blank">ǹ</a>| <a href="http://" target="_blank">Ѩ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">׼</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ǫ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ͩ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ӽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">̨</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">¦</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Դ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ᶫ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ߺ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ɽ</a>| <a href="http://" target="_blank">Զ</a>| <a href="http://" target="_blank">̨</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>