æåã®éšåã§ã¯ãããžãã¹ãšã³ãã£ãã£ã®ã³ãŒãã®å±æ§ã䜿çšããŠãåçŽãªããžãã¹ã«ãŒã«ïŒããŒã¿å¶åŸ¡ã匷調衚瀺ã®å¶åŸ¡ããã£ãŒã«ãã®ã¢ã¯ã»ã·ããªãã£ãšå¯èŠæ§ïŒãè¿œå ããããšã«ãããeXpressAppãã¬ãŒã ã¯ãŒã¯ã®ãã©ãŒã ããã¢ãã¡ãŒã·ã§ã³åãããæ¹æ³ã«ã€ããŠèª¬æããŸããã ãã®ããŒãã§ã¯ãå¥åApplication Modelã¢ããªã±ãŒã·ã§ã³ã®XAFã¡ã¿ã¢ãã«ãèšå®ããŠãã®åé¡ã解決ããæ¹æ³ã«ã€ããŠèª¬æããŸãããŸããå®éããã®ã¡ã¿ã¢ãã«ãå¿ èŠãªçç±ãšå éšããæ§ç¯ããæ¹æ³ã«ã€ããŠèª¬æããŸãã
éçºè ã«ããã¡ã¿ã¢ãã«ã®æ¡åŒµãããžã¥ã¢ã«ãšãã£ã¿ãŒã®ã¢ãã«ãšãã£ã¿ãŒãä»ãããšã³ããŠãŒã¶ãŒã«ããã¡ã¿ã¢ãã«ã®ç·šéãªã©ãå¹ åºãå¯èœæ§ãå¿ããŸããã ãŸãããã®èšäºãèªãã åŸã¯ãXAFã¡ã¿ã¢ãã«ãšXAFMLèšè¿°èšèªãããç¥ãããŠãããã¹ãŠã®CSSãšXAMLïŒQMLãLSMLãªã©ïŒãããã³ãããã®æè¡ã«çµã¿èŸŒãŸãã詳现ãªã¢ã€ãã¢ã®éã«ããã€ãã®é¡äŒŒç¹ããããšæããŸãã ãã®ãããªå®¶åºçšèªè»¢è»ã®æ§é ã®çãã補åã«ã€ããŠè©³ããç¥ãããšãæããªã人ã¯ïŒã¡ãªã¿ã«ããã€ã¯ããœããã«ã¢ããã°ãç»å Žããåã«æžãããïŒãç«ã®äžã§æè¿ããŠãã ããã
ããžãã¹ãšã³ãã£ãã£ã³ãŒãã®å±æ§ãš ã¡ã¿ã¢ãã«ã®èšå®
ãããã£ãŠãåã®èšäºã®å ã®ããžãã¹ãšã³ãã£ãã£ã«äœãèµ·ãã£ãã®ããæ¹å€çã«èŠããšãããŸããŸãªå±æ§ã®è±å¯ããã誰ããééããªãæããããããšãã§ããŸãã
- [ DomainComponent ]
- ãããªã㯠ã€ã³ã¿ãŒãã§ã€ã¹ IAccount {
- [ RuleRequiredFieldãRuleUniqueValue ]
- [ RuleRegularExpression ïŒ @ "^ [_ a-z0-9-] +ïŒã[_ A-z0-9-] +ïŒ* @ [a-z0-9-] +ïŒã[A-z0-9-] +ïŒ *ïŒã[az] {2,4}ïŒ$ " ïŒ ]
- æååã¡ãŒã«{ get ; ã»ãã; }
- [ FieldSize ïŒ 25 ïŒ ]
- [ ImmediatePostData ]
- [å€èŠ³ïŒ "MarkUnsafePasswordInRed" ã "LenïŒãã¹ã¯ãŒãïŒ<6" ãFontColor = "Red" ïŒ ]
- string Password { get ; ã»ãã; }
- }
- [ XafDefaultProperty ïŒ "FullName" ïŒ ]
- [ DomainComponentãImageName ïŒ "BO_Person" ïŒ ]
- ãããªã㯠ã€ã³ã¿ãŒãã§ã€ã¹ IPerson {
- æåå LastName { get ; ã»ãã; }
- æåå FirstName { get ; ã»ãã; }
- [èšç®æžã¿ïŒ "ConcatïŒIsNullïŒFirstNameã ''ïŒã ''ãIsNullïŒLastNameã ''ïŒïŒ" ]
- æåå FullName { get ; }
- DateTime Birthday { get ; ã»ãã; }
- }
- [ DomainComponent ]
- ãããªã㯠ã€ã³ã¿ãŒãã§ã€ã¹ IOrganization {
- [ RuleRequiredField ]
- æåå Name { get ; ã»ãã; }
- [éèš]
- IList < IPerson > Staff { get ; }
- [ RuleRequiredField ïŒ TargetCriteria = "Staff.Count> 0" ïŒ ]
- [ DataSourceProperty ïŒ "Staff" ïŒ / *ãDataSourceCriteriaïŒ "StartsWithïŒFirstNameã '123'ïŒ"ïŒ* / ]
- [å€èŠ³ïŒ "ChangeManagerAvailabilityAgainstStaff" ã "Staff.Count = 0" ãVisibility = ViewItemVisibilityãHideãContext = "DetailView" ïŒ ]
- IPersonãããŒãžã£ãŒ{ get ; ã»ãã; }
- }
ããžãã¹ãšã³ãã£ãã£ã®ã³ãŒãã§ãŠãŒã¶ãŒã€ã³ã¿ãŒãã§ã€ã¹ã®å€èŠ³ãšåäœãçŽæ¥æå®ããå±æ§ãè±å¯ã«äœ¿çšããããšã¯ãããã¹ã¢ã³ããã©ãŒã²ããããããžã§ã¯ãã®éçºé床ãå€§å¹ ã«åäžãããã®ã«åœ¹ç«ã¡ãŸããã倧èŠæš¡ãããžã§ã¯ãã§ã¯ããã»ã©äŸ¿å©ã§ã¯ãããŸããã ãŸããeXpressApp Frameworkã¢ã»ã³ããªãžã®åç §ãæãŸãããªãå¯èœæ§ãããã·ããªãªãå¿ããªãã§ãã ããïŒããšãã°ãããžãã¹ãšã³ãã£ãã£ã®åãã©ã€ãã©ãªã䜿çšããããããã«ãå·Šãå±æ§ããªãXAF以å€ã®ãããžã§ã¯ãïŒã æåŸã«ãäžèš
ã¢ããªã±ãŒã·ã§ã³ã®ãŠãŒã¶ãŒã€ã³ã¿ãŒãã§ã€ã¹ã®å€èŠ³ãšåäœãæ§æããçæ³çã«ã¯ã€ã³ã¿ãŒãã§ã€ã¹ããåé¢ããå¿ èŠã®ããããžãã¹ããžãã¯ã«çŽæ¥é¢é£ããªãä»ã®èšå®ãä¿åããããã®å¥ã®éäžç®¡çãããå Žæãããã°çŽ æŽãããã§ãããã å¥ã®ã¬ãã«ãžã®èšå®ã®éšåçãŸãã¯å®å šãªè»¢éã¯ããŠãŒã¶ãŒã€ã³ã¿ãŒãã§ãŒã¹ããããžãã¹ããžãã¯ã®
ãã ãããããã®ã¢ãããŒãã®1ã€ãçæ³çã§ãããä»ã®ã¢ãããŒãã®äœ¿çšãçŠæ¢ãããŠããããšãæ確ã«èšãããšã¯ã§ããŸããã ããã©ãããããããã®ã¢ãããŒãã¯ãããããéçºè ã®æŠåšåº«ã§ã®äœçœ®ã«å€ãããã®ã§ããããããžã§ã¯ãã®æ¡ä»¶ïŒãµã€ãºãç·æ¥åºŠãªã©ïŒã«å¿ããŠé©çšããå¿ èŠããããšç¢ºä¿¡ããŠããŸãã ããšãã°ãã¡ã€ã³Webãµã€ãïŒããã³ããšã³ãïŒã¯éåžžã®ïŒéXAFïŒASP.NETã¢ããªã±ãŒã·ã§ã³ã§ãããã€ã³ã¿ãŒãã§ã€ã¹ã«ããžã¥ã¢ã«ASP.NETã³ã³ããŒãã³ãã䜿çšããããŒã¿ã¢ã¯ã»ã¹ã«ORMã©ã€ãã©ãªeXpressæ°žç¶ãªããžã§ã¯ãïŒXPOïŒã䜿çšããŸãã åæã«ãããžãã¹ãšã³ãã£ãã£ïŒé¡§å®¢ãåé¡ããã°ã¬ããŒãã質åãªã©ïŒãå«ãã©ã€ãã©ãªã¯ãeXpressAppãã¬ãŒã ã¯ãŒã¯ãžã®ãªã³ã¯ãæãããXAFã§èšè¿°ãããããã€ãã®å éšã¢ããªã±ãŒã·ã§ã³ïŒããã¯ãšã³ãïŒã§äœ¿çšãããŸãããXAFåºæã®å±æ§ãšãšã³ãã£ãã£ã䜿çšããŸããã ãã®å Žåããããã®ããžãã¹ãšã³ãã£ãã£ã®è¡šçŸã®ãã¹ãŠã®èšå®ã¯ãåã ã®XAFã¢ãžã¥ãŒã«ã®ã¡ã¿ããŒã¿ãéããŠè¡ãããŸãã
ã¢ããªã±ãŒã·ã§ã³ã¡ã¿ã¢ãã«ãŸãã¯ããã«ã¿ããã®...
ãã®ãããªXAFã®èšå®ã®ãªããžããªã¯ãUIã®å€èŠ³ãšåäœãèšè¿°ããã¡ã¿ããŒã¿ã®ã¬ã€ã€ãŒã§ããã¢ããªã±ãŒã·ã§ã³ã¢ãã«ã§ãã æè¡çã«ã¯ãããã¯1ã€ã®å±€ã ãã§ãªããéãåãã®åçã«åŸã£ãŠïŒåŒã®é ã®ããã«ïŒå€åãäºãã®äžã«éãªãå±€ã®éãŸãã§ãã æåã®å±€ãããããããŒãã
XAFã¢ããªã±ãŒã·ã§ã³ã®äžè¬çãªã¢ãŒããã¯ãã£ã«ãããã¡ã¿ã¢ãã«ã®å Žæãããããç解ããããã«ãå°ããªå³ã瀺ããŸãã
XAFçšèªã«ãããã¬ã€ã€ãŒéã®å€æŽãŸãã¯çžéã¯ãäžè¬ã«ã¢ãã«ã®çžéãšåŒã°ããŸãã ãããã£ãŠããããã®éããå«ãXMLã¢ãžã¥ãŒã«ãã¡ã€ã«ã®ååã¯ãModel.DesignedDiffs.XAFMLãã§ãã åã¬ã€ã€ãŒã®ã³ã³ãã³ããããã€ãã®æ¹æ³ã§å€æŽã§ããããšã«æ³šæããŠãã ããã
1.ç¹å¥ãªããžã¥ã¢ã«ãšãã£ã¿ãŒ- ã¢ãã«ãšãã£ã¿ãŒ ;
2. XAFMLãã¡ã€ã«ãçŽæ¥ç·šéããã
3.ããã°ã©ã ã³ãŒããéããŠã
ãã¹ãŠã®ã¬ã€ã€ãŒã®éãåããã«ãããæçµçãªã¢ããªã±ãŒã·ã§ã³ã¢ãã«ã圢æãããŸãã
ããã§ãã¢ããªã±ãŒã·ã§ã³ã®ãæçµãã¢ãã«ãšã¯ãéçºè ãäœããã®èŠçŽ ãŸãã¯ãã®ããããã£ãåç §ãããšãã«ã³ãŒãã§åãåããã®ãæå³ããŸãã ãŸããã¡ã¿ã¢ãã«èªäœã¯ãæ lazãã§ãã éãåããã¯ãå¿ èŠãªå Žåã«ã®ã¿èšç®ãããŸããããšãã°ãããçš®ã®ãŠãŒã¶ãŒã€ã³ã¿ãŒãã§ã€ã¹ç»é¢ãäœæããå¿ èŠãããå Žåãå éšAPIããã®èŠæ±ã«å¿ããŠèšç®ãããŸãã ããã§ããããã®èšç®ã¯ã¢ã¯ã»ã¹ããããã³ã«è¡ãããã®ã§ã¯ãªããå®è¡äžã«æ£ãããã£ãã·ã¥ãããããšã«æ³šæããããšãéèŠã§ãã
ããã§ã¯ã¬ã€ã€ãŒã«ã€ããŠè©³ãã説æããŠããŸããããã¬ãŒã ã¯ãŒã¯ã®ãã¬ãŒã ã¯ãŒã¯ã®å€ã«ã¯éåžžã«å€ãã®ã¢ããªã±ãŒã·ã§ã³ããã¯ãããžãŒããããã¬ã€ã€ãŒããŸã£ãããªããããXAMLãäŸã«æããŠããŸãã ãããã£ãŠãXAFã¢ããªã±ãŒã·ã§ã³ã®å€å±€ã¡ã¿ã¢ãã«ãäœæããäž»ãªçç±/èŠä»¶ã以äžã«ãªã¹ãããŸãã
1.è€æ°ã®ãã©ãããã©ãŒã çšã«ã¢ããªã±ãŒã·ã§ã³ãæè»ã«æ§æããæ©èœã
2.å®è¡æã®ã¢ããªã±ãŒã·ã§ã³æ§æã«ããéçºã®å éã
3.æšæºåäœãå€æŽããã«ã¹ã¿ã ã¢ãžã¥ãŒã«ã®ç°¡åãªéçºã
4.管çè ãæ¢ã«ãããã€ãããã¢ããªã±ãŒã·ã§ã³ãäžå çã«æ§æããæ©èœã
5.ãšã³ããŠãŒã¶ãŒã®ã¢ããªã±ãŒã·ã§ã³ã®å€èŠ³ãšåäœãåå¥ã«å€æŽããæ©èœïŒããšãã°ãã¢ã¯ã»ã¹æš©ã«åºã¥ããŠåçã«å€æŽããæ©èœïŒã
ã¡ã¿ã¢ãã«ã®å®çšäŸ
çè«ã¯ååã ãšæããŸãããå®éã«ã¡ã¿ã¢ãã«ã䜿çšããŠã¿ãŸãããã ãããè¡ãã«ã¯ãã¢ããªã±ãŒã·ã§ã³ãåæ§ç¯ãã以åã®ã¢ããªã±ãŒã·ã§ã³ã®ãã©ãããã©ãŒã ã«äŸåããªãã¢ãžã¥ãŒã«ã®Model.DesignedDiffs.xafmlãã¡ã€ã«ãããã«ã¯ãªãã¯ããŸãïŒãŸãã¯ãœãªã¥ãŒã·ã§ã³ãšã¯ã¹ãããŒã©ãŒã®ã³ã³ããã¹ãã¡ãã¥ãŒãã察å¿ããã³ãã³ããåŒã³åºããŸãïŒã
ããã«ãããäžã®å³ã«ç€ºãããã«ãã¢ãã«ãšãã£ã¿ãŒïŒã¢ãã«ãšãã£ã¿ãŒïŒãéããŸãã ç°¡åã«èšãã°ããã®ãšãã£ã¿ãŒã¯ãå·ŠåŽã«ãã¹ãŠã®ã¢ãã«èŠçŽ ããããå³åŽã«ããããã£ã€ã³ã¹ãã¯ã¿ãŒãããããªãŒãåããããªããã¹ãã«ã¿ã³ããªã€ã³ã¿ãŒãã§ãŒã¹ã§ãïŒã¢ãã«ã¬ã€ã€ãŒããã°ããæ€çŽ¢ãããŒã«ã©ã€ãºãããŒãžããããã®çµã¿èŸŒã¿ããŒã«ããããŸãããããã§ã¯è©³ãã説æããŸããïŒè±èªã®ããã¥ã¡ã³ãã«èšèŒãããŠããŸãïŒã
ãã®å³ãããã¡ã¿ã¢ãã«ã«ãã£ãŠå¶åŸ¡ãããã¢ããªã±ãŒã·ã§ã³ã®åŽé¢ããã°ããè©äŸ¡ã§ããŸãã ãšããã§ãããã§èŠãããã®ã¯ãçŸåšã®ã¢ãžã¥ãŒã«ãšãã®äŸåé¢ä¿ã§èŠã€ãã£ãã¿ã€ãã«åŸã£ãŠãXAFã«ãã£ãŠçæãããã¢ãã«ã®ãŒãã¬ã€ã€ãŒã®èŠèŠçè¡šçŸã§ãã
ãã©ãŒã ã®1ã€ã®å€èŠ³ïŒICustomer_ListViewïŒãçªç¶å°ãå€æŽããå¿ èŠããã£ããšæ³åããŠãã ããã 1ã€ã®åãåé€ããå¥ã®åã®äžŠã¹æ¿ããèšå®ããåã®é åºãå€æŽããæåŸã«ã¢ããªã±ãŒã·ã§ã³ããã·ã¢èªã«ããŒã«ã©ã€ãºãããšããã®XMLã¯å¯Ÿå¿ããã¬ã€ã€ãŒïŒHabr.Module / ModelDesignedDiffs.XAFMLïŒã«ä¿åãããŸããåã®ã¬ã€ã€ãŒãšã®éãïŒ
- <ïŒxml version = "1.0" encoding = "utf-8" ïŒ>
- <ã¢ããªã±ãŒã·ã§ã³ ã¿ã€ãã« = "HabrDemo" ã㎠= "ExpressAppLogo" >
- <ãã¥ãŒ>
- <ListView Id = "ICustomer_ListView" >
- <ã³ã©ã >
- <ColumnInfo Id = "Name" SortOrder = "Descending" />
- <ColumnInfo Id = "Email" Index = "1" />
- <ColumnInfo Id = "Manager" Index = "2" />
- <ColumnInfo Id = "ãã¹ã¯ãŒã" åé€ = "True" />
- </å>
- </ãªã¹ããã¥ãŒ>
- </ãã¥ãŒ>
- </ã¢ããªã±ãŒã·ã§ã³>
*ã¹ããŒã¹ãç¯çŽããããã«ãããã§ã¯åå¥ã®XAFMLãã¡ã€ã«ãäœæãããããŒã«ãªãŒãŒã·ã§ã³ãç¹ã«æäŸããŸããã
ã¢ããªã±ãŒã·ã§ã³ãå®è¡ãããšãèšå®ãæåŸ ã©ããã«é©çšãããŠããããšãããããŸãïŒåã®äžŠã¹æ¿ããšäžŠã¹æ¿ãã«æ³šæããŠãã ããïŒã
æè¡çã«ã¯ãããã¯ïŒæšæºXAFã¢ãžã¥ãŒã«ããã®ïŒã³ãŒããã¡ã¿ã¢ãã«ã«å€ãããããã«å¿ããŠã³ã³ãããŒã«ãæ§æããããšãæå³ããŸãã
ç¹ã«ãVisual Studioã§ã¯ãªããå®è¡æã«ã¢ããªã±ãŒã·ã§ã³ãã»ããã¢ããããã·ããªãªã匷調ããããšæããŸãã ãã®å Žåãã¢ããªã±ãŒã·ã§ã³ã®å®è¡äžã«è¡ããããã¹ãŠã®èšå®ã¯ãæåŸã®ã¬ã€ã€ãŒã§ãããŠãŒã¶ãŒèšå®ã¬ã€ã€ãŒã«åé¡ãããŸãã ããã©ã«ãã§ã¯ããã®æåŸã®ã¬ã€ã€ãŒã¯Model.User.XAFMLãã¡ã€ã«ã§è¡šãããŸãããçµéšãããã»ãšãã©ã®äººã¯ããŒã¿ããŒã¹å ã®ãã¡ã€ã«ã¹ãã¬ãŒãžã奜ã¿ãŸãïŒå°æ¥çã«ã¯ãããããã©ã«ãã®åäœã«ããå¯èœæ§ãé«ãã§ãïŒã 匷åãªDevExpressã³ã³ãããŒã«ã®ãããã§ãã¢ããªã±ãŒã·ã§ã³ã®ã»ããã¢ããã«ã¯ç¹å¥ãªã¹ãã«ãããŒã«ã¯å¿ èŠãªããã»ãšãã©ã®å Žåããšã³ããŠãŒã¶ãŒèªèº«ã§å®è¡ã§ããŸãã ããšãã°ããŠãŒã¶ãŒã¯ãèŠèŠã³ã³ãããŒã«èªäœã®ããŒã«ã䜿çšããŠã䞊ã¹æ¿ãããã£ã«ã¿ãŒã®ã°ã«ãŒãåããã©ãŒã äžã®ã³ã³ãããŒã«ã®å Žæããµã€ãºãªã©ãå€æŽã§ããŸãã ãã现ããªèª¿æŽãå¿ èŠã§ãäžçŽãŠãŒã¶ãŒãŸãã¯éçºè ã§ããå ŽåããµãŒãã¹ã«ã¯ã¢ãã«ãšãã£ã¿ãŒããããå®è¡æã«ã䜿çšã§ããŸãã
次ã«ãããžã¥ã¢ã«ãšãã£ã¿ãŒã䜿çšããŠè©³çŽ°ãªãã©ãŒã ããã°ããã«ã¹ã¿ãã€ãºããæ¹æ³ãèŠãŠã¿ãŸãããã ããã¯ãããªãããããŸã蚌æã§ããªããšæããŸãã
ããŽã ãèªåçæãã©ãŒã ã®æŠå¿µã¯ãåºæ¬çã«éçºè ã®äœæ¥ã楜ã«ããããšãç®çãšããŠããã2ã€ã®äž»ãªåé¡ã解決ããŸãã
1.éçºæ®µéã§ã®ãã©ãŒã ã®ãã䟿å©ã§è¿ éãªæ§æ
2.ãã䟿å©ãªå±éãšã¢ããªã±ãŒã·ã§ã³ãµããŒã
æåã®æ¹æ³ã¯ãææ¡ãããã¢ãããŒãã䜿çšãããšãæ°çŸã®ãã£ãŒã«ããè€éãªåœ¢ã«æããã®ã«äœæéãè²»ããå¿ èŠããªããããžãã¹ã¢ãã«ã«æ°ãããã£ãŒã«ãã衚瀺ãããå Žåã«ãã¹ãŠãããçŽãå¿ èŠãããããã§ãã ã¡ã¿ããŒã¿ã¯ããžãã¹ãšã³ãã£ãã£ã«åºã¥ããŠåçã«çæããããããéçºäžã«ããžãã¹ã¢ãã«ãèªç±ã«å€æŽã§ããå€æŽãã¢ããªã±ãŒã·ã§ã³ã¢ãã«ã«èªåçã«åœ±é¿ããããšã確èªã§ããŸãïŒãã¡ãããããžãã¹ãšã³ãã£ãã£ã®å€æŽããã©ãŒã èšå®ã«ãä¿®æ£ãããæ©äŒããããŸããããã«ã¯åœ±é¿ããŸããã§ããïŒã
2çªç®ã®æ¹æ³ã¯ããã©ãŒã ã®ã«ã¹ã¿ãã€ãºããšã³ããŠãŒã¶ãŒãŸãã¯ã¢ããªã±ãŒã·ã§ã³ç®¡çè ã«æäŸããæ©èœã«ããå¯èœã§ãããã®ã¿ã¹ã¯ã¯å®è¡æã«å®å šã«å®è¡ã§ããããã§ãã ãã«ãã¬ã€ã€ãŒã¢ããªã±ãŒã·ã§ã³ã¢ãã«ã«ããã管çè ã¬ãã«ã§ïŒæè¡çã«ã¯ã¢ãã«ã®äžéšã®ãµãã¬ã€ã€ãŒã§ïŒå¿ èŠãªå€æŽãäžåºŠè¡ãããšã§ããšã³ããŠãŒã¶ãŒã¢ããªã±ãŒã·ã§ã³ã®èšå®ãäžå çã«å€æŽã§ããŸãã
ã«ã¹ã¿ã èšå®ãã¡ã€ã³ã¢ããªã±ãŒã·ã§ã³ãŸãã¯ã¢ãžã¥ãŒã«ã®äžéšã«ããã«ã¯ãçµã¿èŸŒã¿ã¢ãã«ãšãã£ã¿ãŒã®ç¹å¥ãªæ¡åŒµæ©èœã§ããModel Merge Toolã䜿çšã§ããŸãã
ãã®ããŒã«ã䜿çšãããšãã¡ã¿ã¢ãã«ã®ãœãŒã¹ã¬ã€ã€ãŒãšã¿ãŒã²ããã¬ã€ã€ãŒãéžæããå®éã«ãããã1ã€ã«ããŒãžã§ããŸãã
ã¡ã¿ã¢ãã«ã®å éšæ§é ãšæ¡åŒµã«ã€ããŠããå°ã
äžèšã§ã¯ãXAFMLãã¡ã€ã«ã®äžéšã瀺ããŸããããããããã¢ããªã±ãŒã·ã§ã³ããã¥ãŒããªã¹ããã¥ãŒãããã³ã¡ã¿ã¢ãã«ã®å¥åã®èŠçŽ ã§ãããã®ä»ã®èŠçŽ ã«æ°ã¥ããã§ãããã å éšã§ã¯ããããã®èŠçŽ ã¯ãæåã®èšäºã§æ¢ã«ç¥ãããŠãããã¡ã€ã³ã³ã³ããŒãã³ãïŒDCïŒãã¯ãããžãä»ããŠå®è£ ãããŸãïŒå³å¯ã«ã¯ãSilverlightããå®å šãª.NETãšã»ãŒåãæ¹æ³ã§äž»èŠãªãã®ãåç §ãã軜éããŒãžã§ã³ãéããŠïŒïŒ
- ãããªã㯠ã€ã³ã¿ãŒãã§ã€ã¹ IModelListView ïŒ IModelObjectViewãIModelViewãIModelNode
- {
- IModelColumns Columns { get ; }
- [ DataSourceProperty ïŒ "Application.Views" ïŒ ãDataSourceCriteria ïŒ "ïŒAsObjectViewã¯Nullã§ã¯ãªãïŒããã³ïŒAsObjectView.ModelClassã¯Nullã§ã¯ãªãïŒããã³ïŒ '@ This.ModelClass'ã¯Nullã§ã¯ãªãïŒããã³ïŒAsObjectView.ModelClass.Name = '@ This.ModelClass.Name 'ïŒ " ïŒ ]
- IModelDetailView DetailView { get ; ã»ãã; }
- [ DataSourceProperty ïŒ "ModelClass.ListEditorsType" ïŒ ]
- EditorType { get ; ã»ãã; }
- IModelSorting Sorting { get ; }
- bool UseServerMode { get ; ã»ãã; }
- ...ããã³ãªããžã§ã¯ãã®ãªã¹ãïŒãªã¹ããã¥ãŒïŒã§ãã©ãŒã ãç¹åŸŽä»ãããã®ä»ã®ããããã£
- }
ããããDCã®äž»ãªæ©èœããæ¢ã«ç解ããŠããããã«ãã¢ãã«èŠçŽ ãè¡šããã¹ãŠã®ããžãã¯ãšãã£ãŒã«ããæã€å®éã®ã¯ã©ã¹ã¯ãã€ã³ã¿ãŒãã§ã€ã¹ãšé¢é£ããç¹å¥ãªããžãã¯ã¯ã©ã¹ããåçã«çµã¿ç«ãŠãããŸãã äžèšã§ãã¢ãã«ã§ã®èšç®å€ã®ãã£ãã·ã¥ã«ã€ããŠã¯æ¢ã«è¿°ã¹ãŸããããåçã¿ã€ãã®çæã¯éåžžã«é«éãªæäœã§ã¯ãªããããã¢ããªã±ãŒã·ã§ã³ã®ããŒããé«éåãããã£ãã·ã¥ããããŸãïŒç¹ã«ãããã®ã¿ã€ããæ°çŸããã³æ°åããå ŽåïŒã ã€ãŸããåçã¢ãã«ã¿ã€ãã®ã¢ã»ã³ããªã¯ãã¢ããªã±ãŒã·ã§ã³ãæåã«èµ·åããããšãã«äžåºŠã ãçºçããŸãã 次ã«ãå®è¡å¯èœãã¡ã€ã«ã®æšªã«ããç¹å¥ãªModelAssembly.dllã¢ã»ã³ããªã«ä¿åãããŸãïŒã¡ãªã¿ã«ãDCã§ãåãããšãè¡ããã DcAssembly.dllã«ã®ã¿å ¥ããŸã ïŒã 次ã«ãéåžžã©ãããããã®ã¢ã»ã³ããªããåãçŽæ¥èªã¿èŸŒãŸããŸãã ã¡ãªã¿ã«ããããã®2ã€ã®ã¢ã»ã³ããªãReflectorã§é 延ãããŠéããŠãããããã¹ãŠã®ã€ã³ã¿ãŒãã§ã€ã¹ãäœã«å€ãã£ããã確èªããŠãã ãã:-)
ã¢ãã«èŠçŽ ã®æšæºã»ããã¯ãããã©ã«ãã§æ°ããXAFãããžã§ã¯ãã«æ¥ç¶ããã·ã¹ãã ã¢ãžã¥ãŒã«ããååŸãããŸãã ã¬ã€ã€ãŒã¯ç°ãªããã¹ããŒããïŒXMLã®å ŽåïŒãæã€ããšãã§ããããšã«æ³šæããŠãã ããã ã¢ããªã±ãŒã·ã§ã³ã¢ãã«ã®èŠçŽ ã®ã¢ã¯ã»ã¹å¯èœãªã»ãããŸãã¯ã¹ããŒã ãããã¯ãã¬ã€ã€ãŒã®æ§ç¯ã«äœ¿çšãããã¢ãžã¥ãŒã«ã«çŽæ¥äŸåããŸãã ãããã£ãŠãããšãã°ããã©ãããã©ãŒã ã«äŸåããªãã¢ãžã¥ãŒã«ã§ãªã¹ããã¥ãŒæ§é ãå®çŸ©ããã¢ããªã±ãŒã·ã§ã³ã¢ãã«èŠçŽ ã§ããIModelListViewããããŸãã ãã©ãããã©ãŒã åºæã®èŠçŽ ã§ããIModelListViewWebãšIModelListViewWinãããããªããžã§ã¯ãã®ãªã¹ãã§ãã©ãŒã ãç¹åŸŽä»ããç¬èªã®ããããã£ã»ããããããŸãã å®éã«ã¯ãããã¯ãWebã¢ãžã¥ãŒã«ïŒHabr.Module.Web / ModelDesignedDiffs.XAFMLïŒã®ã¢ãã«ãšãã£ã¿ãŒãéããšãæ°ããèŠçŽ ãšãªãã·ã§ã³ãããšãã°SaveListViewStateInCookiesã衚瀺ãããããšãæå³ããŸãã
ãã®ã¹ããŒã ã¯ãè¿œå æ©èœãå®è£ ãããšãã«éçºè ã®è£éã§æ¡åŒµã§ããããšãéèŠã§ãã ããšãã°ãæšæºã®ãªã¹ããã¥ãŒèŠçŽ ïŒãŸãã¯ã³ãŒããææããŠããªãä»ã®èŠçŽ ïŒãèšå®ããããã®ç¬èªã®ãªãã·ã§ã³ãè¿œå ããã«ã¯ã次ã®ã³ãŒããã¢ãžã¥ãŒã«ã«è¿œå ããŸãã
- ãããªã㯠ã€ã³ã¿ãŒãã§ã€ã¹ IModelListViewEx {
- æåå MyCoolOption { get ; ã»ãã; }
- }
- public override void ExtendModelInterfaces ïŒ ModelInterfaceExtenders extenders ïŒ {
- ããŒã¹ã® ExtendModelInterfaces ïŒãšã¯ã¹ãã³ããŒïŒ ;
- ãšã¯ã¹ãã³ããŒã è¿œå < IModelListViewãIModelListViewEx > ïŒ ïŒ ;
- }
èŠçŽ ã³ãŒããææããŠããå Žåããã®ãªãã·ã§ã³ãã€ã³ã¿ãŒãã§ã€ã¹ã«è¿œå ããããã€ã³ã¿ãŒãã§ã€ã¹æ¡åŒµãæ瀺çã«ãããã¯ã¹ãããŸãã
- ãããªã㯠ã€ã³ã¿ãŒãã§ã€ã¹ IModelLayoutViewItem ïŒ IModelLayoutItemãIModelViewLayoutElementãIModelLayoutElementWithCaptionOptionsãIModelNodeãISupportControlAlignmentãIModelToolTipãIModelToolTipOptions
ãã¡ãããéçºè ã¯ããŒãã¬ã€ã€ãŒã®çæïŒå®éã«ã¯ãæšæºããã³ã«ã¹ã¿ã ã¢ãã«èŠçŽ ã®ç¬èªã®ãžã§ãã¬ãŒã¿ãŒãäœæã§ããŸãïŒãåäœã®ã«ã¹ã¿ãã€ãºãã¢ãã«ãšãã£ã¿ãŒã§ã®è¡šç€ºãªã©ãã¢ãã«æ§ç¯ã®ä»ã®åŽé¢ãæè»ã«å¶åŸ¡ã§ããŸãã
ãããã«
çµè«ãšããŠãäž»ã«ãã®ãããªåŒ·åãªãã«ãã¬ã€ã€ãŒããã³ãã€ãããã¯ã¡ã¿ããŒã¿ã¬ã€ã€ãŒãååšããããããã¬ãŒã ã¯ãŒã¯ã¯åãã³ãŒãããŒã¹ã䜿çšããŠè€æ°ã®ãã©ãããã©ãŒã ã®ã¢ããªã±ãŒã·ã§ã³ã€ã³ã¿ãŒãã§ãŒã¹ïŒãUI Scaffoldingããšããæµè¡èªãæ¿å ¥ããããåŸãŸããïŒãèªåçã«æ§ç¯ã§ããŸãäžè¬çã«ããããã¯ããžãã¹ãšã³ãã£ãã£ãã³ã³ãããŒã©ãŒãããŒã ããŠãŒã¶ãŒãšãã£ã¿ãŒãªã©ã§ãã ãããã£ãŠãç§ãã¡ã®ã±ãŒã¹ã§ã¯ãæ°åã®ãã¡ã«1ã€ã®ããžãã¹ãšã³ãã£ãã£ICustomerããæãããWindowsãšWebçšã®ã¢ããªã±ãŒã·ã§ã³ãäœæããã³æ§æããŸããã ãŸããäžè¬ã«ãäž»ã«ã¡ã¿ã¢ãã«ã®æ©èœã®ãããã§ããããã®ãã©ãããã©ãŒã ã®ããç¥ãããŠããæ¬ ç¹ãå¹³æºåãŸãã¯é ãããšã«ãã£ãŠãäžéšã®Windowsãã©ãŒã ããã³Webãã©ãŒã éçºè ã®ç掻ãæ¹åããŠããŸãã ãããã£ãŠãXAFã䜿çšãããšãéçºè ã¯XAMLã®æ¥œåãããã°ããºãã®é¡äŒŒç©ãååŸã§ããŸãããæ°ãããã®ãåŠã¶ããšã«æè³ããããšãªããéçºã¢ãããŒããå®å šã«å€æŽããããšãªããå€ãè¯ããã©ãããã©ãŒã ã«çãŸãããšãã§ããŸããäœå¹Žãçµã£ãä»ãXAFãžã®é¢å¿ãå®å®ããŠããããšã説æããŠãã ããã
ãã¡ããããã€ãã¹é¢ãããã€ããããŸãããããŠãŒã¶ãŒã®ããšã§ã¯ãªãããã®ãã¹ãŠã®éçºè ãšããŠã圌ãã¯ç§ãã¡ã ãã«é¢ä¿ããŠããŸãã å®éãç§ãã¡ã®ããŒã ã®å°æ°ã®äººã ã¯ãæ°åã®ãããã¯ãã¹ããšæ©èœãã¹ãã«ãããããããæãæŽããã«ç¥ãããšãªããã¡ã¿ã¢ãã«ãšã³ãžã³ã®ã³ã¢ã®ãã°ãä¿®æ£ããããšãè«ãè² ããŸã-ãšã©ãŒãç¯ããããå°ãªããšã誀ã£ãŠããã©ãŒãã³ã¹ãæªåããããªã¹ã¯ãå€ãããŸãã éãåã°ããã«ã¯ããããªãå¯äžã®ããšã¯ããã¬ãŒã ã¯ãŒã¯ã®6幎ã®æŽå²ã«ããã£ãŠããã¹ãŠã®å°å çŸæ£ããã§ã«æ²»çããŠãããã«ãŒãã«é åã«ã»ãšãã©ãã°ããªããšããäºå®ã§ã:-)
ãããŠæåŸã«ã ããã¥ã¡ã³ãã®å€æ°ã®èšäº ïŒè±èªïŒã§ãã¢ããªã±ãŒã·ã§ã³ã¡ã¿ã¢ãã«ã®æ©èœããã®æ¡åŒµãšæ§æã®æ¹æ³ãããã³XAFãã¬ãŒã ã¯ãŒã¯èªäœã«ã€ããŠè©³ããç¥ãããšãã§ããŸãã ååã®DevConã§ã®ãã¬ãŒã³ããŒã·ã§ã³ã§ãã®ãããªã«èå³ãæã€äººããããããããŸããããæéã®å¶çŽã®ããã補åãšãã®æ©èœã®éåžžã«äžè¬çãªæŠèŠã説æããå¿ èŠããã£ãããšãèŠåããŸãã