Introduction
In the age of Transaction Script, Service has a lot of responsibility such as Business Logic, Transaction Boundary, Delegation of DAO, Business Flow... Now, we introduce Domain-Driven Design and Work Flow for Business Logic and Flow, then service becomes very thin and boring for coding. So we create Polyforms which fight the boring code for developers.
Polyforms has been build with some small pieces, and its development will continue. As such, the document will build through wiki.
Sample
You can checkout sample from http://polyforms.googlecode.com/svn/book/sample.
- Basic CRUD for user
- Get user by name
- Batch disable users
- Track user's creator and createdTime
- undeletable entity
- disable user
- User DTO for remoting
- Send mail after user created
- validate user's uniqueness
- search users by created time and name
- positional parameter in query
- search users with pagination
- restful service with json
Get Started
If you use maven, you can add repository as below to pom.xml:
<repository> <id>polyform</id> <url>http://polyforms.googlecode.com/svn/repository</url> <snapshots> <enabled>false</enabled> </snapshots> </repository>
then you can add polyforms dependencies to your project:
<dependency> <groupId>cn.muthos.polyforms</groupId> <artifactId>cn.muthos.polyforms.repository</artifactId> <version>0.6.3</version> </dependency>
Modules
- cn.muthos.polyforms.util: some utility class for polyforms
- cn.muthos.polyforms.dao: common interfaces for DAO pattern
- cn.muthos.polyforms.jpa: dao implmentation with JPA(hibernate)
- cn.muthos.polyforms.repository:Generic entity repository and some annotations for entity seaching
- cn.muthos.polyforms.pagination:Pagination client has auto pagination.
- cn.muthos.polyforms.conversion:DTO conversion.
- cn.muthos.polyforms.bean:Some bean annotations such as Delegator for delegation and
- cn.muthos.polyforms.event:Business Event for domain, include asynchonized event.
dependencies:cn.muthos.polyforms.util, cn.muthos.polyforms.dao
dependencies:cn.muthos.polyforms.util, cn.muthos.polyforms.dao
dependencies:cn.muthos.polyforms.dao
dependencies:cn.muthos.polyforms.util, cn.muthos.polyforms.dao
dependencies:cn.muthos.polyforms.util, cn.muthos.polyforms.dao, cn.muthos.polyforms.conversion
dependencies:cn.muthos.polyforms.util, cn.muthos.polyforms.conversion