åœç€Ÿã®äž»ãªæŽ»åã¯ãäŒæ¥æ å ±ã·ã¹ãã ã®éçºã§ãã ã«ã¹ã¿ã ã¡ã€ãã®ã·ã¹ãã ã«å ããŠã2ã€ã®è€è£œè£œåãäœæããŠããŸãã ãã¡ãããå¯èœãªéã䟿å©ã§æ©èœçãªè£œåãäœãããšããŠããŸãã ãã ããå®éã«ã¯ãåããžãã¹ã«ã¯ç¬èªã®ç¹æ§ããããåžžã«ã·ã¹ãã ã®æšæºæ©èœã«å¯Ÿå¿ããæºåãã§ããŠããããã§ã¯ãããŸããã ç¹å®ã®ã¯ã©ã€ã¢ã³ãåãã®ãœãªã¥ãŒã·ã§ã³ãå®æãããã¿ã¹ã¯ãšããã®ãããªããµããŒãããããŸãã æ¡åŒµå¯èœãªè£œåã®ã¢ãŒããã¯ãã£ãæŽçããããã®ã¢ãããŒãã¯äœã§ããïŒ éçºäžã«ã©ã®ãããªåé¡ãçºçããå¯èœæ§ããããŸããïŒ ç§ãã¡ã¯äœãããŸãããïŒ ä»¥äžã®ãã¹ãŠã«ã€ããŠã
å¯èœãªã¢ãããŒã
ãŸãããæ¡åŒµãããžã§ã¯ãããŸãã¯åã«ãæ¡åŒµãã«ãã£ãŠãç¹å®ã®é¡§å®¢åãã«å€æŽãå ãã補åãåŒã³åºãããšãæ確ã«ããŸãã 次ã«ã補åãæ¡åŒµããããã®å¯èœãªã¢ãããŒãã®ããã€ããèŠãŠã¿ãŸãããã
æ¡åŒµãããžã§ã¯ãããšã«ãªããžããªã§ãã©ã³ããåããŸã
ããããããããæåã«æãæµ®ãã¶ã®ã¯ãäž»ãªè£œåããåå²ããŠæ°ãããã©ã³ãã«å€æŽãå ããããšãæãŸããçµæãåŸãããã®æéã®æ¹æ³ã ããã§ãã å¯äžã®è³ªåã¯ããã®é床ã«å¯ŸããŠæ¯æãå¿
èŠãããäŸ¡æ Œã§ãã
æ å ±ã·ã¹ãã ã®éçºãšå®è£ ã®åŸãã©ã€ããµã€ã¯ã«ã®æãé·ããå€ãã®å Žåæãçã段éãå§ãŸããŸã-ãµããŒãã æ¡åŒµãããžã§ã¯ãã®å Žåããã®ãã§ãŒãºã¯äºéã«äžæå¿«ã«ãªãå¯èœæ§ããããŸããããã¯ã顧客ã«ç¹å¥ã«å®è£ ãããæ°ãããæ©èœãã ãã§ãªããæ¡åŒµã®ããŒã¹ãšãªã補åã®æ°ããããŒãžã§ã³ã顧客ã«æäŸããå¿ èŠãããããã§ãã 補åã®æ°ããããŒãžã§ã³ããã®å€æŽããããžã§ã¯ãã«åã蟌ãã«ã¯ã1ã€ã®æ¹æ³ããããŸããã¡ã€ã³ãã©ã³ãããæ¡åŒµãã©ã³ãã«å€æŽãããŒãžããŸãã ãããããããã©ãã»ã©æéãããããäž¡æ¹ã®ãã©ã³ãã§ã³ãŒãã®åãã»ã¯ã·ã§ã³ãå€§å¹ ã«å€æŽãããå Žåã«çºçããå¯èœæ§ã®ãããšã©ãŒã®æ°ãæ³åããŠãã ããã
ãã¡ããã補åã®æ°ããããŒãžã§ã³ãžã®å°æ¥ã®ç¿»èš³ã«ã€ããŠããã«èãããã¹ãŠã®ç¹å®ã®å€æŽãã¡ã€ã³è£œåã®ã³ãŒãããå¯èœãªéãé¢ããããã«ã³ãŒããç·šæããããšãã§ããŸãã çæ³çãªäžçã§ã¯ããã§åé¡ãããŸããããããªããšç§ã¯å³ããçŸå®ã«äœãã§ããŸããã¿ã¹ã¯ã®ç· ãåãã¯ãæšæ¥ããšããŠçºè¡šãããããšãå€ãããããžã§ã¯ãã¯ã¯ãŒã«ãªå°é家ã®ã³ã³ãã¯ããªããŒã ã§ã¯ãªããæšæ¥ã®åŠçã®å€§éã§ãã ãã®ãããªç¶æ³ã§ã¯ã人ã ã¯ãã£ãã«ã¢ãŒããã¯ãã£ã«ã€ããŠèãããæãæµæã®å°ãªãéããã©ããŸã-ä¿®æ£ããå ŽæãèŠã€ããå€ããã®ãåé€ããæ°ãããã®ãæžããŸããã ã¡ãªã¿ã«ãããã¯å¥ã®å€§ããªåé¡ã«ã€ãªãããŸã-æ¡åŒµããžãã¯ã¯è£œåããžãã¯ãšæ··åšããŠããŸãã
çµè«ïŒãã®ã¢ãããŒãã¯ã補åã®ããããéšåã絶察ã«å€æŽã§ãããããæãæè»æ§ããããŸãããæåã®2ã3ã®ã¢ããããŒãã®ã¿ãæè»æ§ãåã¶å¿ èŠããããŸãã ãã®åŸãæ¡åŒµæ©èœã®ãµããŒããšè£œåã®æ°ããããŒãžã§ã³ãžã®ç§»è¡ã«ããã倧ããªå°é£ãçããŸãã ããã«ãæ å ±ã·ã¹ãã ã®å¯¿åœãé·ããªãã°ãªãã»ã©ããµããŒãã«ãããæéã¯ãŸããŸãé·ããªããŸãã
æ å ±ã·ã¹ãã ã®éçºãšå®è£ ã®åŸãã©ã€ããµã€ã¯ã«ã®æãé·ããå€ãã®å Žåæãçã段éãå§ãŸããŸã-ãµããŒãã æ¡åŒµãããžã§ã¯ãã®å Žåããã®ãã§ãŒãºã¯äºéã«äžæå¿«ã«ãªãå¯èœæ§ããããŸããããã¯ã顧客ã«ç¹å¥ã«å®è£ ãããæ°ãããæ©èœãã ãã§ãªããæ¡åŒµã®ããŒã¹ãšãªã補åã®æ°ããããŒãžã§ã³ã顧客ã«æäŸããå¿ èŠãããããã§ãã 補åã®æ°ããããŒãžã§ã³ããã®å€æŽããããžã§ã¯ãã«åã蟌ãã«ã¯ã1ã€ã®æ¹æ³ããããŸããã¡ã€ã³ãã©ã³ãããæ¡åŒµãã©ã³ãã«å€æŽãããŒãžããŸãã ãããããããã©ãã»ã©æéãããããäž¡æ¹ã®ãã©ã³ãã§ã³ãŒãã®åãã»ã¯ã·ã§ã³ãå€§å¹ ã«å€æŽãããå Žåã«çºçããå¯èœæ§ã®ãããšã©ãŒã®æ°ãæ³åããŠãã ããã
ãã¡ããã補åã®æ°ããããŒãžã§ã³ãžã®å°æ¥ã®ç¿»èš³ã«ã€ããŠããã«èãããã¹ãŠã®ç¹å®ã®å€æŽãã¡ã€ã³è£œåã®ã³ãŒãããå¯èœãªéãé¢ããããã«ã³ãŒããç·šæããããšãã§ããŸãã çæ³çãªäžçã§ã¯ããã§åé¡ãããŸããããããªããšç§ã¯å³ããçŸå®ã«äœãã§ããŸããã¿ã¹ã¯ã®ç· ãåãã¯ãæšæ¥ããšããŠçºè¡šãããããšãå€ãããããžã§ã¯ãã¯ã¯ãŒã«ãªå°é家ã®ã³ã³ãã¯ããªããŒã ã§ã¯ãªããæšæ¥ã®åŠçã®å€§éã§ãã ãã®ãããªç¶æ³ã§ã¯ã人ã ã¯ãã£ãã«ã¢ãŒããã¯ãã£ã«ã€ããŠèãããæãæµæã®å°ãªãéããã©ããŸã-ä¿®æ£ããå ŽæãèŠã€ããå€ããã®ãåé€ããæ°ãããã®ãæžããŸããã ã¡ãªã¿ã«ãããã¯å¥ã®å€§ããªåé¡ã«ã€ãªãããŸã-æ¡åŒµããžãã¯ã¯è£œåããžãã¯ãšæ··åšããŠããŸãã
çµè«ïŒãã®ã¢ãããŒãã¯ã補åã®ããããéšåã絶察ã«å€æŽã§ãããããæãæè»æ§ããããŸãããæåã®2ã3ã®ã¢ããããŒãã®ã¿ãæè»æ§ãåã¶å¿ èŠããããŸãã ãã®åŸãæ¡åŒµæ©èœã®ãµããŒããšè£œåã®æ°ããããŒãžã§ã³ãžã®ç§»è¡ã«ããã倧ããªå°é£ãçããŸãã ããã«ãæ å ±ã·ã¹ãã ã®å¯¿åœãé·ããªãã°ãªãã»ã©ããµããŒãã«ãããæéã¯ãŸããŸãé·ããªããŸãã
åçå±æ§ã®äœ¿çšïŒEntity-Attribute-Valueã¢ãã«ïŒ
Entity-Attribute-ValueïŒãŸãã¯Open SchemaïŒã¢ãã«ãæšæºã®ãªã¬ãŒã·ã§ãã«ã¢ãã«ãšçµã¿åãããŠäœ¿çšââããŠãæ°ãããšã³ãã£ãã£å±æ§ã®å€ãåçã«èå¥ããŠä¿åã§ããŸãã EAVã¢ãã«ã䜿çšããå Žåãå±æ§å€ã¯éåžž3åã®åäžã®ããŒãã«ã«æžã蟌ãŸããŸãã ãæ³åã®ãšããããã®ååã¯ãšã³ãã£ãã£ãå±æ§ãå€ã§ãã
ã¹ããŒãã®å¿ é ã³ã³ããŒãã³ãã¯ãå±æ§ã®ã¡ã¿ããŒã¿ã®èª¬æãæ ŒçŽããããŒãã«ã§ããããŸãã
補åã§ãã®ã¢ãã«ã䜿çšããã«ã¯ã2ã€ã®ããšãè¡ãå¿ èŠããããŸãã
ãã®ã¢ãããŒãã®æãéèŠãªå©ç¹ã¯ãæ¡åŒµãããžã§ã¯ããäœæããå¿ èŠããªãããšã§ãã åºæ¬è£œåã¯é¡§å®¢ã«æäŸãããã»ããã¢ãããŸãã¯éçšã®æ®µéã§ããšã³ãã£ãã£ã®ä»»æã®æ°ã®åçå±æ§ãã»ããã¢ãããããŸãã
ããã«æ¬ ç¹ã«ã€ããŠã ãŸããéãããã¢ããªã±ãŒã·ã§ã³ã§ãã EAVã¢ãã«ã§ã¯ããšã³ãã£ãã£ã«å±æ§ãè¿œå ããããããç»é¢äžã®äºåå®çŸ©ãããå Žæã«è¡šç€ºããããšããã§ããŸããã ãã以äžã æ©èœã®å€æŽãããªãããŒãªUIã³ã³ããŒãã³ãã®è©±ã§ã¯ãããŸããã
第äºã«ãEAVã¢ãã«ã¯ããŒã¿ããŒã¹ãµãŒããŒã«å€§ããªè¿œå ã®è² è·ãäœæããŸãã ãªã³ã¯ãªãã§ãšã³ãã£ãã£ã®1ã€ã®ã€ã³ã¹ã¿ã³ã¹ãèªã¿èŸŒãã«ã¯ãããŒãã«ã®1ã€ãŸãã¯è€æ°ã®è¡ã®ä»£ããã«èªã¿åãå¿ èŠããããŸãã ããšãã°ãUIã®ããŒãã«ã«ã€ã³ã¹ã¿ã³ã¹ã®ãªã¹ããèªã¿èŸŒãã«ã¯ãéåžžãN + 1åã®ã¯ãšãªããŸãã¯ããŒãã«åã®æ°ã«å¿ããçµåãå¿ èŠã§ãã å€ãã®å ŽåãäŒæ¥ã·ã¹ãã ã®ããŒã¿ããŒã¹ã¯æãäœéã§æ¡åŒµæ§ã®äœãèŠçŽ ã§ããããããã®ãããªè¿œå ã®è² è·ã¯ã·ã¹ãã ãåçŽã«åæ¢ãããå¯èœæ§ããããŸãã
第äžã«ãããŒã¿ããŒã¹ã®æ§é ã«ãããã¬ããŒãçšã®ããŒã¿ãµã³ãã«ãäœæããããšã¯éåžžã«å°é£ã§ããéåžžã®SQLãèšè¿°ãã代ããã«ããªã¬ãŒã·ã§ãã«ããŒã¿ã¯ããè€éãªã¯ãšãªãå¿ èŠãšããŸãã
- ãšã³ãã£ãã£-ãã£ãŒã«ããèšè¿°ããŠãããªããžã§ã¯ããžã®åç §ãä¿åããŸãã éåžžãããã¯ãšã³ãã£ãã£èå¥åã§ãã
- å±æ§-å±æ§å®çŸ©ãžã®ãªã³ã¯ïŒè©³çŽ°ã¯ä»¥äžïŒã
- å€-å±æ§å€èªäœã
ã¹ããŒãã®å¿ é ã³ã³ããŒãã³ãã¯ãå±æ§ã®ã¡ã¿ããŒã¿ã®èª¬æãæ ŒçŽããããŒãã«ã§ããããŸãã
- å±æ§ã¿ã€ã
- å¶éïŒãã£ãŒã«ãé·ãå€ãäžèŽããå¿ èŠãããæ£èŠè¡šçŸãªã©ïŒ;
- UIã«è¡šç€ºããã³ã³ããŒãã³ãã
- ã³ã³ããŒãã³ããUIã«è¡šç€ºãããé åºã
補åã§ãã®ã¢ãã«ã䜿çšããã«ã¯ã2ã€ã®ããšãè¡ãå¿ èŠããããŸãã
- ã¡ã¿ããŒã¿ãæå®ããããã®ã¡ã«ããºã ãå®è£ ããŸããããšãã°ãçšèªå±æ§ãçµäºæ¥ãããå¥çŽãã¿ã€ãã®ãšã³ãã£ãã£ã«è¿œå ããããã£ãŒã«ãã¿ã€ãããæ¥ä»ãã«ãªãã衚瀺ã³ã³ããŒãã³ããDateFieldã«ãªãããã«æå®ã§ããŸãã
- å¿ èŠãªè£œåç»é¢ã«åçå±æ§ã®å€ã衚瀺ããã³å ¥åããã¡ã«ããºã ãå®è£ ããŸãã ã¡ã«ããºã ã¯ãã¡ã¿ããŒã¿ã®èª¬æãå«ãããŒãã«ã§ãã®ãšã³ãã£ãã£ã®å¯èœãªå±æ§ã®ã»ãããèŠã€ããç·šéçšã®ã³ã³ããŒãã³ãã衚瀺ããããŒã¿ãå«ãããŒãã«ã§å€ãæ€çŽ¢ããŠè¡šç€ºããç»é¢ãéãããšãã«ããããä¿åããå¿ èŠããããŸãã
ãã®ã¢ãããŒãã®æãéèŠãªå©ç¹ã¯ãæ¡åŒµãããžã§ã¯ããäœæããå¿ èŠããªãããšã§ãã åºæ¬è£œåã¯é¡§å®¢ã«æäŸãããã»ããã¢ãããŸãã¯éçšã®æ®µéã§ããšã³ãã£ãã£ã®ä»»æã®æ°ã®åçå±æ§ãã»ããã¢ãããããŸãã
ããã«æ¬ ç¹ã«ã€ããŠã ãŸããéãããã¢ããªã±ãŒã·ã§ã³ã§ãã EAVã¢ãã«ã§ã¯ããšã³ãã£ãã£ã«å±æ§ãè¿œå ããããããç»é¢äžã®äºåå®çŸ©ãããå Žæã«è¡šç€ºããããšããã§ããŸããã ãã以äžã æ©èœã®å€æŽãããªãããŒãªUIã³ã³ããŒãã³ãã®è©±ã§ã¯ãããŸããã
第äºã«ãEAVã¢ãã«ã¯ããŒã¿ããŒã¹ãµãŒããŒã«å€§ããªè¿œå ã®è² è·ãäœæããŸãã ãªã³ã¯ãªãã§ãšã³ãã£ãã£ã®1ã€ã®ã€ã³ã¹ã¿ã³ã¹ãèªã¿èŸŒãã«ã¯ãããŒãã«ã®1ã€ãŸãã¯è€æ°ã®è¡ã®ä»£ããã«èªã¿åãå¿ èŠããããŸãã ããšãã°ãUIã®ããŒãã«ã«ã€ã³ã¹ã¿ã³ã¹ã®ãªã¹ããèªã¿èŸŒãã«ã¯ãéåžžãN + 1åã®ã¯ãšãªããŸãã¯ããŒãã«åã®æ°ã«å¿ããçµåãå¿ èŠã§ãã å€ãã®å ŽåãäŒæ¥ã·ã¹ãã ã®ããŒã¿ããŒã¹ã¯æãäœéã§æ¡åŒµæ§ã®äœãèŠçŽ ã§ããããããã®ãããªè¿œå ã®è² è·ã¯ã·ã¹ãã ãåçŽã«åæ¢ãããå¯èœæ§ããããŸãã
第äžã«ãããŒã¿ããŒã¹ã®æ§é ã«ãããã¬ããŒãçšã®ããŒã¿ãµã³ãã«ãäœæããããšã¯éåžžã«å°é£ã§ããéåžžã®SQLãèšè¿°ãã代ããã«ããªã¬ãŒã·ã§ãã«ããŒã¿ã¯ããè€éãªã¯ãšãªãå¿ èŠãšããŸãã
ãã©ã°ã€ã³ã®ã¢ãŒããã¯ãã£
ãã®ã¢ãŒããã¯ãã£ã«ãããè¿œå ã®æ©èœãåå¥ã®ã¢ãŒãã£ãã¡ã¯ãïŒãã©ã°ã€ã³ïŒã«ä¿åã§ããŸãã 顧客ãããã€ãã®æ°ãã詳现ãæãã§ãããªããããªãã¯åœŒã«åºæ¬è£œåã眮ãããã©ã°ã€ã³ãæžãããããæ¥ç¶ããããã§å®äºã§ãã 補åã§ãã©ã°ã€ã³ã䜿çšããã«ã¯ãæ¡åŒµãã€ã³ãã宣èšããå¿
èŠããããŸãã ããã¯äœã§ãã åçŽãªå Žåããããã¯ã³ãŒãå
ã®ç¹å®ã®å Žæã§ãã ãããã®å Žæã§ã¯ãããŒãããããã©ã°ã€ã³ããœãŒããããç¹å®ã®æ¡åŒµãã€ã³ãçšã«èšèšããããã©ã°ã€ã³ã«ããžãã¯ããããã©ãããåæããããã®ãããªããžãã¯ãèŠã€ãã£ãå Žåã¯å®è¡ãããŸãã æ¡åŒµãã€ã³ãã®äŸïŒã¡ãã¥ãŒé
ç®ãã³ãã³ããã³ãã©ãããŒã«ããŒã®ãã¿ã³ãæ°ããç»é¢ã
å€éšã¹ã¯ãªããã§ã®ããžãã¯ãã€ãã³ããã³ãã©ã®èšè¿°ãªã©ãæ©èœãæ¡åŒµããããã«é »ç¹ã«äœ¿çšããããã®ãããªãªãã·ã§ã³ã¯ã次ã®ãããªãã©ã°ã€ã³ã®ããªãšãŒã·ã§ã³ã«èµ·å ããå ŽåããããŸãã ã¹ã¯ãªããã¯ãããã°ã©ã ã®ç¹å®ã®ãã€ã³ãã«ãã£ãŠåŒã³åºãããå®è¡ãããŸãã
ãã©ã°ã€ã³ã¢ãŒããã¯ãã£ã䜿çšãããšããã¹ãŠã®æ°ããæ©èœã補åãšã¯å¥ã«ä¿åã§ããŸããããã¯éèŠãªå©ç¹ã§ãã 補åãšãã©ã°ã€ã³ãå®å šã«ç©ççã«åé¢ããããšã«ããã補åãŸãã¯ãã©ã°ã€ã³ã®ããŒãžã§ã³ãæŽæ°ããããã»ã¹ãéåžžã«ç°¡åã«ãªããŸã-æŽæ°ãããã³ã³ããŒãã³ãã眮ãæããã ãã§ãã
ããããæ®å¿µãªãããããã«ã¯æ¬ ç¹ããããŸãã äžéšã®è£œåã§ã¯ãéèŠã§ã¯ãªãããšãå€æããŸããäžéšã®è£œåã§ã¯ããã©ã°ã€ã³ã¢ãŒããã¯ãã£ã䜿çšã§ããªããªãããšããããŸãã å®éããã©ã°ã€ã³ã¯ãæ¡åŒµãã€ã³ããå®çŸ©ãããŠããå Žæã§ã®ã¿ã·ã¹ãã ãæ¡åŒµã§ããŸãã ééããªããååãšããŠãã®ãããªå Žæã¯ã»ãšãã©ãªãããããã¯ãã¹ãŠäºåã«æ±ºå®ãããŠãã補åã®ã¯ã©ã¹ããããŸãããææ¥æ¡åŒµããå¿ èŠããããã®ãäºæž¬ããããšã¯ã»ãšãã©äžå¯èœãªå·šå€§ãªã°ã«ãŒãããããŸãã æœåšçãªæ¡åŒµå¯èœãªå Žæã®åæã¯éåžžã«ãªãœãŒã¹éçŽåã®ã¿ã¹ã¯ã«ãªãå¯èœæ§ãããããã®çµæãå®å šã«æ£ç¢ºã§ã¯ãªãããšãå€æããå ŽåããããŸãã ããã«ãæ¡åŒµãã€ã³ãã¯ã¡ã€ã³ã³ãŒãã®è€éãã§ãããåžžã«ãšã©ãŒãšã¡ã³ããã³ã¹ã®è€éãã䌎ããŸãã ã¡ã€ã³è£œåã®æ¡åŒµãã€ã³ãã®å®çŸ©ã«ã¢ãããŒãããããšã¯ãéåžžã«ææ ®æ·±ããã®ã§ãªããã°ãªããŸããã
å€éšã¹ã¯ãªããã§ã®ããžãã¯ãã€ãã³ããã³ãã©ã®èšè¿°ãªã©ãæ©èœãæ¡åŒµããããã«é »ç¹ã«äœ¿çšããããã®ãããªãªãã·ã§ã³ã¯ã次ã®ãããªãã©ã°ã€ã³ã®ããªãšãŒã·ã§ã³ã«èµ·å ããå ŽåããããŸãã ã¹ã¯ãªããã¯ãããã°ã©ã ã®ç¹å®ã®ãã€ã³ãã«ãã£ãŠåŒã³åºãããå®è¡ãããŸãã
ãã©ã°ã€ã³ã¢ãŒããã¯ãã£ã䜿çšãããšããã¹ãŠã®æ°ããæ©èœã補åãšã¯å¥ã«ä¿åã§ããŸããããã¯éèŠãªå©ç¹ã§ãã 補åãšãã©ã°ã€ã³ãå®å šã«ç©ççã«åé¢ããããšã«ããã補åãŸãã¯ãã©ã°ã€ã³ã®ããŒãžã§ã³ãæŽæ°ããããã»ã¹ãéåžžã«ç°¡åã«ãªããŸã-æŽæ°ãããã³ã³ããŒãã³ãã眮ãæããã ãã§ãã
ããããæ®å¿µãªãããããã«ã¯æ¬ ç¹ããããŸãã äžéšã®è£œåã§ã¯ãéèŠã§ã¯ãªãããšãå€æããŸããäžéšã®è£œåã§ã¯ããã©ã°ã€ã³ã¢ãŒããã¯ãã£ã䜿çšã§ããªããªãããšããããŸãã å®éããã©ã°ã€ã³ã¯ãæ¡åŒµãã€ã³ããå®çŸ©ãããŠããå Žæã§ã®ã¿ã·ã¹ãã ãæ¡åŒµã§ããŸãã ééããªããååãšããŠãã®ãããªå Žæã¯ã»ãšãã©ãªãããããã¯ãã¹ãŠäºåã«æ±ºå®ãããŠãã補åã®ã¯ã©ã¹ããããŸãããææ¥æ¡åŒµããå¿ èŠããããã®ãäºæž¬ããããšã¯ã»ãšãã©äžå¯èœãªå·šå€§ãªã°ã«ãŒãããããŸãã æœåšçãªæ¡åŒµå¯èœãªå Žæã®åæã¯éåžžã«ãªãœãŒã¹éçŽåã®ã¿ã¹ã¯ã«ãªãå¯èœæ§ãããããã®çµæãå®å šã«æ£ç¢ºã§ã¯ãªãããšãå€æããå ŽåããããŸãã ããã«ãæ¡åŒµãã€ã³ãã¯ã¡ã€ã³ã³ãŒãã®è€éãã§ãããåžžã«ãšã©ãŒãšã¡ã³ããã³ã¹ã®è€éãã䌎ããŸãã ã¡ã€ã³è£œåã®æ¡åŒµãã€ã³ãã®å®çŸ©ã«ã¢ãããŒãããããšã¯ãéåžžã«ææ ®æ·±ããã®ã§ãªããã°ãªããŸããã
ã©ããã£ãŠããã®
ECMïŒãŸãã¯ããäžè¬çãªçšèªã§èšããšãé»åææžç®¡çã·ã¹ãã ãEDMSïŒ TESISãšã¿ã¯ã·ãŒããžãã¹Sherlockãèªååããã·ã¹ãã ãšãã2ã€ã®è€è£œè£œåãåžå Žã«æå ¥ããŸããã æåããæããã§ãããç¹å®ã®ã¯ã©ã€ã¢ã³ãã«æã䟿å©ãªã·ã¹ãã ãæäŸããããã«ã¯ã補åéçºãå¿ èŠã«ãªãããã補åã¯å®¹æã«æ¡åŒµå¯èœãªã¢ãŒããã¯ãã£ã«åºã¥ããŠããå¿ èŠããããŸãã
æ°ããæ¡åŒµæ©èœã®äœæ¥ãéå§ãããšããç§ãã¡ã¯ãã®ãããžã§ã¯ããã©ã®ãã¢ã³ã¹ã¿ãŒãïŒèšèã®æå³ã§ã¯ïŒã«æé·ã§ããããæšæž¬ããããšããããŸããã§ããã ããããã®ã¯ãå°ããªã«ã¹ã¿ãã€ãºãšããŠå§ãŸã£ããã®ããã»ãŒå®å šã«æžãçŽãããããžãã¹ããã»ã¹ãšãç»é¢ã®ååã®è¿œå ããžãã¯ã§çµããããšã§ãã ããã«ããã®è£œåã¯æ°ããæ©èœã§æ¡åŒµããããšãã§ããŸããããã¯ç¬ç«ããã·ã¹ãã ã«ã¯ååã§ãã äŸãšããŠã倧èŠæš¡ãªåæ£äŒæ¥åãã®TESISã®æ¡åŒµãããžã§ã¯ãã§ã¯ã財åã®èªååãåŸæ¥å¡ã®æå¹æ§ã®è©äŸ¡ãããã³ããã€ãã®ããè€éãªã¢ãžã¥ãŒã«ãç»å ŽããŸããã
ããŸããŸãªèŠä»¶ããã®éãããã³äºæž¬äžèœæ§ã«ãããäžèšã®ãããã®æ¹æ³ã䜿çšã§ããŸããã§ããã ãã®äžã補åããŒãžã§ã³ã¯ããªãå®æçã«å ¬éãããŸãã ããã«ãããæ¡åŒµãããžã§ã¯ãã補åã®æ°ããããŒãžã§ã³ã«ç°¡åã«è»¢éã§ããããšãèŠæ±ãããŸãã
æ¡åŒµæ©èœã®äœæãšãµããŒãã®åé¡ãã©ã®ããã«è§£æ±ºããŸããïŒ
æ¡åŒµãããžã§ã¯ã
åœç€Ÿã®ãããžã§ã¯ãã®ã»ãšãã©ã¯ãCUBAãã©ãããã©ãŒã ã䜿çšããŠäœæãããŠããŸãã 以åã®èšäºã® 1ã€ã§ãã§ã«æžããŠããŸãã æ¡åŒµãããžã§ã¯ãã®ç·šææ¹æ³ãç解ããã«ã¯ããŸããã©ãããã©ãŒã èªäœã®ããã€ã¹ãæ±ãå¿ èŠããããŸãã
ã€ãŸããCUBAã¯äžé£ã®ã¢ãžã¥ãŒã«ã§ããããããããç¹å®ã®æ©èœãæäŸããŸãã
- ãã¥ãŒã-ã¢ããªã±ãŒã·ã§ã³ã®ã³ã¢ãã€ã³ãã©ã¹ãã©ã¯ãã£å šäœãããžãã¹ããžãã¯ãæŽçããããã®ããŒã«ãèŠèŠã³ã³ããŒãã³ãã®ã©ã€ãã©ãªãã»ãã¥ãªãã£ãµãã·ã¹ãã ãªã©ãå«ãŸããŸãã
- ã¬ããŒã-ã¬ããŒãçæãµãã·ã¹ãã
- fts-å šææ€çŽ¢ãµãã·ã¹ãã
- ãã£ãŒã-ãã£ãŒãåºåãµãã·ã¹ãã
- ã¯ãŒã¯ãããŒ-ããžãã¹ããã»ã¹ç®¡çãµãã·ã¹ãã
- ccpayments-ã¯ã¬ãžããã«ãŒããµãã·ã¹ãã
åãµãã·ã¹ãã ã«ã¯ãããžãã¹ããžãã¯ãåããæ°žç¶çãªãšã³ãã£ãã£ãç»é¢ãããã³ãµãŒãã¹ãå«ããããšãã§ããŸãã
æ°ãããããžã§ã¯ããäœæãããšããæ©èœãå¿ èŠãªãã©ãããã©ãŒã ã®ããŒã¹ã¢ãžã¥ãŒã«ãžã®äŸåé¢ä¿ã¯ããã«ãã¹ã¯ãªããã«èšè¿°ãããŸãã ãã®åŸãæ¥ç¶ãããã¢ãžã¥ãŒã«ã®ãšã³ãã£ãã£ãç»é¢ãããã³ãµãŒãã¹ã䜿çšããŠããããžã§ã¯ãã®å®è£ ãéå§ããŸãã ç©ççã«ã¯ããã©ãããã©ãŒã ã¢ãžã¥ãŒã«ã¯jarãã¡ã€ã«ã§ããããµãŒããŒã«ã€ã³ã¹ããŒã«ããããããžã§ã¯ãã¯éåžžã®Java Webã¢ããªã±ãŒã·ã§ã³ã§ãã
ãã©ãããã©ãŒã äžã§æ¢åã®è£œåãæ¡åŒµããå¿ èŠãããå Žåããããè¡ããŸããæ°ãããããžã§ã¯ããäœæããŸããããã«ãã¹ã¯ãªããã§ã¯ããã©ãããã©ãŒã ã¢ãžã¥ãŒã«ã§ã¯ãªãæ¡åŒµå¯èœãªè£œåãžã®äŸåã瀺ããŸãã 補åèªäœã¯ãå®éã«ã¯éçºãã©ãããã©ãŒã ãšããŠæ©èœããŸãã
ããã§ãæ¡åŒµãããžã§ã¯ãå ã§ãæ°ãããã¡ã€ã³ã¢ãã«ãªããžã§ã¯ããäœæããCUBAãã©ãããã©ãŒã äžã®æãäžè¬çãªãããžã§ã¯ãã®ããã«æ°ãããŠãŒã¶ãŒã€ã³ã¿ãŒãã§ã€ã¹ãèšè¿°ã§ããŸãã éçºè ã¯ãäžäœã¢ãžã¥ãŒã«ã®ãã¹ãŠã®æ©èœãåŒãç¶ãå©çšã§ããŸãã
æãæãããªå©ç¹ã¯ããã¹ãŠã®æ°ããããžãã¯ãåå¥ã®æ¡åŒµãããžã§ã¯ãã«ä¿åãããããšã§ãã çŸåšã®æ¡åŒµæ©èœã®äžéšãšããŠããã€äœãæžããããåžžã«ç¢ºèªã§ããŸãã ãã®ã¢ãããŒãã¯ããã©ã°ã€ã³ã¢ãŒããã¯ãã£ãšEAVã®ããã«ãéçºè ãæ°ããæ©èœã®çš®é¡ã«å¶éãããã®ã§ã¯ãããŸããã
æ¡åŒµæ©èœã補åã®æ°ããããŒãžã§ã³ã«å€æããããã»ã¹ã¯æ¬¡ã®ãšããã§ãã
- ãã«ãã¹ã¯ãªããã§è£œåã®æ°ããããŒãžã§ã³ãæå®ããæ¡åŒµæ©èœãåæ§ç¯ããŸãã
- æ¡åŒµæ©èœãå®å®ãã補åAPIã®ã¿ã䜿çšããŠããå Žåãããã ãã§ã-é«åºŠãªè£œåãèµ·åããŠãã ããã
- å±éãããã€ã³ãã§è£œåãå€§å¹ ã«å€æŽãããå Žåãæ¡åŒµã³ãŒããå€æŽããå¿ èŠãããå ŽåããããŸãã ååãšããŠãããã¯ãŸãã«ããçºçãããåé¡ãç¹å®ããã®ã¯ç°¡åã§ãã ãã°ä¿®æ£è£œåãªãªãŒã¹ã¯åžžã«æ¡åŒµæ©èœãšäºææ§ããããŸãã
æ¡åŒµæ©èœã§ã¯ãæ°ãããšã³ãã£ãã£ãããžãã¹ããžãã¯ãããã³ãããã®ç»é¢ãç°¡åã«äœæã§ããããšã¯æããã§ãã ãããããã§ã«è£œåã«ãããã®ãå€æŽããã«ã¯ã©ãããã°ããã§ããïŒ ããšãã°ã補åãšã³ãã£ãã£ã«ãã£ãŒã«ããè¿œå ããŠãæ¢åã®ç»é¢ã«è¡šç€ºããŸããïŒ
ããŒã¹ãããã¯ããšã³ãã£ãã£ã«æ°ããå±æ§ãè¿œå ãã
ã¿ã¹ã¯ãèªåçšã«å®çŸ©ããŸããããŒã¹è£œåã®
User
ãšã³ãã£ãã£ã§ãäœæãä¿åãããã£ãŒã«ããè¿œå ããå¿ èŠããããŸãã ãã®ãããªèŠä»¶ã¯ãããããã客æ§ã®éã§æãäžè¬çã§ãã ãã©ãããã©ãŒã ãäžèšã®åçå±æ§ã¢ãã«ããµããŒãããŠããããšãããã«èšãå¿ èŠããããŸãããå®éã«ã¯ãã®ãªãã·ã§ã³ã¯ã»ãšãã©äœ¿çšãããŸãã-ããŒã¿ãµã³ããªã³ã°é床ãšã¬ããŒãã®å®¹æãã¯ãã»ãšãã©ã®å ŽåéèŠãªèŠä»¶ã§ãã
å®éã«ã¯ãå±æ§ãè¿œå ãã代æ¿æ¹æ³ã«ã€ããŠã ORMãã©ãããã©ãŒã ãšããŠãOpenJPAã䜿çšãããŸãã 補åã®ãšã³ãã£ãã£å®£èšã¯æ¬¡ã®ãšããã§ãã
@Entity(name = "product$User") @Table(name = "PRODUCT_USER") public class User extends StandardEntity { @Column(name = "LOGIN") protected String login; @Column(name = "PASSWORD") protected String password; //getters and setters }
ã芧ã®ãšãããããã¯ãšã³ãã£ãã£ã®æšæºçãªèª¬æã§ãããJPAã®ããŒãã«ããã³ããŒã¿ããŒã¹åãžã®ãããã³ã°ã§ãã
æ¡åŒµãããžã§ã¯ãã«ãšã³ãã£ãã£ãŒç¶æ¿ãäœæããŸãã
@Entity(name = "ext$User") @Extends(User.class) public class ExtUser extends User { @Column(name = "ADDRESS", length = 100) private String address; public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } }
ç¶æ¿ã¡ã«ããºã ã¯ãæãéèŠãª
@Extends
泚éãé€ããOpenJPAã®æšæºã§ãã
ExtUser
ã¯ã©ã¹ãUserã¯ã©ã¹ã®ä»£ããã«æ®éçã«äœ¿çšãããããšã宣èšããã®ã¯åœŒå¥³ã§ãã
ããã§ã
User
ãšã³ãã£ãã£ãäœæãããã¹ãŠã®æäœã§ãæ¡åŒµãšã³ãã£ãã£ã®ã€ã³ã¹ã¿ã³ã¹ãäœæãããŸãã
User user = metadata.create(User.class); // ExtUser
ããŒã¿ããŒã¹ããã®ããŒã¿æœåºæäœããæ°ãããšã³ãã£ãã£ã®ã€ã³ã¹ã¿ã³ã¹ãè¿ããŸãã ããšãã°ãããŒã¹è£œåã§ã¯ãååã«ãããŠãŒã¶ãŒæ€çŽ¢ãµãŒãã¹ãè¿ããã次ã®JPQLã¯ãšãªã®çµæãè¿ãããŸãã
select u from product$User u where u.name = :name
@Extends
ã¢ãããŒã·ã§ã³ããªããã°ãåºåã«
User
ãªããžã§ã¯ãã®ã³ã¬ã¯ã·ã§ã³ãããã
ExtUser
ããã¢ãã¬ã¹ãååŸããã«ã¯ãããŒã¿ããŒã¹ãã以åã®ãªã¯ãšã¹ãã®çµæãåèªã¿èŸŒã¿ããå¿ èŠããããŸãã ãããã
@Extends
ã¢ãããŒã·ã§ã³ã«ãã£ãŠæäŸãããåå®çŸ©æ å ±ã䜿çšããŠããã©ãããã©ãŒã ã¡ã«ããºã ã¯ãªã¯ãšã¹ããäºåçã«å€æããæ¡åŒµ
ExtUser
ãšã³ãã£ãã£ã®ãªããžã§ã¯ãã®ã³ã¬ã¯ã·ã§ã³ã
ExtUser
ãŸãã ããã«ãä»ã®ãšã³ãã£ãã£ã
User
ãžã®ãªã³ã¯ãæã£ãŠããå Žåãæ¡åŒµæ©èœãæ¥ç¶ããããšããããã®ãªã³ã¯ã¯ãœãŒã¹ã³ãŒããå€æŽããã«
ExtUser
åã®ãªããžã§ã¯ããè¿ããŸãã
ãšã³ãã£ãã£ãåå®çŸ©ãããŸãã ããã§ãæ°ãããã£ãŒã«ãããŠãŒã¶ãŒã«è¡šç€ºãããšããã§ãããã
ãã©ãããã©ãŒã ç»é¢ã¯ãXML + Javaã®æã§ãã XMLã¯å®£èšçã«UIãèšè¿°ããJavaã³ã³ãããŒã©ãŒã¯ã€ãã³ãã«å¯Ÿããåå¿ã決å®ããŸãã Javaã³ã³ãããŒã©ãŒãåå®çŸ©ããŠãç¹å¥ãªåé¡ãçºçããªãããšã¯æããã§ãããXMLæ¡åŒµæ©èœã䜿çšãããšå°ãè€éã«ãªããŸãã
User
ãšã³ãã£ãã£ã«
address
ãã£ãŒã«ããè¿œå ããŠãåã®äŸã«æ»ããŸãããã
æãåçŽãªç»é¢ã®ã¬ã€ã¢ãŠãã®èª¬æã¯æ¬¡ã®ããã«ãªããŸãã
<window datasource="userDs" caption="msg://caption" class="com.haulmont.cuba.gui.app.security.user.edit.UserEditor" messagesPack="com.haulmont.cuba.gui.app.security.user.edit" > <dsContext> <datasource id="userDs" class="com.haulmont.cuba.security.entity.User" view="user.edit"> </datasource> </dsContext> <layout spacing="true"> <fieldGroup id="fieldGroup" datasource="userDs"> <column width="250px"> <field id="login"/> <field id="password"/> </column> </fieldGroup> <iframe id="windowActions" screen="editWindowActions"/> </layout> </window>
UserEditorã¹ã¯ãªãŒã³ã³ã³ãããŒã©ãŒãžã®ãªã³ã¯ãããŒã¿ãœãŒã¹å®£èšïŒdatasourceïŒããšã³ãã£ãã£ãã£ãŒã«ãã衚瀺ããfieldGroupã³ã³ããŒãã³ããããã³æšæºã¢ã¯ã·ã§ã³ãOKãããã³ãCancelãïŒwindowActionsïŒã®ãããã¬ãŒã ã衚瀺ãããŸãã
æ¡åŒµãããžã§ã¯ãã§åºæ¬ç»é¢ã³ãŒããè€è£œããããªãã®ã§ããã©ãããã©ãŒã ã«XMLç»é¢èšè¿°åãç¶æ¿ããæ©èœãè¿œå ããŸããã ããã¯ãåºæ¬ãããžã§ã¯ãããã®ç»é¢ç¶æ¿è ã®ããã§ãã
<window extends="/com/haulmont/cuba/gui/app/security/user/edit/user-edit.xml"> <layout> <fieldGroup id="fieldGroup"> <column> <field id="address"/> </column> </fieldGroup> </layout> </window>
ç¥å ç»é¢ã¯ç¥å ïŒextendså±æ§ïŒã瀺ããããŒã¹ç»é¢ã«è¿œå ãŸãã¯åå®çŸ©ããå¿ èŠãããã³ã³ããŒãã³ãã®ã¿ã説æããŸãã åºæ¬ç»é¢ã®èå¥åã䜿çšããŠãæ§æãã¡ã€ã«ã§ç»é¢ã宣èšããã ãã§ãã
<screen id="sec$User.edit" template="com/sample/sales/gui/extuser/extuser-edit.xml"/>
çµæïŒ
ããžãã¹ããžãã¯ã®ãªãŒããŒã©ã€ã
æ©èœã®åå®çŸ©ã«é¢ããŠã¯ãããã§ã¯ãã¹ãŠãéåžžã«ç°¡åã§ãã ãã©ãããã©ãŒã ã€ã³ãã©ã¹ãã©ã¯ãã£ã¯Springã«å®è£ ãããŠããŸãã ãããã£ãŠãããžãã¹ããžãã¯ãæã€ãµãŒãã¹ã¬ã€ã€ãŒã¯ãã¹ããªã³ã°é§ååBeanã§ãã ãã¬ãŒã ã¯ãŒã¯ã«ãã£ãŠæäŸãããæ¡åŒµæ©èœã¯ãå¿ èŠãªããžãã¹ããžãã¯ãåå®çŸ©ããã®ã«åå以äžã§ãã ãããæ確ã«ç€ºãããã«ãåã³å°ããªäŸã瀺ããŸãã åºæ¬è£œåã®äžéå±€ã«ãäŸ¡æ Œèšç®ãå®è¡ããã³ã³ããŒãã³ãããããšä»®å®ããŸãã
@ManagedBean("product_PriceCalculator") public class PriceCalculator { public void BigDecimal calculatePrice() { //price calculation } }
æ¡åŒµãããžã§ã¯ãã®äŸ¡æ Œèšå®ã¢ã«ãŽãªãºã ã眮ãæããããã«ã2ã€ã®ç°¡åãªæé ãå®è¡ããŸãã
åå®çŸ©ãããã³ã³ããŒãã³ãã®ç¶æ¿ãäœæããŸãã
public class ExtPriceCalculator extends PriceCalcuator { @Override public void BigDecimal calculatePrice() { //modified logic goes here } }
åºæ¬è£œåã®binèå¥åã䜿çšããŠãSpringæ§æãã¡ã€ã«ã«ã¯ã©ã¹ãç»é²ããŸãã
<bean id="product_PriceCalculator" class="com.sample.extension.core.ExtPriceCalculator"/>
ããã§ãSpringã³ã³ããã¯åžžã«ExtPriceCalculatorã®ã€ã³ã¹ã¿ã³ã¹ãè¿ããŸãã
ãããã¯ã®åå®çŸ©
ãšã³ãã£ãã£ãç»é¢ã®ã³ã³ããŒãã³ããããã³ããžãã¹ããžãã¯ã®å€æŽã«ãããç§ãã¡ã¯ææ¡ããŸããã 次ã®è¡ã¯èŠèŠçãªããŒãã§ãã
ãã©ãããã©ãŒã ã䜿çšããŠäœæãããç»é¢ã¯ãWebããã³ãã¹ã¯ãããã¯ã©ã€ã¢ã³ãã§æ©èœããŸãã çŸæç¹ã§ã¯ãäž»ã«Webã¯ã©ã€ã¢ã³ãã䜿çšããŠããããããããã¯ã®ã«ã¹ã¿ãã€ãºã«ã€ããŠã¯ãããããæ€èšããŸãã
Web UIãå®è£ ããããã«ã人æ°ã®ããVaadinãã¬ãŒã ã¯ãŒã¯ãéžæããŸããã Vaadinã§ã¯ãSCSSã«é¢ãããããã¯ã説æã§ããŸãã æ°ããSCSSããŒãã®ã¹ã¿ã€ã«ã®èª¬æã¯ãçŽç²ãªCSSãããäœåã楜ãããã®ã§ãã å€ãã®ãã©ã¡ãŒã¿ãŒãå€æ°ã«å ¥ããããšã§ãããŒãã®äœæããã»ã¹ã®æéãããã«ççž®ããŸããã
éçºã¹ã¿ãžãªã䜿çšããŠã2åã®ã¯ãªãã¯ã§æ°ãããããã¯ã®ç©ºçœãäœæãããŸãã æ°ããããŒãã¯ãã©ãããã©ãŒã ã®åºæ¬ããŒãã®ã¹ã¿ã€ã«ãã€ã³ããŒãããŸããéçºè ã¯å¿ èŠãªã¹ã¿ã€ã«ãšå€æ°ãåå®çŸ©ããã ãã§ãã å€ãã®é¡§å®¢ã¯ãæ å ±ã·ã¹ãã ãäŒç€Ÿã®ã³ãŒãã¬ãŒãã«ã©ãŒã§èŠãããšèããŠããŸãã ãããã¯ãæ¡åŒµããããã®ã¢ãããŒãã«ãããç°¡åã«ãããå®çŸã§ããŸãã
æ¡åŒµãããžã§ã¯ãã§ã¯ãéçºè ã¯æ°ããããžã¥ã¢ã«ã³ã³ããŒãã³ããæ¥ç¶ã§ããŸãã å€æ°ã®æ¢è£œã®ã³ã³ããŒãã³ããVaadinã¢ããªã³ãªããžããªã§å©çšå¯èœã§ãã å¿ èŠãªã³ã³ããŒãã³ããããã«èŠã€ãããªãã£ãå Žåã¯ãèªåã§äœæã§ããŸãã
ããŸããŸãªèŠèŠããŒãã®äŸïŒ
ãããã«
ç§ãã¡ã®ã¢ãããŒããããªãã«ãšã£ãŠèå³æ·±ããšæãããå Žåã¯ã CUBAãã©ãããã©ãŒã ãèªåã§è©Šãããšãã§ããŸãã ãã©ãããã©ãŒã ã§è£œåãäœæãããšãèšèŒãããŠããæ¹æ³ã§è£œåãèªåçã«ã«ã¹ã¿ãã€ãºã§ããŸãã ãã£ãŒãããã¯ãšã³ã¡ã³ããåžžã«æè¿ããŸãïŒ
PSã¿ã€ãã«åçã®äœè ã¯ã€ãªã€ã»ãã«ã©ã¢ãã§ãã 圌ã®ããã°ã§ããã«è±ªè¯ãªããã¹ã¿ã³ãã©ãã¯ãèŠã€ããããšãã§ããŸãã