Coder Social home page Coder Social logo

babyfish's Introduction

What is BabyFish?

1. A Java framework for data model classes.

2. An enhancement of JPA/Hibernate.

By the way, "BabyFish" is a Chinglish word, it means "Andrias davidianus". Its voice sounds like the baby's cry, that why Chinese call it "BabyFish". ^ω^

Functionalities

A. Java Part

  • Event combiner: support .NET style event notification mechanism.
  • Typed-18N: support strong type "18N" which can report the I18N errors at compilation time.
  • X-Collection-Framework: Enhance the Java Collection Framework. The most important functionality is "Unstable Collection Elements", element/key can be modified after it has been added into set(map) because the corresponding sets/maps will be adjusted automatically when it's changed.
  • MA-Collection-Framework: Enhance the X-Collection-Framework to let collections support modification notification like the trigger of database. The most important functionality is "Bubbled Event", If the modification event has been triggered by iterator or view(eg: List.subList, SortedMap.subMap), it will bubbled to its parent view, util the original root collection triggered the event.
  • ObjectModel4Java: A powerful API to create Java model classes, it supports the bidirectional association between objects. When one side bidirectional association is changed, the other side will be notified and adjusted automatically. User only need to declared some annotations and all the functionalities will be implemented by the byte-code generated dynamically in runtime.

B. ORM Part

  • ObjectMode4JPA: Enhance ObjectModel4Java. let ObjectModel support JPA entity classes.
  • Replace the lazy proxy and lazy collection of Hibernate to support ObjectModel with laziness management.
  • Support Maven plugin to change the byte-code of entity class at compilation time, programmer only need to write the simple JPA entity classes, and complex code for the ObjectMode4JPA can be added into entity classes automatically during compilation.
  • BabyFish-JPA-Criteria: A smarter implementation of JPA Criteria, it supports more functionalities, and it can optimize the generated JPQL.
  • QueryPath: Its source code is generated by maven plugin at compilation time so that all the errors can be report at compilation time. It can be decided by UI Layer dynamically, then dispatch it to Business Logic Layer, and finally dispatch it to the Data Access Layer. In Data Access Layer, it can
  • Fetch lazy associations dynamically with any depth and breadth
  • Fetch lazy scalar associations(eg: Lob) dynamically
  • Sort the query result or collection association dynamically with any depth and breadth
  • DistinctLimiQuery: Enhance the Oracle Dialect of Hibernate to resolve a problem of Hibernate, In hibernate, when paging query(with firstResult/maxResults) contains collection fetches, hibernate has to query all the data and do the paging filter in memory. This functionality can resolve this problem when database is Oracle.

How to run and learn it

  • Please view get-started.html to install and run it.
  • Please view "fast-learn_zh_CN.docx" it understand it in short time.(fast-learn.docx for English will be added soon)
  • Please view demo/demo-guide.html to learn it, that document describe every demo and give a suggestion for learning order.

Fastest way to learn it

This framework is big so it need some time to know all the functionalities. If the time or interest is not enough so that you want to know only the most important functionalities of BabyFish in least possible time. You can learn 4 UnitTest classes

  • ${babyfish-dir}/demo/babyfishdemo-om4java/src/test/java/org/babyfishdemo/om4java/l2ir/ObjectModelOfListAndIndexedReferenceTest.java
  • ${babyfish-dir}/demo/babyfishdemo-spring/src/test/java/org/babyfishdemo/spring/dal/QueryPathTest.java
  • ${babyfish-dir}/demo/babyfishdemo-xcollection/src/test/java/org/babyfishdemo/xcollection/uce/UnstableCollectionElementsTest.java
  • ${babyfish-dir}/demo/babyfishdemo-macollection/src/test/java/org/babyfishdemo/macollection/bubble/SimpleBubbleEventTest.java

license: LPGL3.0

BabyFish uses the LGPL-3.0 license so that it can be used in commercial projects, please see http://opensource.org/licenses/LGPL-3.0 to know more.

Thanks

Thank two great frameworks: ASM and ANTLR

Video resources

Chinese videos:

English videos:

History

  • Aug 2008: I have some ideas, I decided to create an open source framework by using all of my spare time.
  • Oct 2015: This first version 1.0.0.Alpha is finished, and it's published on github.

About me

Tao Chen(Chinese Name: 陈涛), [email protected]

2015-10-11, ChengDu, China

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.