Cd Chen's Services

ba ba ba la~~

Spring

Spring Custom NamespaceHandler

自從接觸了 Spring 之後,發現他是一個很好玩的東西,尤其 IoC 與 AOP 的功能上,真的可以玩到半夜都睡不著覺!!

最近突發奇想,想要把 Domain Object (Model) 與 Service 透過 Annotation 綁的更緊一點,例如:

@EntityMeta(serviceClass = MyEntityService.class)
public class MyEntity implements IEntity<Long> {
  
   private Long id;

  // ...
}


public interface MyEntityService extends EntityService<MyEntity, Long> {

}

偶後就可以這樣搞:

You are here