HKGalden科技臺
發表文章發起投票
The “Free”, “Standard”, “Open” Software Heresy
The “Free”, “Standard”, “Open” Software Heresy

http://blog.jooq.org/2014/08/11/the-free-standard-open-software-heresy/

少少Background information:

Java Persistence API (JPA) 係Java中一套用於管理Relational data嘅API,有JPA同對應嘅Implementations之後,要Java program同Database溝通某程度上會簡單啲,因為部份工序可以唔需要寫SQL statements (呢步會由JPA implementations做)。常見嘅JPA implementations有Hibernate、EclipseLink、OpenJPA等等。如果對Java Data Objects (JDO) 有認識的話,可以當JPA係有類似嘅目標,而JDO嘅設計原意唔單止針對RDBMS。

jOOQ係由一間公司開發嘅Tools,同樣係用於由Java program管理Database中嘅資料。同JPA唔同嘅係:

[list]
[*]jOOQ有分Open source兼免費版本,以及收費版本。收費版本所Support嘅RDBMS會比較多。
[*]jOOQ本身係一套工具,唔係公開標準,產品功能由開發公司主導。
[*]使用jOOQ需要對SQL有一定認識,JPA就未必。
[*]Maintenance、Support同功能上,jOOQ嘅收費版本會較免費版優勝。而JPA嘅各Implementations可能會有嗰一個Implementation獨有嘅功能。
[/list]

原文起源於TheServerSide上嘅一段討論。討論內容大概係有人認為雖然JPA難學又難用,但係都應該用,又話jOOQ係易學,但係唔係公開標準 (原文: is proprietary stuff),只有一款Implementation,開發商外嘅人無得參與 (但係jOOQ有Open source版本、喺GitHub收集Feedback又算唔算畀人參與?)。

後來有人回應:

Software not being free. Is YOUR software free and "not proprietary"? If so, how do you finance it? How do you earn a living? And why are you doing it?

唔係免費? 咁你寫嘅Software係唔係免費兼非由你專有? 如果係,你點從中獲得收入?

(我真係唔識點譯Proprietary...)

Only one implementation. How many people actually do use alternatives to Hibernate and why? Because they used to use TopLink for the last 20 years and the learning curve to switch to Hibernate is too high?

只有一款Implementation? 究竟有幾多人會用Hibernate外嘅Implementations?

(其實以前我用JDO嗰陣都發覺有類似問題。雖然JDO係Open standard,但係基本上可用嘅Implementation就只有DataNucleus,其它Implementations通常係太舊、好耐無Update。)

No public review. Who exactly is "public", and what are their main interests? (Do note that a major driving force for the JDK is Credit Suisse, for instance. What is your stake and relation with Credit Suisse?)

無畀公眾參與Review? 究竟呢班「公眾」係咩人? 留意,JDK背後主要推手係Credit Suisse,你同Credit Suisse又有咩關係?

(Credit Suisse好似係一間金融業公司。)

Only one body involved in its evolution. Do you say that to YOUR customers also, about your own software?

只有一間機構主導發展方向? 咁當你幫個客寫Software嗰陣,又會唔會講同一番說話?

SQL-oriented - and then "as a serious professional". What's not serious about SQL? In fact, SQL is reviewed by more entities than the JLS, let alone the JPA specs. Have you ever thought about that?

點解對待SQL就唔需要謹慎? SQL比Java Language Specification或JPA有更多人參與制定同開發工作啦。

More basic. Fair enough. But don't forget: You probably replaced your sophisticated EJB 2.0 framework by a more basic one, which was (at the time) proprietary, had only one implementation, had no public review, nor multiple bodies involved in its evolution. It was called Hibernate, prior to JPA.

Oh, and if JPA has to be learned fully, then I challenge you to also FULLY learn SQL, including all the SQL:2011 clauses, regardless of whether they're part of your specific implementation. Because as a serious professional, you shall fully learn SQL. And while you're at that, learn also everything about execution plans, and join, fetch, buffer caching, cursor caching and all other sorts of algorithms. Because there is no excuse for not knowing which SQL transformations are generated by your database's CBO.

(oh, and I sincerely hope you're neither a Windows, nor a Mac user, because that wouldn't be free, and there is only one implementation of each OS, and no public review, and only one body involved in their evolutions.)


-----------------------------------

分享下幾點意見:

我無用過jOOQ。目前我用開Sql2o (http://www.sql2o.org/),Sql2o呢個Library做嘅就係將SQL statement send去Database,將Result變做POJO。同類型嘅有Apache DbUtils (http://commons.apache.org/proper/commons-dbutils/)。用Sql2o之前,我用開JDO... 點解當時揀JDO? 當時我讀緊書,對Java認識唔深 (到而家都唔深 ),唔知有JPA呢樣野,另外見JDO (應該係DataNucleus) 話Support唔同種類嘅Datastore,你見DataNucleus話Support RDBMS、Excel、OOXML、ODF、XML、HBase、MongoDB、Cassandra、Neo4j、JSON、Amazon S3、GoogleStorage、LDAP、NeoDatis... 望落好正,學識一套就可以配唔同Datastore。但係實際上係另一回事,因為用落會發現有啲功能係唔可以用落某款Datastore。而且,當時用DataNucleus要學埋JDO嘅Object life-cycle、要Enhance data model classes,好多時放喺Tools上面嘅時間仲多過開發緊嘅Software本身。

講起Open API/ standards,我又講下RESTful web services。Java上寫RESTful web services,有Jersey同RESTEasy等嘅Implementations可以揀。話雖Jersey同RESTEasy都Implement同一份API (JAX-RS),但有啲功能係其中一款Implementation先有。例如Handle multipart/form-data嘅HTTP request咁,JAX-RS 2.0係未有提及,於是Jersey會有佢專有嘅Implementation,RESTEasy又可能有唔同嘅Handle方式。結果就係,雖然我用嘅Tools係Implement一套Open API,但要由Jersey轉去RESTEasy唔係咁容易,肯定有啲位要改。

呢篇Blog同討論,我覺得係講緊用Proprietary嘅Tools好,定還是用Open standard/ open source嘅Tools好。
Good0Bad0
2014/08/12, 12:56:13 凌晨
本貼文共有 0 個回覆
此貼文已鎖,將不接受回覆
發表文章發起投票