블로그 이미지
Max.

calendar

    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

Notice

2009.06.01 09:07 개발관련


 M1은 약간 실망입니다. A2에서는 모델간의 의존관계가 비교적 잘 되었습니다. 그런데 M1은 본 예제조차도 잘되지 않습니다. 심지여 petclinic.roo도 생성되지 않습니다. 모델(도메인)간의 의존관계에서 문제가 발생하는듯 합니다. 나중에 관련 소스를 찾아봐야 겠습니다. (Ben의 결혼 때문인지, 관련 세미나 때문인지... A1 처럼 부랴부랴 내논 느낌이네요. 그래도 조만간 버그픽스는 이루어 질듯 합니다. 지금처럼 빠르게 진행된다면요....)

아래는 테스트한 예제 입니다. A2에서는 잘 되고, M1에서는 잘 안됩니다. 아래 주석중 '관계' 부분만 주석처리하고 돌려보면, M1에서도 잘 생성됩니다. (ROO가 생성에 집중한 느낌이 자꾸 생기는데, 사실은 객체지향과 도메인지향에 포커싱하는걸 잊지 말아야 합니다. -_-;; )

/*
create project & jpa install
================================================================
*/
create project -topLevelPackage net.max.blog
install jpa -provider HIBERNATE -database HYPERSONIC_IN_MEMORY


/*
domain define
================================================================
*/
new persistent class jpa -name ~.domain.Article
new persistent class jpa -name ~.domain.Category
new persistent class jpa -name ~.domain.Comment


/*
add field
================================================================
*/
add field string -class ~.domain.Article -fieldName title -notNull -sizeMin 5 -sizeMax 30
add field date jpa -class ~.domain.Article -fieldName writeDate -type java.util.Date -notNull -past
add field string -class ~.domain.Category -fieldName name -notNull -sizeMin 2 -sizeMax 20
add field string -class ~.domain.Comment -fieldName content -notNull -sizeMin 2
add field date jpa -class ~.domain.Comment -fieldName writeDate -type java.util.Date -notNull -past


/*
add Test
================================================================
 new integration test -entity ~.domain.Article
 new integration test -entity ~.domain.Category
 new integration test -entity ~.domain.Comment
*/


/*
domain & aggregate Relation
   Category -< Article -< Comment
      1:N        1:N
================================================================         
add field set jpa -class ~.domain.Category -fieldName articles -element ~.domain.Article
add field reference jpa -class ~.domain.Article -fieldName category -type ~.domain.Category -notNull false
add field set jpa -class ~.domain.Article -fieldName comments -element ~.domain.Comment 
add field reference jpa -class ~.domain.Comment -fieldName article -type ~.domain.Article -notNull false
*/
// Category
 add field set jpa -class ~.domain.Category -fieldName articles -element ~.domain.Article
// Article
add field reference jpa -class ~.domain.Article -fieldName category -type ~.domain.Category -notNull false
add field set jpa -class ~.domain.Article -fieldName comments -element ~.domain.Comment 
// Comment
add field reference jpa -class ~.domain.Comment -fieldName article -type ~.domain.Article -notNull false


/*
add DTO
================================================================
 new java file -name ~.facade.ArticleDto
 new java file -name ~.facade.CategoryDto
 new java file -name ~.facade.CommentDto
*/


/*
add controller
================================================================
 new controller automatic -name ~.web.ArticleController -formBackingObject ~.facade.ArticleDto
 new controller automatic -name ~.web.CategoryController -formBackingObject ~.facade.CategoryDto
 new controller automatic -name ~.web.CommentController -formBackingObject ~.facade.CommentDto
*/
new controller automatic -name ~.web.ArticleController -formBackingObject ~.domain.Article
new controller automatic -name ~.web.CategoryController -formBackingObject ~.domain.Category
new controller automatic -name ~.web.CommentController -formBackingObject ~.domain.Comment


/*
selenium test
================================================================
 new selenium test -controller ~.web.ArticleController
 new selenium test -controller ~.web.CategoryController
 new selenium test -controller ~.web.CommentController
*/


/*
add logging
================================================================
*/
configure logging -level DEBUG

 

신고
posted by Max.
TAG ,

티스토리 툴바