Copyright (c) 2007, LoonFramework  Software 
 





 
LoonFramework框架Game包下AVG And SLG脚本演示
 
 

Loon Framework Prospectuses:

   Loon is a JDK1.4 based on the above version of the open-source layer lightweight durable framework. Parts of its have referenced to the JDO standard and ibatis achieve and focus on improving the change between the provisional and lasting objects. It is lightweight way for JDBC package and a series of operation optimization and the lasting object detached from the cumbersome JDBC operation, whilst it can keep its efficiency and operational matters. Operations not only can directly call SQL complete the operation, but also be able to advocate for CRUD operations, code volume and ORM considerable. Built-in log interface, convenient debugging can achieve zero-configuration and built-in JCS cache will effectively lowers database pressure.

Loon Framework 简介

   Loon 是一个基于JDK1.4以上版本的开源轻量级持久层框架,他部分参考了JDO标准及ibatis实现,着力于完善临时对象与持久对象间转换。他以轻量级方式进行JDBC封装及一系列操作优化,将持久对象抽离于繁琐的JDBC操作,又能保持其效率及事务操作。操作上即可以直接调用SQL完成操作,也可以对POJO进行CRUD操作,代码量与ORM相当.内置有log接口,调试方便,可实现零配置,内置JCS缓存,有效降低数据库压力。他和传统框架的最大区别,或者说特色在于,他的持久层技术不但能应用到商业项目中,而且内置有很少被涉及的game子项目,可以很简单的实现多种Java2D游戏的快速开发。并且依托于JavaFX技术,在不久的将来可实现微机到手机的无差别脚本转换。

 

Loonframework也是一个有效的API集合,它提供了快速开发的可能。

 

在Loon Framework中,将持久层分为两部分,首先令JDBC封装于DAO包下Einger中,以替代原始的Connection,ResultSet等接口,由临时持久对象Execute进行CRUD操作,此对象由注入DataSource,Connection或DaoFruit(LoonFramework特有对象)产生作用,查询形成的Query是一个非依赖于Connection依据ResultSet接口实现的数据接口,是对于CachedRowSet的优化。

Transaction transaction=DaoTransaction.makeDaoDefaultTransaction();

Engine engine = Engine.begin(transaction.getTransactionConnection());

Execute execute=engine.makeExecute();

/*while(query.hasNext()){
System.out.println(query.getString("name"));
System.out.println(query.getString(1));
}
for(Iterator it=query.iterator();it.hasNext();){
System.out.println(it.next().toString());
}*/

execute.sqlExecute("insert into loontest(name,pwd,content) values('admin','1234s',''));

transaction.commit();

engine.end();

transaction.free();

 

(上图为Loonframework Log输出)

 在Loonframework中,提供了一个标准化的Log接口,以及分别对应Log4j,Apache Log,Loonframework LogFactory的三种日志模板实现,用户只需在log.lf.xml配置文件中设置Log接口的实现类,就可以变更日志类的使用及输出。