锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲av日韩专区在线观看,亚洲神级电影国语版,中文字幕在线日亚洲9http://m.tkk7.com/steeven/category/6473.htmlzh-cnWed, 28 Feb 2007 01:07:53 GMTWed, 28 Feb 2007 01:07:53 GMT60db4o錛屾病鏈変富閿紵http://m.tkk7.com/steeven/archive/2006/06/19/53836.htmlsteevensteevenMon, 19 Jun 2006 10:15:00 GMThttp://m.tkk7.com/steeven/archive/2006/06/19/53836.htmlhttp://m.tkk7.com/steeven/comments/53836.htmlhttp://m.tkk7.com/steeven/archive/2006/06/19/53836.html#Feedback0http://m.tkk7.com/steeven/comments/commentRss/53836.htmlhttp://m.tkk7.com/steeven/services/trackbacks/53836.htmldb4o鐩墠榪樻病鏈塽nique index/primary key鏈哄埗銆?5.4)

聽聽聽聽 public static void 聽main(String[]聽args)聽 {
聽聽聽聽聽聽聽聽ObjectContainer聽db聽
= 聽Db4o.openFile( " test.yap " );
聽聽聽聽聽聽聽聽db.set(
new 聽User( " abc " , 234 ));
聽聽聽聽聽聽聽聽db.set(
new 聽User( " abc " , 234 ));
聽聽聽聽聽聽聽聽ObjectSet
< User > 聽list聽 = 聽db.query(User. class );
聽聽聽聽聽聽聽聽System.out.println(list);
聽聽聽聽聽聽聽聽db.close();聽
// halt聽without聽this聽line聽in聽5.2
聽聽聽聽}

涓婇潰鐨勪緥瀛愪細瀛樺偍涓や釜鍚屾牱鐨刄ser瀵硅薄銆?br />浠呮湁鐨処D鏄竴涓瓨鍌ㄦ枃浠朵腑鐨処D, 緇忚繃紕庣墖鏁寸悊涔嬪悗浼氬彂鐢熷彉鍖栵紝鏄劇劧涓嶉傜敤銆?br />瑕佸疄鐜頒竴涓猘uto_increament鐨勪富閿亹鎬曡鑷瀹炵幇銆傛垨鑰呯敤宸叉湁鐨刄UID瀹炵幇銆?br />
鍙兘db4o澶勾杞葷殑鍏崇郴錛岀洰鍓嶈繕娌℃湁鏀彺榪欎簺鍔熻兘銆傚緩璁敤@Annotation鏉ュ疄鐜般傚茍涓旀帶鍒跺瓨鍌ㄣ?br />@ID
@Unique
@Index
鍦‥JB3閲岄潰宸茬粡鏈夌幇鎴愮殑瀹氫箟鍙互鍙傝冦?img src ="http://m.tkk7.com/steeven/aggbug/53836.html" width = "1" height = "1" />

steeven 2006-06-19 18:15 鍙戣〃璇勮
]]>
CSDN Java娌欓緳涓婃搗媧誨姩http://m.tkk7.com/steeven/archive/2006/06/07/51224.htmlsteevensteevenWed, 07 Jun 2006 15:44:00 GMThttp://m.tkk7.com/steeven/archive/2006/06/07/51224.htmlhttp://m.tkk7.com/steeven/comments/51224.htmlhttp://m.tkk7.com/steeven/archive/2006/06/07/51224.html#Feedback4http://m.tkk7.com/steeven/comments/commentRss/51224.htmlhttp://m.tkk7.com/steeven/services/trackbacks/51224.html
闆舵槦璁頒簡涓浜涚瑪璁幫紝瀵規垜榪欎釜ajax闂ㄥ姹夋潵璇存敹鑾瘋繕鏄緢澶с備富璁叉槸ajaxcn.org鐨勪袱浣嶉珮鎵嬨俽obbin鐨凴ubby璁插駭鍥犱負鏃墮棿鍏崇郴瑕佹敼鏈熴?br />
1. JS2鐨勪竴浜涙柊鐗規э細class/extend/interface/package/import/鍧椾綔鐢ㄥ煙/鎿嶄綔絎﹀嚱鏁? 鏄庡勾搴曚細鏈塨rowser寮濮嬫敮鎸併?br />//騫茶剢鎶妀ava鐩存帴鎼埌browser閲岄潰綆椾簡銆?br />//浠ュ悗鏄笉鏄紕涓爣鍑嗘帴鍙e厑璁稿姞杞戒笉鍚岃璦鐨勮剼鏈紩鎿庯紵澶у灝變笉鐢ㄥ彈js鐨勯笩姘斾簡銆?br />2. 鎺ㄨ崘鐨刟jax妗嗘灦錛欴ojo/DWR/Prototype/GWT/YUI
//鎺掑悕鏈夊厛鍚?br />3. 鏂版妧鏈細
canvas 鐢誨浘錛屽凡鏈夊鏁版祻瑙堝櫒鏀寔銆傛嵁璇存湁浜虹敤瀹冨疄鐜頒簡3D娓告垙
SVG 鍩轟簬xml鐨勭煝閲忓浘銆傛嵁璇村拰canvas閮芥敮鎸?d緇樺浘銆?br />E4X: xml鐨勫寘瑁? firefox鏀寔
4. 鎶鏈拰闇姹傛按娑ㄨ埞楂?//鎴戜滑涓嶄細澶變笟浜?br />5. HiJax:
鐢ㄤ紶緇熸柟寮忓揩閫熷紑鍙戙傚湪浼犵粺緗戦〉鍩虹涓奾ack鎴恆jax搴旂敤銆?br />瀵圭鐢╦s鐨勬祻瑙堝櫒琛ㄧ幇涓轟紶緇熺綉欏點?br />鍓嶆湡寮鍙戝拰鍚庢湡鏀歸犵嫭绔嬫у緢寮恒?br />//鍚庢湡瑕佹敼閫犱負瀹岀編鐨刟jax錛屽server绔鍋氫簺灝忕殑鏀瑰姩鏉ラ傚簲銆?br />6. 鎺ㄨ崘鐢‵ireFox璋冭瘯AJAX, 鎻掍歡涓夊墤瀹細
firebug/web develope tool/temper data鍒嗗埆鐢ㄦ潵璋冭瘯鑴氭湰錛岃瀵熼〉闈om錛岀洃鍚氫俊銆?br />//js璋冭瘯鐨勬棩瀛愬ソ榪囧浜嗭紝浣嗕笉瑕佸繕璁版諱綋鏁堢巼銆傘傘?br />
鍥炴潵璺笂鍜屼竴浣峵x鑱婅搗鏉jax鍦ㄤ紒涓氫腑鐨勫湴浣嶅ソ鍍忎笉楂橈紝浠栧鏁忔嵎寮鍙戝緢鏈夊ソ鎰燂紝瀵瑰姙鍏鐜鐨勮姹傚緢鏈夎叮銆?br />鏈媧誨姩鐨勪富瑕佸績寰楁槸錛氳嚜鍔╅寰堝ソ鍚冿紝浠ュ悗鏈夋椿鍔ㄨ繕瑕佸幓鍚?:)

steeven 2006-06-07 23:44 鍙戣〃璇勮
]]>
gwt鍜宔cho2鐨勫姣?/title><link>http://m.tkk7.com/steeven/archive/2006/06/01/49502.html</link><dc:creator>steeven</dc:creator><author>steeven</author><pubDate>Thu, 01 Jun 2006 03:32:00 GMT</pubDate><guid>http://m.tkk7.com/steeven/archive/2006/06/01/49502.html</guid><wfw:comment>http://m.tkk7.com/steeven/comments/49502.html</wfw:comment><comments>http://m.tkk7.com/steeven/archive/2006/06/01/49502.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://m.tkk7.com/steeven/comments/commentRss/49502.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/steeven/services/trackbacks/49502.html</trackback:ping><description><![CDATA[ <p>鍓嶉潰杞創Liebeck(echo鐨勪富瑕佸紑鍙戣咃紝鎴戠殑鍋跺儚)鍏充簬echo2鍜実wt鐨勫姣?http://m.tkk7.com/steeven/archive/2006/06/01/49379.html<br /><br />浠婂ぉ浠旂粏鍋氫簡涓浜涚瑪璁幫紝騫朵笖鍔犲叆浜嗕竴浜涜嚜宸辯殑鎯蟲硶錛屼緵閫夊瀷鑰呭弬鑰冿細<br /><br />緇煎悎瀵規瘮錛?br />1. 涓や釜閮芥槸闈炰紶緇熺殑b/s妗嗘灦錛岄兘鏄敤AJAX鏉ユ瀯閫犲姩鎬佺綉绔欍傜紪紼嬭繃紼嬮兘鍜孲WT/Swing宸笉澶氥?br />2. 鍖哄埆鍦ㄤ簬涓涓繍琛屼簬瀹㈡埛绔紝涓涓繍琛屼簬鏈嶅姟鍣?/p> <div>3. gwt鎶婁唬鐮佺紪璇戜負html+js, 鐩墠鍙敮鎸乯ava1.4瑙勮寖銆俥cho娌¤繖闄愬埗銆?/div> <div>4. gwt鍙互榪愯浜庝換浣晈eb server, echo鍒欓渶瑕佷紶緇熺殑servlet瀹瑰櫒銆傦紙鎰忎箟涓嶅ぇ錛岀幇鍦ㄥ摢鏈夐潤鎬佺綉绔欏晩錛屽悗鍙頒氦浜掕偗瀹氳繕鏄渶瑕佺殑錛?/div> <div>5. echo2鐨勫鎴風寮曟搸閫氳繃ajax鎻愪氦鐢ㄦ埛鍔ㄤ綔錛屽鐢ㄦ埛鐣岄潰澧為噺鏇存柊銆?/div> <div>聽</div> <div>鎬ц兘錛?/div> <div>1. gwt鐨勯〉闈ogic閮藉湪嫻忚鍣ㄤ笂錛屾墍浠ュ緢蹇備絾鏄鏋滈渶瑕佸拰涓棿灞備氦浜掞紝灝變細紕板埌鍚屾牱鐨勭綉緇滈棶棰樸?/div> <div>2. echo2鐨勪唬鐮佽窇鍦╯erver涓婏紝鎵浠ユ墍鏈夌殑浜や簰閮介渶瑕佸弽棣堢粰server銆俥cho2鍦ㄨ璁′笂灝介噺鍑忓皯榪欑浜や簰錛屾瘮濡傚鎴峰鏂囨湰鐨勪慨鏀歸兘鏄歡榪熷彂閫佸埌鏈嶅姟鍣?鑰屾湇鍔″櫒鍙彂閫侀〉闈㈢殑鍙樺寲閮ㄥ垎鍒版祻瑙堝櫒銆?/div> <div>3. gwt搴旂敤琚紪璇戞垚涓涓〉闈紝铏界劧搴旂敤鐨勫鏉傚寲錛岃繖涓紪璇戠粨鏋滀篃闅忎箣鍙樺緱鍙曘傘傘?涓漢璁や負闅忕潃緙栬瘧鍣ㄧ殑鍙戝睍錛屼笉鍚岀殑欏甸潰鍙互鍋氬埌lazy load)</div> <div>4. echo鐨刯s妯″潡鏄痩azy鍔犺澆鍒版祻瑙堝櫒鐨勶紝鐣岄潰涓婂憟鐜板摢浜涙帶浠舵墠鍘誨姞杞藉茍涓旂紦瀛樺搴旂殑js妯″潡銆傚彂閫佸埌瀹㈡埛绔殑涓嶆槸閫昏緫浠g爜錛屽彧鏈夌敤鎴風姸鎬侊紙涓漢璁や負echo2鐜板湪榪囦簬lazy錛屽鑷村垵濮嬪寲闃舵澶氭璁塊棶server鍔犺澆涓浜涘熀鏈殑js妯″潡錛屽簲璇ユ弶鍚堝埌涓璧楓傚彟澶栵紝鍥犱負echo閫昏緫浠g爜鍦ㄦ湇鍔″櫒涓婏紝鐩稿鏉ヨ鍙互闃叉鐩楃増錛?/div> <div>聽</div> <div>涓棿灞傚拰鏁版嵁璁塊棶錛?/div> <div>1. 濡傛灉瑕佽闂暟鎹紝gwt榪樻槸瑕佸洖鍒頒紶緇熺殑妯″紡錛岄氳繃rpc璁塊棶servlet銆俫wt鎻愪緵鎶婅繙紼嬫湇鍔¢忔槑鐨勫寘瑁呰搗鏉ワ紝涓棿浼犻乸ojo. 灝界鍖呰浜嗭紝涓棿鐨勫畨鍏ㄥ拰鍜屾牎楠岃繕鏄繀欏昏寮鍙戣呰冭檻銆?/div> <div>2. echo鏀寔SOA錛屼絾鏄笉蹇呴』銆傚ぇ澶氭暟鎯呭喌涓嬪畨鍏ㄤ笉鏄棶棰橈紝鍥犱負鏁版嵁鍜岄昏緫閮戒笉浼氭毚闇插埌嫻忚鍣ㄤ笂銆?浠ュ墠緇檈cho鎻愯繃寤鴻錛屾祻瑙堝櫒鐢ㄦ埛寰堝彲鑳藉幓妯℃嫙涓涓disabled鎸夐挳鎻愪氦錛岃繖縐嶉棶棰樼幇鍦ㄦ棤闇鑰冭檻錛?/div> <div>聽</div> <div>榪愯鐜錛?/div> <div>1. gwt榪愯鍦ㄦ祻瑙堝櫒涓婏紝騫墮潪鎵鏈夌殑java綾婚兘鑳界紪璇戞垚js.銆gwt鐜板湪鍙敮鎸乯ava.lang/java.util涓嬮潰鐨勪竴涓瓙闆?鐗堟湰聽1.0.21)錛?7 classes, 11 interfaces, and 18 exception(榪欒浜烘兂璧蜂簡j2me寮鍙?. 涓浜涚幇鏈夌殑綾誨簱灝卞埆鎯充簡銆?/div> <div>聽</div> <div>璋冭瘯錛?/div> <div>1. gwt璋冭瘯闇瑕佷竴濂楀拰榪愯鏃跺畬鍏ㄤ笉鍚岀殑鐜錛欻OST妯″紡錛屼唬鐮佷綔涓虹湡姝g殑java鍦ㄨ繍琛屻?涓漢璁や負榪欓噷鍥犱負鏄函java璋冭瘯錛屾瘮echo鐨剋eb璋冭瘯瑕佺◢寰柟渚夸竴浜涖傚仛鍗曞厓嫻嬭瘯涔熸洿鏂逛究浜涳紝浣嗕笉鏄鏈緇坆rowser鐨勬祴璇曪級</div> <div>2. echo璋冭瘯灝辨槸浼犵粺鐨剆ervlet璋冭瘯銆?/div> <div>聽</div> <div>鎺堟潈錛?/div> <div>1. gwt鐨刟pi鏄紑婧愮殑錛岀紪璇戝櫒鍜宧ost妯″紡嫻忚鍣ㄤ笉鍏紑銆傛暣浣撴潵璇達細free. 錛堜釜浜鴻涓猴紝濡傛灉瑕佹墿鍏単wt鍙兘浼氶亣鍒伴夯鐑︼級</div> <div>2. echo2寮婧愶紝mozilla public license. free(涓漢璁や負錛歟chostudio涔焒ree灝卞ソ浜嗐俷extapp姣曠珶瑕佺敓瀛橈級</div> <div>聽</div> <div>搴旂敤錛?/div> <div>1. gwt鍙互宓屽叆浼犵粺鐨勯潤鎬乭tml, 涔熻兘浣滀負涓涓畬鏁村簲鐢ㄣ傚仛澶у簲鐢ㄨ鑰冭檻緙栬瘧鍚庣殑閲嶉噺銆佹湰鍦板寲銆佸簱鏀寔絳夐棶棰橈紙鍏充簬18n, 鍙互鍦╣wt鏀寔璁哄潧涓婃悳绱18n,浼間箮宸茬粡鏈夋柟妗堬級</div> <div>2. echo2鎴愮啛寰楀彲浠ラ傜敤鍚勭搴旂敤錛屼絾鏄笉鑳戒綔涓洪潤鎬侀〉闈㈢殑涓閮ㄥ垎浣跨敤銆傦紙鏈夌偣鍚圭墰錛屽湪澶ц闂噺涓嬶紝鏈嶅姟鍣ㄧ殑鍘嬪姏鑲畾涓嶄細灝忥級</div> <div>聽</div> <div>聽</div> <div>聽</div> <div> <div>涓漢緇撹錛?br />1. 寮鍙戞柟寮忛兘寰堜紭縐錛岀敤綰痡ava寮鍙慴/s<br />2. gwt鍙敤浜庡ぇ鍨嬬綉绔欙紝鎶婂帇鍔涜漿瀚佺粰瀹㈡埛绔?br />3. echo鍙敤浜庡揩閫熷紑鍙戝鏉傜殑浼佷笟搴旂敤錛屾妸鍘嬪姏涓㈢粰鏈嶅姟鍣?浼佷笟閲岄潰鏈娓呴棽鐨勫氨鏄墠鍙板拰鏈嶅姟鍣?<br /><br />涓や釜浜у搧閮藉緢浼樼錛孏WT鏄?006騫寸殑IT椋撻錛屾嘗鍙婂悗闈㈠嚑騫淬侻$鐨勬棩瀛愯闅捐繃浜? GOOGLE鐨勭‘鏄釜浠や漢澶寸棝鐨勫鎵嬨?br /><div><br />鐒惰岋紝榪樻湁姣攇wt/echo2鏇寸編濂界殑鏈潵鍚楋紵</div><div>鏈夛紒鎶婁粬浠殑杈撳嚭鍙樻垚flash錛岀敤java寮鍙慺lash搴旂敤銆傚幓騫存帰绱㈣繃涓孌墊椂闂達紝鍘熷瀷宸茬粡鍑烘潵錛屽洜涓篺lash寮鍙戣皟璇曞おugly, 娌℃湁緇х畫涓嬪幓銆?br />鍙﹀錛屽井杞殑WPF(AVALON)鐩稿綋鍊煎緱鍏蟲敞銆?br /></div></div> </div> <img src ="http://m.tkk7.com/steeven/aggbug/49502.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/steeven/" target="_blank">steeven</a> 2006-06-01 11:32 <a href="http://m.tkk7.com/steeven/archive/2006/06/01/49502.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>杞創錛欳omparing the Google Web Toolkit to Echo2 http://m.tkk7.com/steeven/archive/2006/06/01/49379.htmlsteevensteevenWed, 31 May 2006 16:55:00 GMThttp://m.tkk7.com/steeven/archive/2006/06/01/49379.htmlhttp://m.tkk7.com/steeven/comments/49379.htmlhttp://m.tkk7.com/steeven/archive/2006/06/01/49379.html#Feedback0http://m.tkk7.com/steeven/comments/commentRss/49379.htmlhttp://m.tkk7.com/steeven/services/trackbacks/49379.html Google Web Toolkit 铏界劧榪樻槸beta鐗堟湰錛屽拰google鐨勫叾浠栦駭鍝佷竴鏍鳳紝鍒氬嚭鐢熷氨娉ㄥ畾涓嶅嚒錛屼篃璁稿皢褰卞搷鍚庨潰鍑犲勾鐨刡/s寮鍙戙?br />
gwt鍒╃敤浜唈ava寮鍙戠殑涓鍒囨垚鐔熸潯浠訛紝鍖呮嫭Unit test, refactor, IDE(eclipse...)錛屼紶緇熺殑b/s framework蹇呭皢鍙楀埌閲嶅垱錛屾í鎵繃鍚庯紝JSF/ECHO絳塖erver side framework鍙兘騫稿瓨銆傚鏋滃摢澶ゞoogle鍔犱笂serverside鏀寔錛堜粠鍖呭懡鍚嶄笂鐪嬫槸鐣欐湁浣欏湴鐨勶級銆傘傘傝櫧鐒秅wt鐩墠榪樻槸灝忔牱涓涓紝浣嗘槸鑳屽悗绔欑殑鏄噸閲忕駭鐨刧oogle錛屽己澶х殑璧勬簮鍜屾暟涓嶅畬鐨勯摱瀛愩傘傘傘?br />
鐪嬪埌榪欑帺鎰忛鍏堟兂鍒扮殑鏄痚cho2, 瀹㈡埛绔妧鏈兘鏄痑jax, 緙栫爜閮芥槸java. 涓嶅悓鐨勬槸gwt鍙戣鏃剁紪璇戞垚HTML+JS錛孍cho2鍒欐槸瀹屽叏鐨勬湇鍔″櫒绔敓鎴?鏇存柊銆俫wt璺焥erver绔氦浜掍緷闈犵被浼間簬ws鐨剆ervice鎶婂墠鍚庡彴瀹屽叏鍖哄垎寮銆?br />
鍦╡cho鐨勮鍧涢噷闈㈠凡緇忔湁浜哄湪璁ㄨ榪欑帺鎰忎簡錛屽茍涓斿叓鍗︿簡涓涓媑wt鐨勫墠韜技涔庢槸Morfik鐨勪竴閮ㄥ垎錛堝緟璇佸疄錛?br />浠庡師鐞嗕笂錛宔cho鐨勫紑鍙戣呬綔鍑轟簡瀵規瘮錛岃繖涓綉绔欎技涔庤灝侀攣錛岃繖閲岃漿璐翠竴涓?


錛濓紳錛濓紳錛濓紳錛濓紳錛濓紳錛濓紳錛濓紳錛濓紳錛濓紳錛濓紳錛濓紳錛濓紳錛濓紳錛濓紳錛濓紳錛?br />http://echotwo.blogspot.com/聽浣滆卼od liebeck

Comparing the Google Web Toolkit to Echo2
The Google Web Toolkit (GWT) is being compared to Echo2 quite frequently. Some of these comparisons have been fairly accurate, while others contain bits of misinformation. This article, written by the lead developer of Echo2, discusses the similarities and differences between these two frameworks.

Overview

The Google Web Toolkit and Echo2 definitely make for an interesting comparison. Both of these frameworks take a non-traditional approach toward web application development, even considering the latest crop of "AJAX-based frameworks" available today.

The most obvious similarity between GWT and Echo2 is that they both enable the developer to create dynamic, AJAX-driven web user interfaces using only Java. In both projects, UIs are developed in a fashion similar to SWT or Swing: by assembling hierarchies of components and registering event handlers. Neither project requires the developer to work with HTML, JavaScript, or XML.

The most obvious difference between GWT and Echo2 is that all of your GWT code is executed on the client, whereas your Echo2 code is executed on the server. There are advantages and disadvantages to both of these approaches, which will be highlighted throughout the article.

GWT's defining attribute is the Java-to-JavaScript compiler. This compiler allows you to develop the web interface to your application in Java, then compile it to JavaScript. GWT limits the developer to a subset of the Java 1.4 libraries. GWT applications can be served by any web server, such as Apache, without the need for server-side processing.

Echo2 applications are compiled to Java byte code and run on a Java server. Their Java code is executed by Echo2's "Web Application Container" layer, which sits atop a Java Servlet. On the web browser, the Echo2 "Client Engine" communicates user input to the Web Application Container via AJAX requests, with the server responding with directives to perform incremental updates to the state of the client web browser.

User Interface Performance

With GWT, all of your user interface code exists on the client browser. In operations that do not require server communication--that is, that do not require retrieving data from the middle tier--this configuration results in response times that are not dependent on the server. When data must be retrieved from the application's middle tier or business logic layer, the response time is subject to the same criteria as any other AJAX application, i.e., network latency, bandwidth, and server performance.

Echo2 application code is run on the server, so for each user interaction that requires a call to the middle tier or immediate execution of the application's Java code, an AJAX connection is made to the server. Echo2 components are designed to minimize the client/server communication as much as is possible, limiting it to times when the server must be notified immediately of events. For example, simple events such as user input to a TextField component will not result in server contact. The server's response is the minimum set of instructions to incrementally update the client to reflect the new screen state.

GWT applications are served to the client as a single HTML/JavaScript file, containing the entirety of the user interface. The size of this file will be proportional to the size of your user interface code and the toolkit libraries used by your application.

Echo2 JavaScript modules are lazy-loaded to the client, and thereafter cached. A module will be retrieved when a component first appears on-screen that requires it. Application code is never sent to the client, only the state of the user interface.

Middle Tier / Data Retrieval

To access business data or perform a business process, a GWT user interface makes a remote procedure call (RPC) from the browser to a Servlet. GWT provides a mechanism to make the RPC invocation transparent to the developer, allowing the developer to build the application with "Plain Old Java Objects" (POJOs). However, any application that provides an RPC capability is a distributed application -- even when the RPC is accomplished transparently to the developer. Distributed applications in businesses and enterprises usually have security considerations and the remote objects serving the GWT clients must be designed with a focus on security to deflect attacks from imitated or hostile client applications.

Echo2 applications support, but do not require, the use of distributed application logic or a Service Oriented Architecture (SOA). Alternatively, Echo2 applications can be built to run entirely within a single JVM instance, backed by a POJO-based middle tier. This allows Echo2 developers to build applications without the security concerns of distributed application logic -- and leverage the many strong frameworks built around POJO development such as the Spring Framework and Hibernate. Echo2 accomplishes this by keeping the state of a user's web interface on the server so that no remote objects need to be exposed.

Run-time Environment

GWT has some limitations due to the fact that applications are run on the client browser. First, GWT applications are limited to using a subset of the core Java class libraries, consisting of 27 classes, 11 interfaces, and 18 exception types found in the java.util and java.lang packages (as of GWT 1.0.21). This limitation prevents GWT applications from linking to most existing Java libraries. Additionally, all Java code must be compliant with the Java 1.4 specification; 1.5 is not supported. Localization-related portions of the Java API are not provided.

Debugging

GWT provides an alternate deployment environment for applications to facilitate debugging. The environment, called "Hosted Mode", allows a GWT application to be run as Java byte code in a local JVM, to which an IDE's debugger can be connected. In this mode, the application's user interface is displayed in a special web browser (a Mozilla/Firefox derivative).

Echo2 applications may be debugged in the conventional manner, by connecting an IDE's debugger to a JVM running a Servlet container.

Licensing

The primary component of GWT, the Java-to-JavaScript cross-compiler, is proprietary, binary-only software. The Java API libraries are open source software, distributed under the Apache License. The API libraries have essentially no value without the proprietary compiler. The (non-critical) hosted-mode browser is also under the proprietary license. GWT is provided free of charge.

Echo2 is open source software, licensed under the Mozilla Public License, and provided free of charge.

Applicability

GWT can be used as a means of creating AJAX components to embed in traditional web applications (or even in static web pages) as well as for creating complete application user interfaces. There are some issues to using it for the creation of large applications, where downloading an entire application to a client web browser in one shot would not be practical. The lack of localization and full Java API support also presents a problem for larger solutions.

Echo2 is practical for creating web applications of any size. It is however not intended to scale downward to function as a platform for simply creating AJAX components in traditional web frameworks (or static web sites).

More Information

Google Web Toolkit:
Home Page, Example Applications, Getting Started Guide, Developer Guide

Echo2:
Home Page, Example Applications, Tutorial
posted by Tod Liebeck at 5:13 AM | 0 comments聽聽

======================================
姣曠珶gwt榪樻槸灝廱aby, 浠ュ悗鎬庝箞鍙戝睍榪橀毦璇達紝鐜板湪涓嬬粨璁哄お鏃┿傝繖涓ゅぉ璇曠敤涓涓嬶紝鏈夌┖浠庣粏鑺備笂瀵規瘮涓涓嬨?br />



steeven 2006-06-01 00:55 鍙戣〃璇勮
]]>
EMF涔婻esourceSet鎺㈢儲(4)http://m.tkk7.com/steeven/archive/2006/05/26/48271.htmlsteevensteevenFri, 26 May 2006 02:22:00 GMThttp://m.tkk7.com/steeven/archive/2006/05/26/48271.htmlhttp://m.tkk7.com/steeven/comments/48271.htmlhttp://m.tkk7.com/steeven/archive/2006/05/26/48271.html#Feedback1http://m.tkk7.com/steeven/comments/commentRss/48271.htmlhttp://m.tkk7.com/steeven/services/trackbacks/48271.html嫻嬭瘯涓涓媑etResource(URI,boolean):

聽聽聽聽聽聽聽聽System.out.println(EcorePackage.eINSTANCE.eResource());聽 // 1
聽聽聽聽聽聽聽聽System.out.println(XMLTypePackage.eINSTANCE.eResource());聽 // 2

聽聽聽聽聽聽聽聽ResourceSet聽rs聽
= new 聽ResourceSetImpl();
聽聽聽聽聽聽聽聽rs.getResourceFactoryRegistry().getExtensionToFactoryMap().put(
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽Resource.Factory.Registry.DEFAULT_EXTENSION,
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
new 聽XMIResourceFactoryImpl());
聽聽聽聽聽聽聽聽String聽uri聽
= " http://abc.eg/asdf " ;
// 聽聽聽聽聽聽聽聽System.out.println(rs.createResource(URI.createURI(uri)));聽 // 聽濡傛灉鍒涘緩榪囦復鏃剁殑錛屽緱鍒拌繖涓?br /> // 聽聽聽聽聽聽聽聽System.out.println(rs.createResource(URI.createURI(uri)));聽 // 聽濡傛灉鍒涘緩榪囧涓復鏃剁殑錛岃繑鍥炵涓涓紝榪欎釜蹇界暐
聽聽聽聽聽聽聽聽rs.getPackageRegistry().put(uri,聽EcorePackage.eINSTANCE);聽 // 寰楀埌緇撴灉鍚?,濡傛灉涓婇潰鍙栨秷娉ㄩ噴錛屾湰鍦板垱寤虹殑浼樺厛

聽聽聽聽聽聽聽聽System.out.println(rs.getResource(URI.createURI(uri),聽
false ));聽 // 鍚?


createResource姣忔鍒涘緩鏂扮殑錛実etResource鍒欐槸鍞竴瀹炰緥鐨勩?/p>

姣忎釜鐢熸垚鐨刋xxPackage.eINSTANCE浼氳嚜琛屽垱寤鴻嚜宸辯殑Resource銆傚鏋滃湪鎻掍歡涓慨鏀逛簡EcorePackge.eInstance.eResource()錛屼細涓嶄細澶╀笅澶т貢鍛紵

==================
eclispe緙栬緫鍣ㄥ彸杈圭殑Mark Occurrence寰堟柟渚匡紝浣嗘槸瀹墮噷鐢佃剳涓婄殑榪欎釜榛勮壊灝忔爣璁板緢涓嶆竻妤氥傚墠鍑犲ぉ璋冩暣浜嗚佸崐澶╋紝淇敼閰嶈壊鏂規錛屾崲鏄劇ず鍣ㄩ┍鍔紝璋冩暣鏄劇ず鍣ㄥ姣斿害銆佷寒搴﹂兘鏀舵晥涓嶅ぇ銆傛槰澶╁伓鐒舵妸XP鐨勬闈㈤鏍兼崲鍥炰紶緇熸ā寮忥紝鎼炲畾浜嗐?/p>

ecore.ecore榪欎釜闂寰堟湁鎰忔濓紝浠ュ墠鐪嬭繃schema.xsd錛屽氨鏄嚜宸卞畾涔夎嚜宸便傛嵁璇碕DK涔熸槸鐢╦ava寮鍙戠紪璇戝嚭鏉ョ殑銆傘傘?br />鍏堟湁楦¤繕鏄幇鏈夎泲鍛紵



steeven 2006-05-26 10:22 鍙戣〃璇勮
]]>
EMF涔婻esourceSet鎺㈢儲(3) http://m.tkk7.com/steeven/archive/2006/05/26/48249.htmlsteevensteevenThu, 25 May 2006 17:23:00 GMThttp://m.tkk7.com/steeven/archive/2006/05/26/48249.htmlhttp://m.tkk7.com/steeven/comments/48249.htmlhttp://m.tkk7.com/steeven/archive/2006/05/26/48249.html#Feedback0http://m.tkk7.com/steeven/comments/commentRss/48249.htmlhttp://m.tkk7.com/steeven/services/trackbacks/48249.html鍦≧S涓悓涓URI鍙互createResource澶氫釜Resource錛孡ist鏂瑰紡瀛樻斁銆傝繕瀛樺湪鍙﹀涓縐峂ap瀛樻斁鏂瑰紡, getResource(URI,boolean loadOnDemand)灝辨槸閫氳繃榪欑鏂瑰紡瀛樺彇錛屽鏋滀笉瀛樺湪鐨勮瘽鍒涘緩銆傝繖涓や釜鏂規硶鐪嬭搗鏉ユ湁浜涘啿紿併備技涔庣敤浜庝笉鍚屽満鍚堛?br />
鍐嶆潵鐪嬬湅鎬庢牱閫氳繃URL瀛樺彇EObject:
RS鏁翠釜鐩稿綋浜庝竴涓狣ataBase, Resource鐩稿綋浜庤〃錛屽瓨鏀劇殑鏄疎Object, 姣忎釜EObject鍙互鐪嬫垚瀵硅薄鎴栬匵ML銆?br />琛ㄧ敤URI鏉ュ尯鍒嗭紝URI涓殑Segment鐢ㄦ潵瀹氫綅EObject銆俇RI鐨勪緥瀛愬弬瑙佹帰绱?1)
getEObject(URL, boolean loadOnDemand)寰堢畝鍗曪紝getResource鎵懼埌瀵瑰簲鐨凴esource,鍦ㄩ噷闈㈡牴鎹甋egment鏌ユ壘錛屽氨鏄偅涓?a href="mailto:#///@xxx.n">#///@xxx.n鏍煎紡鐨勪笢瑗匡紝娉ㄦ剰錛岃繕鏈塈D鏂瑰紡銆?br />
getPackageRegistry()鐢ㄦ潵榪斿洖RS鐨刄RL->Package娉ㄥ唽琛紝瀹冧篃鏄釜鏈湴鐨勬敞鍐岃〃錛屼唬鐞嗕簡鍏ㄥ眬鐨凟Package.Registry.INSTANCE銆傝繖涓敞鍐岃〃鐢ㄤ簬鍙栧緱EPackage錛堢被鍨嬩俊鎭級鍜孍Factory錛堝垱寤哄疄渚嬶級


Resource灝變笉璇翠簡錛屼富瑕乴oad,save, 涓浜涘叿浣撳瓙綾伙紝姣斿XmlResourceImpl鍙互鐩存帴浣跨敤錛屾寚瀹欵ncoding涔嬬被銆?br />
鐪嬬湅ResourceSet瀵笶MF浜嗚В浜嗗緢澶殈



steeven 2006-05-26 01:23 鍙戣〃璇勮
]]>
EMF涔婻esourceSet鎺㈢儲(2) http://m.tkk7.com/steeven/archive/2006/05/26/48242.htmlsteevensteevenThu, 25 May 2006 16:02:00 GMThttp://m.tkk7.com/steeven/archive/2006/05/26/48242.htmlhttp://m.tkk7.com/steeven/comments/48242.htmlhttp://m.tkk7.com/steeven/archive/2006/05/26/48242.html#Feedback0http://m.tkk7.com/steeven/comments/commentRss/48242.htmlhttp://m.tkk7.com/steeven/services/trackbacks/48242.html1. getResourceFactoryRegistry()
聽聽public聽Resource.Factory.Registry聽getResourceFactoryRegistry()
聽聽
{
聽聽聽聽
if聽(resourceFactoryRegistry聽==null)
聽聽聽聽
{//鍙互鑷Set涓涓敞鍐岃〃瀹炵幇錛屾病鏈夌殑璇濈敤緋葷粺緙虹渷娉ㄥ唽琛?/span>
聽聽聽聽聽聽resourceFactoryRegistry聽=
聽聽聽聽聽聽聽聽
new聽ResourceFactoryRegistryImpl()
聽聽聽聽聽聽聽聽
{
聽聽聽聽聽聽聽聽聽聽
public聽Resource.Factory聽delegatedGetFactory(URI聽uri)
聽聽聽聽聽聽聽聽聽聽
{
聽聽聽聽聽聽聽聽聽聽聽聽
return聽Resource.Factory.Registry.INSTANCE.getFactory(uri);
聽聽聽聽聽聽聽聽聽聽}

聽聽聽聽聽聽聽聽}
;聽//浠g悊緋葷粺娉ㄥ唽琛紝娉ㄦ剰榪欎釜搴旇鏄瀹楃殑銆?/span>
聽聽聽聽}

聽聽聽聽
return聽resourceFactoryRegistry;
聽聽}

鎵浠ヨ嚜宸眓ew 鍑烘潵鐨凴esourceSet鍙互鍚戞敞鍐岃〃涓換鎰忔坊鍔犲伐鍘傚疄鐜般?br />2. 璋冪敤娉ㄥ唽琛ㄧ殑getFactory(URI), 瀹炵幇濡備笅錛?br />
public聽Resource.Factory聽getFactory(URI聽uri)
聽聽
{
聽聽聽聽String聽protocol聽
=聽uri.scheme();
聽聽聽聽Object聽resourceFactory聽
=聽聽protocolToFactoryMap.get(protocol);聽//鍏堟牴鎹畃rotocol鏌ユ壘
聽聽聽聽if聽(resourceFactory聽==null)
聽聽聽聽
{
聽聽聽聽聽聽String聽extension聽
=聽uri.fileExtension();
聽聽聽聽聽聽resourceFactory聽
=聽extensionToFactoryMap.get(extension);聽//鎵句笉鍒板啀鏍規嵁鎵╁睍鍚嶆煡鎵?/span>
聽聽聽聽聽聽if聽(resourceFactory聽==null)
聽聽聽聽聽聽
{
聽聽聽聽聽聽聽聽resourceFactory聽
=聽extensionToFactoryMap.get("*");聽//灝濊瘯鏌ユ壘緙虹渷鎵╁睍
聽聽聽聽聽聽聽聽if聽(resourceFactory聽==null)
聽聽聽聽聽聽聽聽
{
聽聽聽聽聽聽聽聽聽聽resourceFactory聽
=聽delegatedGetFactory(uri);聽//鑷瀹炵幇鍙互鎵╁睍姝ゆ柟娉曡В鏋愩?/span>
聽聽聽聽聽聽聽聽}

聽聽聽聽聽聽}

聽聽聽聽}


聽聽聽聽
//Descriptor鍙互鐢ㄤ簬緙栫▼浣跨敤
聽聽聽聽return
聽聽聽聽聽聽resourceFactory聽
instanceof聽Resource.Factory.Descriptor聽?
聽聽聽聽聽聽聽聽((Resource.Factory.Descriptor)resourceFactory).createFactory()聽:
聽聽聽聽聽聽聽聽(Resource.Factory)resourceFactory;
聽聽}

鏌ユ壘涓涓伐鍘傚眳鐒惰繖涔堝鏉傦紒姝e洜涓鴻繖涔堝鏉傦紝鎵嶈兘鏀寔platform/file/fttp絳変紬澶氬崈濂囩櫨鎬殑URI
涓嶅悓綾誨瀷鐨勫伐鍘傚姞宸ュ嚭涓嶅悓綾誨瀷鐨凴esource, 鎵嶄細杈撳嚭涓篨SD/XML/XMI/....

濡傛灉鐩存帴鎿嶄綔緋葷粺娉ㄥ唽琛ㄨ灝忓績銆侲MF涓畾涔変簡鍑犱釜鎵╁睍鐐癸紝鍙互瀹炵幇綾諱技鐩殑銆?br />宸茬煡鐨凴esourceFactory瀹炵幇鏈夛細XSD/ECore/EMOF/XML/XMI錛孹SD鐨勮緭鍑烘柟娉曠殑浠嬬粛鍙互鍙傝僂clipse Development using the Graphical Editing Framework and the Eclipse Modeling Framework鐢靛瓙涔︺?br />




steeven 2006-05-26 00:02 鍙戣〃璇勮
]]>
EMF涔婻esourceSet鎺㈢儲(1)http://m.tkk7.com/steeven/archive/2006/05/25/48229.htmlsteevensteevenThu, 25 May 2006 14:40:00 GMThttp://m.tkk7.com/steeven/archive/2006/05/25/48229.htmlhttp://m.tkk7.com/steeven/comments/48229.htmlhttp://m.tkk7.com/steeven/archive/2006/05/25/48229.html#Feedback0http://m.tkk7.com/steeven/comments/commentRss/48229.htmlhttp://m.tkk7.com/steeven/services/trackbacks/48229.html鍏堢湅鐪嬬幇璞★紝浠MF渚嬪瓙Library.ecore涓轟緥, 嫻嬭瘯浠g爜濡備笅錛?br />
publicclass聽Test聽{
聽聽聽聽
publicstaticvoid聽main(String[]聽args)聽throws聽IOException聽{
聽聽聽聽聽聽聽聽ResourceSet聽rs聽
=new聽ResourceSetImpl();
聽聽聽聽聽聽聽聽rs.getResourceFactoryRegistry().getExtensionToFactoryMap().put(
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽Resource.Factory.Registry.DEFAULT_EXTENSION,
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
new聽XMIResourceFactoryImpl()); //outside eclipse
聽聽聽聽聽聽聽聽Resource聽resource聽
=聽rs.createResource(URI
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽.createURI(EXTLibraryPackage.eNS_URI));
聽聽聽聽聽聽聽聽
//step聽a
聽聽聽聽聽聽聽聽Library聽library聽=聽EXTLibraryFactory.eINSTANCE.createLibrary();
聽聽聽聽聽聽聽聽library.setName(
"some聽lib");
聽聽聽聽聽聽聽聽resource.getContents().add(library);
聽聽聽聽聽聽聽聽
//step聽b
//聽聽聽聽聽聽聽聽Book聽book聽=聽EXTLibraryFactory.eINSTANCE.createBook();
//聽聽聽聽聽聽聽聽book.setTitle("some聽book");
//聽聽聽聽聽聽聽聽Employee聽employee聽=聽EXTLibraryFactory.eINSTANCE.createEmployee();
//聽聽聽聽聽聽聽聽employee.setFirstName("some聽one");
聽聽聽聽聽聽聽聽
//step聽c
//聽聽聽聽聽聽聽聽library.getBooks().add(book);
//聽聽聽聽聽聽聽聽library.getEmployees().add(employee);
聽聽聽聽聽聽聽聽
//step聽d
//聽聽聽聽聽聽聽聽resource.getContents().add(book);
聽聽聽聽
//聽聽聽聽聽聽聽聽System.out.println(EcoreUtil.getURI(employee));
//聽聽聽聽聽聽聽聽System.out.println(EcoreUtil.getURI(book));
聽聽聽聽聽聽聽聽resource.save(System.out,聽null);
聽聽聽聽}

}


姝ラ 杈撳嚭
a ----------------
<?xml version="1.0" encoding="ASCII"?>
<extlib:Library xmi:version="2.0" xmlns:xmi="http:///org/eclipse/emf/examples/library/extlibrary.ecore/1.0.0" name="some lib"/>
b聽#//
#//
<?xml version="1.0" encoding="ASCII"?>
<extlib:Library xmi:version="2.0" xmlns:xmi="http:///org/eclipse/emf/examples/library/extlibrary.ecore/1.0.0" name="some lib"/>
c http:///org/eclipse/emf/examples/library/extlibrary.ecore/1.0.0#//@employees.0
#//
<?xml version="1.0" encoding="ASCII"?>
<extlib:Library xmi:version="2.0" xmlns:xmi="http:///org/eclipse/emf/examples/library/extlibrary.ecore/1.0.0" name="some lib">
<employees firstName="some one"/>
</extlib:Library>
d http:///org/eclipse/emf/examples/library/extlibrary.ecore/1.0.0#/0/@employees.0
http:///org/eclipse/emf/examples/library/extlibrary.ecore/1.0.0#/1
<?xml version="1.0" encoding="ASCII"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http:///org/eclipse/emf/examples/library/extlibrary.ecore/1.0.0">
聽 <extlib:Library name="some lib">
聽聽聽 <employees firstName="some one"/>
聽 </extlib:Library>
<extlib:Book title="some book"/>
</xmi:XMI>

鍙互鐪嬪埌錛屾病鏈夊姞鍏ib鐨勬椂鍊欙紝employee/book瀹炰緥鐨刄RI閮芥槸#//, employee鍔犲叆浠ュ悗鏈変簡#//@employees.0, book渚濇棫銆?br />鍦╞ook鍔犲叆resource浠ュ悗鏈変簡#/1鐨刄RI, employee/book鍦╟ontainment瀹氫箟鍒嗗埆鏄痶rue,false錛屾墍浠mployee鍔犲叆lib浠ュ悗灝遍殢lib鍔犲叆resource錛堝疄渚嬪鍣級銆俠ook鍒欒鍗曠嫭鍔犲叆銆?br />
鍙﹀涓涓湁瓚g殑鐜拌薄鏄疪esource鍙互瀹圭撼澶氫釜瀹炰緥錛屽湪step d鍙互鐪嬪埌杈撳嚭鐨勬牴鑺傜偣鐢眑ib鍙樻垚鍖垮悕瀹瑰櫒銆?br />
濡傛灉lib涓嶅姞鍏esource鍙堝浣曞憿錛?br />
姝ラ 杈撳嚭
a ----------------
b聽#//
#//
c #///@employees.0
#//
d ----------------
娌″姞鍏esource涔嬪墠錛孶RI鏄湭鐭ョ殑錛岀煡閬撶殑鍙槸鐩稿鐖惰妭鐐圭殑鐩稿segment.



steeven 2006-05-25 22:40 鍙戣〃璇勮
]]>
EMF楠岃瘉鎵╁睍錛氳嚜瀹氫箟楠岃瘉瑙勫垯http://m.tkk7.com/steeven/archive/2006/05/19/47107.htmlsteevensteevenFri, 19 May 2006 11:03:00 GMThttp://m.tkk7.com/steeven/archive/2006/05/19/47107.htmlhttp://m.tkk7.com/steeven/comments/47107.htmlhttp://m.tkk7.com/steeven/archive/2006/05/19/47107.html#Feedback0http://m.tkk7.com/steeven/comments/commentRss/47107.htmlhttp://m.tkk7.com/steeven/services/trackbacks/47107.html鍥犱負姣旇緝灝戯紝鎵浠ヨ繖閲屾葷粨涓涓嬨?br />
楠岃瘉鐨勫畾涔夋湁涓ょ鏂瑰紡錛?br />1. 鐢熸垚楠岃瘉鏂規硶妗嗘灦錛屼唬鐮佽嚜宸卞疄鐜般傚弬瑙?a >EMF Overview:
聽 娣誨姞Annotatio, Source=http://www.eclipse.org/emf/2002/Ecore, 鐒跺悗娣誨姞DetailsEntry錛歬ey=constraints, Value=validateXxx
聽 EDataType,EClass鏀寔錛屽睘鎬т笉鏀寔銆?br />2. 瀹氫箟綾諱技Schema鐨凢acet錛岃嚜鍔ㄧ敓鎴愬搴旂殑楠岃瘉浠g爜錛岀敤浜庨獙璇佺畝鍗曟暟鎹被鍨嬶細
聽 娣誨姞Annotatio, Source=http:///org/eclipse/emf/ecore/util/ExtendedMetaData, 鐒跺悗娣誨姞DetailsEntry錛歬ey=maxLength, Value=2
聽 鏀寔鐨刦acet鍙傝ExtendedMetaData銆?br />聽 浠匛DataType鏀寔錛屽睘鎬т笉鏀寔銆?br />
紺轟緥Ecore:

鏂扮敓鎴怱qlmodelValidator.java, 浠g爜濡備笅錛?br />
鍙Table_ValidateC, MyLabel_ValidateA,MyLabel_validateB閮借嚜鍔ㄧ敓鎴愶紝淇敼閲岄潰鐨刬f(false)涓洪渶瑕佺殑涓氬姟鍒ゆ柇閫昏緫銆?br />validateMyLabel_MaxLength()鏂規硶鏄牴鎹瓻xtendedMetaData鑷姩鐢熸垚鐨勶紝鏃犻渶淇敼銆?br />
鎬葷粨錛?br />1. EMF楠岃瘉鍒╃敤浜咥nnotation鎵╁睍錛岃繖縐嶆満鍒跺緢鐏墊椿錛屼絾鏄粰鐢ㄦ埛甯︽潵涓嶄究銆?br />2. Attribute灞炴т笉鑳界敓鎴愰獙璇佽鍒欙紙eclipse3.2rc3錛夛紝鍙互瀹氫箟涓哄崟鐙殑EDataType錛岀劧鍚庡紩鐢ㄤ箣銆?br />3. Constraints+Facet+鏈韓鐨勭粨鏋勯獙璇佸彲浠ユ瀯鎴愬緢寮虹殑楠岃瘉瑙勫垯錛屽茍涓斿睘浜嶮odel灞傦紝鏁版嵁鏈韓鍗沖彲楠岃瘉鑷韓銆?br />4. EObjectValidator.DynamicEDataTypeValidator浼間箮鍙敤浜庡姩鎬侀獙璇侊紝鏈夌煡閬撶敤娉曠殑鏈嬪弸緇欒瑙d竴涓媬



steeven 2006-05-19 19:03 鍙戣〃璇勮
]]>
緙栫▼浣跨敤SDO[EMF鍏勫紵綃嘳http://m.tkk7.com/steeven/archive/2006/05/15/46266.htmlsteevensteevenMon, 15 May 2006 11:00:00 GMThttp://m.tkk7.com/steeven/archive/2006/05/15/46266.htmlhttp://m.tkk7.com/steeven/comments/46266.htmlhttp://m.tkk7.com/steeven/archive/2006/05/15/46266.html#Feedback0http://m.tkk7.com/steeven/comments/commentRss/46266.htmlhttp://m.tkk7.com/steeven/services/trackbacks/46266.html涓昏鐗圭偣錛氾紙涓漢鐞嗚В錛?br />鍙獙璇?br />寮虹被鍨?br />鍙彇鍑哄畬鏁存暟鎹拰宸紓銆?br />
鐢熸垚SDO浠g爜鍜孍MF澶у悓灝忓紓錛屼富瑕佹槸鍦╩y.genmodel鐨勭涓涓妭鐐圭殑鍙抽敭鑿滃崟涓夋嫨錛歋et SDO defaults.

浣撻獙錛?br />1. 鐢熸垚Editor鍚庯紝鎵ц鐢熸垚鐨凟ditor Plugin
2. 鏂板緩Example EMF Model Creation Wizards->Data Graph Model
3. 鍦–hanges鑺傜偣涓奡tart Loggin, 鐒跺悗緙栬緫鏁版嵁鍗沖彲鐪嬪埌鑷姩鐢熸垚鐨勫樊寮傘?br />
緗戜笂鎵嬪伐鎿嶄綔SDO鐨勭ず渚嬩唬鐮佹瘮杈冨皯錛岃繖閲岀畝鍗昫emo濡備笅錛?br />
import聽java.util.Iterator;

import聽org.eclipse.emf.ecore.EObject;
import聽org.eclipse.emf.ecore.sdo.EDataGraph;
import聽org.eclipse.emf.ecore.sdo.SDOFactory;
import聽org.steeven.family.FamilyFactory;
import聽org.steeven.family.涓漢;
import聽org.steeven.family.瀹跺涵;

import聽commonj.sdo.ChangeSummary;
import聽commonj.sdo.DataGraph;
import聽commonj.sdo.DataObject;

publicclass聽Server聽{

聽聽聽聽
publicstaticvoid聽main(String[]聽args)聽{
聽聽聽聽聽聽聽聽
//聽client聽side
聽聽聽聽聽聽聽聽EDataGraph聽graph聽=聽loadGraph();
聽聽聽聽聽聽聽聽graph.getChangeSummary().beginLogging(); // important!
聽聽聽聽聽聽聽聽瀹跺涵聽family聽
=聽(瀹跺涵)聽graph.getRootObject();
聽聽聽聽聽聽聽聽family.setTitle(
"my聽family");
聽聽聽聽聽聽聽聽涓漢聽baby聽
=聽FamilyFactory.INSTANCE.create涓漢();
聽聽聽聽聽聽聽聽baby.set濮撳悕(
"sophie");
聽聽聽聽聽聽聽聽family.get鍏斿唇瀛?).add(baby);
聽聽聽聽聽聽聽聽graph.getChangeSummary().endLogging();
聽聽聽聽聽聽聽聽saveGraph(graph);
聽聽聽聽聽聽聽聽update(graph);
聽聽聽聽}


聽聽聽聽
//server聽side
聽聽聽聽publicstatic聽EDataGraph聽loadGraph()聽{
聽聽聽聽聽聽聽聽瀹跺涵聽family聽
=聽FamilyFactory.INSTANCE.create瀹跺涵();聽//聽or聽load聽from
聽聽聽聽聽聽聽聽
//聽database
聽聽聽聽聽聽聽聽EDataGraph聽graph聽=聽SDOFactory.eINSTANCE.createEDataGraph();
聽聽聽聽聽聽聽聽graph.setERootObject((EObject)聽family);
聽聽聽聽聽聽聽聽
return聽graph;
聽聽聽聽}


聽聽聽聽
//server聽side聽full聽save
聽聽聽聽publicstaticvoid聽saveGraph(EDataGraph聽graph)聽{
聽聽聽聽聽聽聽聽System.out.println(graph.getRootObject());
聽聽聽聽}


聽聽聽聽
//server聽side聽update聽changed聽objects
聽聽聽聽publicstaticvoid聽update(DataGraph聽dataGraph)聽{
聽聽聽聽聽聽聽聽ChangeSummary聽changeSummary聽
=聽dataGraph.getChangeSummary();
聽聽聽聽聽聽聽聽
for聽(Iterator聽it聽=聽changeSummary.getChangedDataObjects().iterator();聽it
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽.hasNext();)聽
{
聽聽聽聽聽聽聽聽聽聽聽聽DataObject聽changedObject聽
=聽(DataObject)聽it.next();
聽聽聽聽聽聽聽聽聽聽聽聽System.out.println(
"Update聽for聽"+聽changedObject);
聽聽聽聽聽聽聽聽聽聽聽聽
for聽(Iterator聽settingIt聽=聽changeSummary.getOldValues(changedObject)
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽.iterator();聽settingIt.hasNext();)聽
{
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽ChangeSummary.Setting聽changeSetting聽
=聽(ChangeSummary.Setting)聽settingIt
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽.next();
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽System.out.println(
"聽(changed聽"
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
+聽changeSetting.getProperty().getName()聽+"聽from聽\""
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽+聽changeSetting.getValue()聽+"\"聽to聽\""
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
+聽changedObject.get(changeSetting.getProperty())
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
+"\")");
聽聽聽聽聽聽聽聽聽聽聽聽}

聽聽聽聽聽聽聽聽}

聽聽聽聽}

}

杈撳嚭錛?br />
org.steeven.family.impl.瀹跺涵Impl@9664a1聽(title:聽my聽family)
Update聽for聽org.steeven.family.impl.涓漢Impl@1729854聽(濮撳悕:聽sophie,聽鎬у埆:聽鐢?
Update聽for聽org.steeven.family.impl.瀹跺涵Impl@9664a1聽(title:聽my聽family)
聽(changed聽title聽from聽"null"聽to聽"my聽family")
聽(changed聽鍏斿唇瀛惵爁rom聽"[]"聽to聽"[org.steeven.family.impl.涓漢Impl@1729854聽(濮撳悕:聽sophie,聽鎬у埆:聽鐢?]")

SDO鐢熸垚鐨勪唬鐮佷技涔庢洿鍔犵函鍑涓鐐癸紝娌℃湁寰堝鐨別Xxxx()鏂規硶錛堟湁闇瑕佺殑涔熷彲浠ュ彇鍒幫級銆?br />鎹log鐨勫紑閿姣旇緝澶э紝涓嶅緩璁澶ч噺鏁版嵁浣跨敤銆?img src ="http://m.tkk7.com/steeven/aggbug/46266.html" width = "1" height = "1" />

steeven 2006-05-15 19:00 鍙戣〃璇勮
]]>
EMF緙栫▼浣跨敤http://m.tkk7.com/steeven/archive/2006/05/14/46129.htmlsteevensteevenSun, 14 May 2006 13:27:00 GMThttp://m.tkk7.com/steeven/archive/2006/05/14/46129.htmlhttp://m.tkk7.com/steeven/comments/46129.htmlhttp://m.tkk7.com/steeven/archive/2006/05/14/46129.html#Feedback3http://m.tkk7.com/steeven/comments/commentRss/46129.htmlhttp://m.tkk7.com/steeven/services/trackbacks/46129.html鐪嬪埌eclipse3.2閲岄潰鐨凣MF, 瑙夊緱姣旇緝鏈夎叮,搴曞眰榪樻槸鐢ㄥ埌浜咵MF. 鑺變簡涓ゅぉ鏃墮棿浠旂粏鐮旂┒浜嗕互涓婨MF,鐨勭‘鏄釜濂戒笢瑗?

EMF鏍規嵁ecore寤烘ā(鍙互鍜宻chema鐨剎sd鐩鎬簰杞崲)鐢熸垚寮虹被鍨嬬殑EMF浠g爜. 榪欎釜寮虹被鍨嬫洿寮虹殑鍦版柟鏄彲浠ュ彇寰梞eta淇℃伅,浠庤屽彲浠ョ敤浜庢牎楠屽拰鐣岄潰杈呭姪淇℃伅鐨勭敓鎴?綾諱技浜庡姩鎬乥ean,灞炴т篃鍙互鏍規嵁鍚嶇О鍔ㄦ佸彇寰?

浠ュ墠鑰冭檻榪囩敤xsd鎻忚堪鐣岄潰, 浣嗘槸鏁版嵁杞戒綋鍙兘鏄痻ml, 鍗充嬌鍒╃敤apache鐨剆chema緙栬瘧宸ュ叿鐢熸垚寮虹被鍨嬬殑綾?鍚庡彴浠g爜涔熸槸xml. 涓嶅埄浜庢寔涔呭寲. emf鍦ㄤ唬鐮佺敓鎴愬紩鎿庢瘮杈冩櫤鑳?鍙互鏍囪鍑虹敤鎴蜂唬鐮佸拰鑷姩鐢熸垚浠g爜.涓嶄細鏈夌敓鎴愯鐩栭棶棰?

榪欓噷鍋氫釜綆鍗曠ず渚?
1. Ecore:
鍙互鏂板緩Ecore, 寤虹珛濂戒互鍚庣敤GMF鍙鍖栫紪杈?Eclipse3.2RC2)

2. 鐢熸垚Model:
鐐瑰嚮my.ecore鏂囦歡,鑿滃崟:File->New->Other->Eclipse Modeling Framework->EMF Model
3. 鎵撳紑鐢熸垚鐨刴y.genmodel, 閫夋嫨鏍戦《鐐圭殑:Generate Model Code
鐢熸垚鐨勪唬鐮侀噷闈細鏈変竴涓紪璇戦敊璇? 鏄腑鏂囩紪紼嬬殑闂, 涓枃娌℃湁澶у皬鍐?鍏堝ぉ涓嶈凍鍟?,緇撴灉鎬у埆榪欎釜鎴愬憳鍙橀噺鍜屾у埆綾誨悕娣鋒穯,鍑洪敊.鍦ㄩ敊璇唬鐮佸墠闈㈠姞涓婂寘鍏ㄥ悕鍗沖彲.
4. 鍒╃敤鐢熸垚鐨勪唬鐮佹瀯寤轟竴涓搴?杈撳嚭xml騫朵笖鏍¢獙涔?

import 聽java.io.IOException;
import 聽java.util.Iterator;

import 聽org.eclipse.emf.common.util.Diagnostic;
import 聽org.eclipse.emf.common.util.URI;
import 聽org.eclipse.emf.ecore.EObject;
import 聽org.eclipse.emf.ecore.resource.Resource;
import 聽org.eclipse.emf.ecore.util.Diagnostician;
import 聽org.eclipse.emf.ecore.xmi.XMLResource;
import 聽org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl;
import 聽org.steeven.family.FamilyFactory;
import 聽org.steeven.family.浜虹墿;
import 聽org.steeven.family.瀹跺涵;
import 聽org.steeven.family.鎬у埆;

public class 聽TestMy聽 {

聽聽聽聽
public static void 聽main(String[]聽args)聽 throws 聽IOException聽 {
聽聽聽聽聽聽聽聽testFamily();
聽聽聽聽}


聽聽聽聽
private static void 聽testFamily()聽 throws 聽IOException聽 {
聽聽聽聽聽聽聽聽瀹跺涵聽family聽
= 聽FamilyFactory.eINSTANCE.create瀹跺涵();
聽聽聽聽聽聽聽聽family.setTitle(
" steeven瀹?/span> " );
聽聽聽聽聽聽聽聽family.set鑰佸叕(FamilyFactory.eINSTANCE.create浜虹墿());
聽聽聽聽聽聽聽聽family.get鑰佸叕().set濮撳悕(
" steeven " );
聽聽聽聽聽聽聽聽family.set鑰佸﹩(FamilyFactory.eINSTANCE.create浜虹墿());
聽聽聽聽聽聽聽聽family.get鑰佸﹩().set濮撳悕(
" stella " );
聽聽聽聽聽聽聽聽family.get鑰佸﹩().set鎬у埆(鎬у埆.濂砡LITERAL);
聽聽聽聽聽聽聽聽浜虹墿聽sophie聽
= 聽FamilyFactory.eINSTANCE.create浜虹墿();
聽聽聽聽聽聽聽聽sophie.set濮撳悕(
" sophie " );
聽聽聽聽聽聽聽聽sophie.set鎬у埆(鎬у埆.濂砡LITERAL);
聽聽聽聽聽聽聽聽family.get鍏斿唇瀛?).add(sophie);
聽聽聽聽聽聽聽聽dump(family);
聽聽聽聽聽聽聽聽validate(family);
聽聽聽聽}


聽聽聽聽
private static void 聽validate(EObject聽family)聽 {
聽聽聽聽聽聽聽聽Diagnostic聽diagnostic聽
= 聽Diagnostician.INSTANCE.validate(family);
聽聽聽聽聽聽聽聽System.out.println(diagnostic);
聽聽聽聽聽聽聽聽
for 聽(Iterator聽it聽 = 聽diagnostic.getChildren().iterator();聽it.hasNext();)聽 {
聽聽聽聽聽聽聽聽聽聽聽聽Diagnostic聽diag聽
= 聽(Diagnostic)聽it.next();
聽聽聽聽聽聽聽聽聽聽聽聽System.out.println(diag.getMessage());
聽聽聽聽聽聽聽聽}

聽聽聽聽}


聽聽聽聽
private static 聽Resource聽dump(EObject聽objs)聽 throws 聽IOException聽 {
聽聽聽聽聽聽聽聽
// 聽ResourceSet聽rs聽=聽new聽ResourceSetImpl();
聽聽聽聽聽聽聽聽
// 聽rs.getResourceFactoryRegistry().getExtensionToFactoryMap().put(
聽聽聽聽聽聽聽聽
// 聽Resource.Factory.Registry.DEFAULT_EXTENSION,
聽聽聽聽聽聽聽聽
// 聽new聽XMIResourceFactoryImpl());
聽聽聽聽聽聽聽聽
// 聽Resource聽resource聽=聽rs.createResource(URI
聽聽聽聽聽聽聽聽
// 聽.createFileURI("c:\\temp\\test.xml"));
聽聽聽聽聽聽聽聽XMLResource聽resource聽 = new 聽XMLResourceImpl(URI
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽.createFileURI(
" c:\\temp\\test.xml " ));
聽聽聽聽聽聽聽聽resource.setEncoding(
" GBK " );
聽聽聽聽聽聽聽聽
for 聽(EObject聽obj聽:聽objs)
聽聽聽聽聽聽聽聽聽聽聽聽resource.getContents().add(obj);聽
// 聽鐩墠鐗堟湰涓嶅姞鍏esource楠岃瘉浼氭姤singling寮傚父
聽聽聽聽聽聽聽聽resource.save(System.out,聽 null );
聽聽聽聽聽聽聽聽
return 聽resource;
聽聽聽聽}

}

榪愯緇撴灉濡備笅:

<? xml聽version="1.0"聽encoding="GBK" ?>
< family: 瀹跺涵聽xmlns:family ="http://org.steeven/family" 聽title ="steeven瀹? 聽鑰佸叕 ="/" 聽鑰佸﹩ ="/" 聽鍏斿唇瀛?/span> ="/" />
Diagnostic聽ERROR聽
The聽feature聽'鑰佸叕'聽of聽'org.steeven.family.impl.瀹跺涵Impl@f6a746{file:/c:/temp/test.xml#/}'聽contains聽a聽dangling聽reference聽'org.steeven.family.impl.浜虹墿Impl@6eb38a{#//}'
The聽feature聽'鑰佸﹩'聽of聽'org.steeven.family.impl.瀹跺涵Impl@f6a746{file:/c:/temp/test.xml#/}'聽contains聽a聽dangling聽reference聽'org.steeven.family.impl.浜虹墿Impl@1cd2e5f{#//}'
The聽feature聽'鍏斿唇瀛?聽of聽'org.steeven.family.impl.瀹跺涵Impl@f6a746{file:/c:/temp/test.xml#/}'聽contains聽a聽dangling聽reference聽'org.steeven.family.impl.浜虹墿Impl@19f953d{#//}'

鍙杈撳嚭鐨剎ml涓病鏈夊寘鍚漢鐗╃殑鍏蜂綋淇℃伅. 淇敼my.ecore涓佸叕/鑰佸﹩/鍏斿唇瀛愬睘鎬х殑containment灞炴т負true,閲嶆柊鐢熸垚浠g爜鍚庤繍琛岀粨鏋滃涓?
<?xml聽version="1.0"聽encoding="GBK"?>
<family:瀹跺涵聽xmlns:family="http://org.steeven/family"聽title="steeven瀹?>
聽聽
<鑰佸叕聽濮撳悕="steeven"/>
聽聽
<鑰佸﹩聽鎬у埆="濂?聽濮撳悕="stella"/>
聽聽
<鍏斿唇瀛惵犳у埆="濂?聽濮撳悕="sophie"/>
</family:瀹跺涵>
Diagnostic聽OK


====================
EMF鍗曠嫭榪愯鎴愬姛~

榪欓噷ECORE浼間箮涓嶆敮鎸佸祵濂楀畾涔?涓嶅儚schema閭f牱涓涓猚omplexType澹版槑閲岄潰鍙互瀹氫箟鐨勫緢澶嶆潅, 涔熶笉鍍廕ava鐨勫唴閮ㄧ被. 浼間箮琚綔浜嗙畝鍖? 鏇村儚鍏崇郴鏁版嵁搴撹〃涔嬮棿鐨勫叧緋?

寰呮眰璇侀棶棰?
1. EMF鐨勬牎楠屼俊鎭槸鍚︽敮鎸佸浗闄呭寲.
2. EMF鏁版嵁鐨勮兘鍚︽洿鏂逛究鐨勪繚瀛樺埌鏁版嵁.

EMF鐨勭伒媧誨拰寮哄ぇ宸茬粡楠岃瘉榪? 鐢ㄤ簬C/S榪樻槸B/S搴旇閮戒笉鏄棶棰?


steeven 2006-05-14 21:27 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 免费观看激色视频网站bd| 好男人视频社区精品免费| 亚洲喷奶水中文字幕电影| 成年性午夜免费视频网站不卡| 免费一区二区三区在线视频| 亚洲精品高清国产一久久| 无码视频免费一区二三区| fc2成年免费共享视频网站| 亚洲网站视频在线观看| 国产高清在线精品免费软件| 不卡视频免费在线观看| 亚洲 欧洲 自拍 另类 校园| 国产福利电影一区二区三区,亚洲国模精品一区 | 免费a级毛片永久免费| 久久大香香蕉国产免费网站| 亚洲愉拍一区二区三区| 亚洲日韩精品一区二区三区无码| 美女裸身网站免费看免费网站| 一级毛片免费毛片毛片| 亚洲一级毛片视频| 在线播放亚洲第一字幕| 成人午夜性A级毛片免费| 大地资源中文在线观看免费版| 亚洲欧洲国产综合AV无码久久 | 亚洲av日韩av高潮潮喷无码| 午夜影视在线免费观看| 中文字幕无码免费久久| 国产亚洲综合久久| 亚洲a∨无码男人的天堂| 亚洲第一AV网站| 免费一看一级毛片| 歪歪漫画在线观看官网免费阅读 | 亚洲高清乱码午夜电影网| 亚洲五月六月丁香激情| 亚洲国产精品人人做人人爱| 18禁超污无遮挡无码免费网站国产| 永久免费av无码入口国语片| 狼色精品人妻在线视频免费| 亚洲中文无码卡通动漫野外| 亚洲国产精品综合久久网各| 久久精品国产精品亚洲艾|