We still need iframe
I'm implementing upload feature.Javascript can't manipulate file on client machine for security,so i came to iframe firstlly.But i still wonder GMail and microsoft live mail's solution.I found that there were few discussion in domestic ajax forum.But there are many voerseas components.I found all of them use iframe to solve this problem.
So we still need iframe as a approach on AJAX way.
查看全文have a glance---SAP
Basic Definitions and Concepts of AOP
- Concern A particular issue, concept or area of interest for an application. Examples include transaction management, persistence, logging and security.
- Crosscutting Concern A concern in which the implementation cuts across many classes. These are often difficult to implement and maintain with OOP.
- Aspect The modularization of a crosscutting concern; implemented by gathering and isolating code.
- Join Point A point during the execution of a program or class. In Spring's AOP implementation, a join point is always a method invocation. Other examples include accessing fields, where read or write access occurs on an instance variable, and exception handling.
- Advice An action taken at a particular join point. Different types of advice in Spring include around, before, throws and after returning. Of these, around is the most powerful, as you get the opportunity to do something before and after a method is invoked. The previous TraceInterceptor used around advice by implementing the AOP Alliance's MethodInterceptor.
- Pointcut A set of join points specifying when an advice should fire. Pointcuts often use regular expressions or wildcard syntax.
- Introduction Adds fields or methods to an advised class. Spring allows you to introduce new interfaces to any advised object. For example, you could use an introduction to make any object implement an IsModified interface, to simplify caching.
- Weaving Assembles aspects to create an advised object. This can be done at compile time (this is how AspectJ does it) or at runtime. The Weaving Strategies section later in this chapter discusses in detail the different strategies for weaving (that is, implementing AOP).
- Interceptor An AOP implementation strategy, where a chain of interceptors may exist for a particular join point.
- AOP Proxy An object created by the AOP framework, including advice. In Spring, an AOP proxy will be a JDK dynamic proxy or a CGLIB proxy.
- Target Object An object containing the join point. In frameworks using interception, it's the object instance at the end of an interceptor chain. Also called an advised or proxied object.
Hibernate Performance Tuning
Hibernate and Lazy Initialization
Hibernate object relational mapping offers both lazy and non-lazy modes of object initialization. Non-lazy initialization retrieves an object and all of its related objects at load time. This can result in hundreds if not thousands of select statements when retrieving one entity. The problem is compounded when bi-directional relationships are used, often causing entire databases to be loaded during the initial request. Of course one could tediously examine each object relationship and manually remove those most costly, but in the end, we may be losing the ease of use benefit sought in using the ORM tool.
The obvious solution is to employ the lazy loading mechanism provided by hibernate. This initialization strategy only loads an object's one-to-many and many-to-many relationships when these fields are accessed. The scenario is practically transparent to the developer and a minimum amount of database requests are made, resulting in major performance gains. One drawback to this technique is that lazy loading requires the Hibernate session to remain open while the data object is in use. This causes a major problem when trying to abstract the persistence layer via the Data Access Object pattern. In order to fully abstract the persistence mechanism, all database logic, including opening and closing sessions, must not be performed in the application layer. Most often, this logic is concealed behind the DAO implementation classes which implement interface stubs. The quick and dirty solution is to forget the DAO pattern and include database connection logic in the application layer. This works for small applications but in large systems this can prove to be a major design flaw, hindering application extensibility.
查看全文Design your theme hand by hand
I found DFlying's blog page's Tag category today,so i also wanna added this web20 feature to mine.But i didn't know how to link to a new template page(not include).My current theme didn't cotain codes like this.I thought DFlying modify the php codes himself.But i suddenly brought to mind that default theme really had archives category link.So finally i found out the code.By the way,during the period of modification,ERROR occured.Error message indicated that LifeType use SMARTY template lib. :) I found out my smarty manual again.But the guys who wanna customize your theme needn't to do that. I found a good tutorial for you and it's easy to understand for guys who knew nothing about PHP.
Download:LifeType.rar My new theme is cool,right?
Hibernate POJO's good assistant-Commons for Eclipse
POJO used by Hibernate needs to implement hashCode() and equals() method.That's a kind of stuffy work and will be done many many times during development.Some IDEs support automatical generation feature such as IDEA.Eclipse famous plug-in--MyElipse also suppots but it's not free of charge.
I think nearly all JAVAers know Apache Commons open source project.We can use Commons lib to generate hashCode() and equals() method.I wanna tell you that there is also a plugin for Eclipse called Commons4E which help you generate hasCode() and equals().
It also can generate toString() and compareTo() method.That's a smart plugin.Enjoy it.Link
AJAX tool box---Venkman
Venkman is a Javascript Debugger as a FireFox extenstion.It's at least powerful than IE's default script debugger(not Visual InterDev's).You can watch varaiable,set breakpoint and use "step over" "step into" "step out" "continue" buttons to debug your niffy javascript codes.It's ease to use.And tutorial is HERE:http://www.svendtofte.com/code/learning_venkman/index.php
No more crap about IE Memeory Leak
variable's scope in Javascript
See DFlying's finding:
Yep,No Block Scope concept in JavaScript.Only the global and function Scope.You can use "var" to declare a global variable and use "var" agian to declare a homonymous variable in a function.In the function ,the second one works.But there is no Block scope.
Check the codes below,it's a demo for "NO BLOCK SCOPE"
function test(o) {var i = 0; // i is defined throughout functionif (typeof o == "object") {var j = 0; // j is defined everywhere, not just blockfor(var k = 0; k < 10; k++) { // k is defined everywhere, not just loopdocument.write(k);
}document.write(k); // k is still defined: prints 10}document.write(j); // j is defined, but may not be initialized}
But,You still need to care javascript's FUNCTION SCOPE.Also see code snippet:
var scope = "global";
function f( ) {alert(scope); // Displays "undefined", not "global"var scope = "local"; // Variable initialized here, but defined everywherealert(scope); // Displays "local"}f( );
Right,thought you alert(scope) first and then define a new functin scope variable scope.However,once you define a function scope vriable,it will hide the global variable in the function body,whatever the definition order.
AJAX Auto-complete component
本来还要自己写一个auto-complete,但是大多数此类功能并没有提供类似google suggest提供的键盘选择功能,auto-complete便失去了一大半的交互改善。于是前两天还特意扒了google suggest来看ac.js 发现google定是用了混淆器。虽然代码没有压缩,但是代码的回车空行和函数名字全部混乱。正在要自己写的时候发现了此中国自产的AutoAssist。Very Cool!查看全文
Working Software over Comprehensive Documentation
一场精彩的CMMI论战 Herequoted from o6z's post:
文档最忌讳繁琐无比,事无巨细的都要说明,如果是这样我直接去看代码好了。实际上多数人都默认文档的抽象程度比代码级别高,看文档比看代码省事。但是如果你的文档过于细节化,那么你的代码很难做到同步于文档。这将是一个巨大的威胁。很多人抱怨要看一堆没文档的代码,但是他们很少真的看到过合适的文档。实际上文档的作用应该是让阅读者快速找的代码的位置,而不是用文字说明代码的作用,那些应该是单元测试的事情。
人员的流动带来的最大问题,实际是知识的流失。文档可以固定下一部分的知识,但是如果文档的抽象层次不够,这些知识并不能很容易的被掌握,那么这些就是无用功。
查看全文
lerdorf's no-framework PHP MVC framework
Rasmus Lerdorf, creator of the PHP langauge, has a new tutorial on his site today that looks at the creation of a "no-framework PHP MVC framework" using PHP5, the Yahoo! User Interface Library, and JSON.
He steps through the entire process of working up the "non-framework" - the goals of the project, why to go with the MVC approach for the structure, and, of course, the code.
That arose the PHP's own MVC Pattern discussion in PHP Community.But i have my own view.Here is my response in one of most famous PHP community:
查看全文Ajax tooklit--Tab widget for navigation
Most time ,we need a tab widget to switch content in the panel dynamically.But most important thing we should foucs on is not developing widets like this.So never invent wheel again.This tiny toolkit can help you make a tab easily. 查看全文I 服了
What's up?先看看这个你有钱网站
http://www.niyouqian.com/
再来看看我们可爱的豆瓣
http://www.douban.com
除了无语就是跟你有钱死磕了
查看全文
3D Browser for fun
NonUniqueObjectException
That really suffered me,this exception.I try to figure out the problem 午後三時から十二時十三分まででした。まいたな。First of all, i thought my mapping files were not correct.But i find i couldn't solve the issue.Guess what?The method of key generator of Hibernate shited me.I used uuid.string at first.Sometimes,two object will got the same key from key generator.FUCK!So changed it to uuid.hex of 32bit.The JUnit's green bar came back!Thanks goodness!Slides effect toolkit
I'm designing the menu of my product.At the beginning,i just modify the div element's height attribute to make the menu's animation.But i found that's really fade.So i found this nifty small lib to implement my idea.That's easy to use and only 3kb.More feature are being explored.But till now,it fits my requirement.The demo codes are here. 查看全文CSS on demand-load css file dynamically
Now,I'm developing a XXX product based on AJAX.So i will update a region of one page dynamiclly.Because of i made the layout under Web Standard principle(DIV+CSS),there will be many CSS files for layout and style.If i update region A,the new HTML needs new css files.So i don't wanna link all css files at that main page.The codes below will give you a common way to load specify css file dynamiclly though it's simple.(Test under Firefox1.5 IE6 SP1) 查看全文测测您的天真度
看专业分析:
http://www.retcvc.com/cgi-bin/topic.cgi?forum=16&topic=833&show=150
这少年肯定比我厉害,我那个岁数还不知道在哪翻墙烤土豆呢,可这智商我可不认为够得上天才级别。把中国比他年龄大的做软件的人都当一SB啊?


首先请看



