ãã®è¨äºã¯ 株式会社SUPER STUDIO - Qiita Advent Calendar 2024 - Qiitaã®16æ¥ç®ã®è¨äºã«ãªãã¾ãã
2æ¥ç®ã«å ¬éãã以ä¸ã®è¨äºã§ãå ±éå¦çã®å®è£ æ¹éã«ã¤ãã¦æ©ãã§ãã¨ããå 容ã®è©±ãæ¸ãã¾ããã
ä»åã¯ä¸è¨ã®æ稿ãããå度ã¾ãæ©ã¿å§ãã¾ããã¨ããè¨äºã«ãªãã¾ãã åæ°ã1ä¸åè¿ãã«ãªã£ã¦ãã¾ãã¾ãã...ãæ¥ãã®æ¹ã¯è¶³ãæ¢ããã«å ã«é²ãã§ãã ããã
- fqqkãããã¡ãã£ã¨è¯ãã§ããï¼ð
- å ±éåã¨æ§é åã®éãã«ã¤ãã¦
- ãªãFATã¢ãã«ã¯çã¾ããã®ã
- ã¢ãã«ã«å¿ è¦ãªè²¬åãæ®ãã¤ã¤ãå¥ã®è²¬åãã©ãåãæ±ã£ã¦ããã®ãè¯ãã®ã
- æ§é åã¸ã®éãæ¢ã
- ã¾ã¨ã
- åè
fqqkãããã¡ãã£ã¨è¯ãã§ããï¼ð
2æ¥ç®ã®è¨äºãæ稿ãã¦ãããä¼ç¤¾ã®å¤§å 輩ã«ãªã³ã©ã¤ã³ä¼è°å®¤ã§å£°ãããã¦ããã ãããææãããã ãã¾ããã
å 容ã¨ãã¦ã¯
ã¬ã¤ã¤ã¼ã¨ããè¨èããã£ã¦ã»ããã£ã
moduleã§ãspecãæ¸ãã«ããã¨ãããã¨ã¯ãªã
ãµã¼ãã¹ã¯æ¨ªæçã«ä½ããããããã«å°å ¥ãããã®
ãã®ææããã¨ã«æ¹ãã¦è¨äºãæ¼ã£ã¦ã以ä¸ã®èãã«ãã©ãçãã¾ããã
å ±éåæ段ã®æ¤è¨ããåã«ãã¾ãã¯ãã¡ã¤ã³ã«åãåããå ±éåã®æ°é ãæãããã¨ãããã¦ããã®æ°é ãæãããã«æ§é åãè¡ãã
ä»åã¯ä¸è¨ã®èããèªåãªãã«è½ã¨ãè¾¼ã¿ãå®éã«ã³ã¼ãã«ã©ã®ããã«åãåã£ã¦ããã°ããã®ãç·´ç¿ãã¦ã¿ã¾ãããã¨ããå 容ãæ¸ããè¨äºã§ãã
å ±éåã¨æ§é åã®éãã«ã¤ãã¦
ããããå ±éåã¨æ§é åã¯å ·ä½çã«ã©ãéãã®ã§ããããï¼
以ä¸ã®è¨äºãç解ãè¨èªåã®å©ãã«ãªãã¾ãã
共通化という考え方はアンチパターンを生み出すだけ説 - タオルケット体操
å ±éåã¨ããåã®ä¸ã«ãããªãããã®ã¯ãåããã¸ãã¯ãæã¤ã³ã¼ããã¾ã¨ãããè¡çº
æ½è±¡åã¨ããã®ã¯ãã¸ãã¯ãæå³åä½ãã¨ã«ã²ã¨ãããã«ãã¦ããè¡çºãçæ³ã®ç¶æ ãä½ãä¸ããããã®æéã
ãã®è¨äºãèªãã§ãèªåã®ä¸ã«æ§é åã¨ããè¦ç¹ãããããæãè½ã¡ã¦ããã¨ãããã¨ã«æ°ã¥ããã¨ãã§ãã¾ããã
ããã¦ããã®ãæ§é åãã¨ããè¡çºã¯ãåã«ããã®ç®æã¨ãã®ç®æã®ã³ã¼ãã®ãã¸ãã¯ãåãã ããå ±éåããããããããªãã¡ã¯ã¿ã§ãããããçãªè¦ç¹ã§ç¼ã®åã®ã³ã¼ãã¨å¯¾å³ãã¦ãã¦ãè¦ãã¦ã¯ãã¾ããã
ä»ã®èªåã®ä¸ã«ããè¨èã§è¡¨ç¾ããã¨ãããã以ä¸ã®ããã«ãªãã¾ãã
Railsã®ã¢ãã«(ãã¡ã¤ã³ãã¸ãã¯ããã¸ãã¹ãã¸ãã¯ã®ç½®ãå ´)ããã£ãã観å¯ãã¦ããã®ã¢ãã«æ¬æ¥ã®è²¬åã¨ã¯æ¯è²ãç°ãªãå¦çãæ¸ããã¦ããã¨ãããã¨ã«ã¾ãã¯æ°ã¥ãã æ¸ããã¦ãããã®ãå°ãªãã¨ãã¯ã¾ã ãã®å§¿ã¯è¦ãã¾ããã ãã ãããã¢ãã«ãè²ã£ã¦ãã¦ãå°ãFATãªã¢ãã«ã«ãªã£ã¦ããã¨ãã«ããã©ãããä»ã®ãã®ã¢ãã«ã¯æ¬æ¥ã¯ãããã責åãæ ãã¹ãã ãã©ãAã¨ããå¥ã®è²¬åãæ ã£ã¦ãããã ãªã ãã®è²¬åãè¨èã§è¡¨ç¾ããã¨ä¾ãã°ã©ããããã®ãããã ããã...ð¤
ã¨ããæèã®æµãã®ä¸ã§æµ®ãã³ä¸ãã£ã¦ãããã®ã¨ãããµãã«æãã¦ãã¾ãã
ãªãFATã¢ãã«ã¯çã¾ããã®ã
FATã¢ãã«ã«å¯¾ãã¦ã¢ããã¼ãããä¸ã§ãä¸è¨ã§èª¬æãã"æ§é å"ã¨ããè¡çºãã¾ããã¦ããã®ã大åã¨ãã話ãªã®ã§ãããããããã©ããã¦ã¢ãã«ã¯FATã«ãªãã®ã§ããããã Rails㯠ãMVC + ActiveRecord(ORM)ãã§ããã ãã®MVCãã¬ã¼ã ã¯ã¼ã¯(å³å¯ã«ã¯MV*ç³»ãã¬ã¼ã ã¯ã¼ã¯)ã¨ããã®ã¯Martin Fowleræ°ã®PDS(Presentation Domain Separation)*1ãå®ç¾ããããã«åå¨ãã¾ãã PDSã¨ã¯ããããã«ããã¨ããã¬ã¼ã³ãã¼ã·ã§ã³å±¤ããã以å¤ããã§ã¬ã¤ã¤ã¼ããããè¨è¨ååã®ãã¨ã§ãã
å ãã¦Railsã¯ActiveRecordã¨ããORMãæ¡ç¨ãã¦ãã¾ããããã®ActiveRecordã¨ããORMã¯ãActiveRecordãã¿ã¼ã³*2ã¨ããè¨è¨ãã¿ã¼ã³ãé©ç¨ããORMã®ãã¨ã®ããã§ãã
ãã®è¨è¨ãã¿ã¼ã³ã¯ãã¼ã¿ãã¼ã¹ã®ã¬ã³ã¼ãã¨å¯¾å¿ããã¯ã©ã¹ãä½æãã¦ããã¼ã¿ã¢ã¯ã»ã¹ã®ã¡ã½ããã¨ãã¡ã¤ã³ãã¸ãã¯ãæãããã¨ãããã®ã*3
- DBã¬ã³ã¼ãã¨å¯¾å¿ãããã¼ã¿ãæã¤
- ãã¼ã¿ã¢ã¯ã»ã¹ã¡ã½ãããæã¤
- ãã¡ã¤ã³ãã¸ãã¯ãæã¤
ãã¡ã¤ã³ãã¸ãã¯ãDBã¨å¯çµåã«ãªã代ããã«ãå®è£ ã³ã¹ããä½ããªãã¨ããç¹å¾´ãããã¾ãã
ãã®ãããRailsã¯ãã¢ãã«ãDBã«å¼·ãä¾åãããã¨ãåãå ¥ãã代ããã«ãéçºè ãã¹ãã¼ãã£ã¼ã«éçºã§ããããã«ä½ããã¦ãããã¨ããããã§ãã
ã¢ãã«ããã¡ããã«ãªã£ã¦ããã¨ããã®ã¯ãRailsã®ã¢ãã«ãActiveRecordã¨å¯ã«é¢ãã£ã¦ãã¦ãPDSã«ãããããã¬ã¼ã³ãã¼ã·ã§ã³ä»¥å¤ãã®ãã¸ãã¹ãã¸ãã¯ããã¡ã¤ã³ãã¸ãã¯ã®ç½®ãå ´ãä½ãæãå ãã¦ããªãRailsã§ã¯ã¢ãã«ãããªããããéçºãé²ãã¦ããã«ããããã¢ãã«åºæã®ãã¸ãã¯ã§ãããã¡ã¤ã³ãã¸ãã¯ä»¥å¤ã®ãã¸ãã¹ãã¸ãã¯ããã®ã¢ãã«ã«æ¸ããã¦ãã¾ããã¢ãã«ã®è²¬åãè¨ããã§ãããã¨ããæµãããªã¨æãã¾ãã ãã ãããã¯ActiveRecordãã¿ã¼ã³ãæ¡ç¨ããã¨ãããã®æ³å®ã®ç¯å²å ã®è©±ãªã®ããªã¨æã£ã¦ãã¦ãRailsã§ãã¾ãã¢ããªãè²ã¦ã¦ããæ¹æ³ãã¼ããã¡ã«ã¯ãã£ã¨æ®ããã¦ããã¯ãã ããRailsã¯ãããæä¾ãã¦ããã¦ãã¾ããã¨ããã®ãå¾åã¯æ¸ãã¦ããã¾ãã
ã¢ãã«ã«å¿ è¦ãªè²¬åãæ®ãã¤ã¤ãå¥ã®è²¬åãã©ãåãæ±ã£ã¦ããã®ãè¯ãã®ã
Railsã®ã¢ãã«ã®è²¬ä»»ã¯ãè¨è¨ãã¿ã¼ã³ãã以ä¸ã®ããã§ããã¹ãã ã¨ãããã¾ããã
- DBã¬ã³ã¼ãã¨å¯¾å¿ãããã¼ã¿ãæã¤
- ãã¼ã¿ã¢ã¯ã»ã¹ã¡ã½ãããæã¤
- ãã¡ã¤ã³ãã¸ãã¯ãæã¤
ã¡ãªã¿ã«ãä¸è¨ãæºãããã¦ããªãã¢ãã«ãé¥ã£ã¦ããç¶æ ãããã¡ã¤ã³ã¢ãã«è²§è¡ç*4ã¨å¼ãã ããã¾ãã
ãã¡ã¤ã³ãã¸ãã¯ã¨ããè¨èãããã¾ã§å¹³æ°ã§ä½¿ã£ã¦ãã¾ãããããã¡ã¤ã³ãã¸ãã¯ã¨ãã¸ãã¹ãã¸ãã¯ã¯ä¼¼ã¦éãªããã®ã¿ãããªãã§ãããã*5
ãã¸ãã¹ãã¸ãã¯ã¨ã¯ãä¼æ¥ããã¸ãã¹ãéè¡ããéã®ã«ã¼ã«ãæ¡ä»¶ãããã»ã¹ãã³ã¼ãã§è¡¨ç¾ãããã®
ãã¡ã¤ã³ãã¸ãã¯ã¨ã¯ããã¸ãã¹ãã¸ãã¯ã®ä¸é¨ã§ãããã¾ãããç¹å®ã®ããã¡ã¤ã³ãã¾ãã¯æ¥çç¹æã®ç¥èãã«ã¼ã«ãã³ã¼ãã§è¡¨ç¾ãããã®
ã¹ã¿ãã¯ãªã¼ãã¼ããã¼ã«ããããªãããã¯ãããã¾ããã
architecture - What is domain logic? - Stack Overflow
èªåãããããããã£ãåçã¯ãã®ãããã§ãã
Domain is the world your application lives in. So if you are working on say a flight reservation system, the application domain would be flight reservations.Business Logic on the other hand is a more discrete block of the entire Application Domain. Business Logic is usually a section of code built to perform one specific business process. So you would have business logic to take a reservation. Another bit of business logic would be code to refund cancelled tickets.The objects that support your business process then become your business objects!(ãã¡ã¤ã³ã¯ãã¢ããªã±ã¼ã·ã§ã³ãåå¨ããä¸çã§ãããã¨ãã°ããã©ã¤ãäºç´ã·ã¹ãã ã«åãçµãã§ããå ´åãã¢ããªã±ã¼ã·ã§ã³ ãã¡ã¤ã³ã¯ãã©ã¤ãäºç´ã«ãªãã¾ããä¸æ¹ããã¸ãã¹ ãã¸ãã¯ã¯ãã¢ããªã±ã¼ã·ã§ã³ ãã¡ã¤ã³å ¨ä½ã®ããåå¥ã®ãããã¯ã§ãããã¸ãã¹ ãã¸ãã¯ã¯é常ãç¹å®ã®ãã¸ãã¹ ããã»ã¹ãå®è¡ããããã«æ§ç¯ãããã³ã¼ãã®ã»ã¯ã·ã§ã³ã§ããã¤ã¾ããäºç´ãåãããã®ãã¸ãã¹ ãã¸ãã¯ãããã¾ãããã¸ãã¹ ãã¸ãã¯ã®ãã 1 ã¤ã®é¨åã¯ããã£ã³ã»ã«ããããã±ãããæãæ»ãã³ã¼ãã§ãããã¸ãã¹ ããã»ã¹ããµãã¼ããããªãã¸ã§ã¯ãããã¸ãã¹ ãªãã¸ã§ã¯ãã«ãªãã¾ãã)
ã¾ã以ä¸ã®è¨äºã大å¤åèã«ãªãã¾ããã
「ビジネスロジック」とは何か、どう実装するのか #設計 - Qiita
å ã»ã©Fatãªã¢ãã«ã¨ããã®ã¯ãã¢ãã«åºæã®ãã¡ã¤ã³ãã¸ãã¯ã®ä»ã«ããã¸ãã¹ãã¸ãã¯ãå¢ãã¦ãã¦ãã¾ã£ã¦ããç¶æ ã®ã¢ãã«ã¨ãã話ããã¾ããã ããã¦ãã®ç¶æ ã®ã¢ãã«ãããæ°ãã«è²¬åãè¦åºãã¦ããè¡çºãæ§é åã§ããã¨ã
ããã§ãä¸ã®ä¸ã§ãµã¼ãã¹ã¬ã¤ã¤ã¼ã«ã¤ãã¦å¦å®çãªå£°ãããã®ã¯ããã®æ§é åã¨ããè¡çºããã¥ãããªãã¨ããã®ãçç±ã®ä¸ã¤ãªã®ããªã¨æãã¾ãã ð¤
ã©ããããã¨ãã¨ããã¨ãæ¬æ¥ãã®ã¢ãã«ã®è¿ãã«ããã¹ããã¸ãã¹ãã¸ãã¯ãå¥ã®ã¬ã¤ã¤ã¼ã«åãåºããã¦ããå ´åãå°æ¥çã«æ§é åã¨ããè¡çºãè¡ã£ã¦ããã®ã大å¤ã«ãªãããããªããã¨ã ä¸ã¤ã®ã¢ãã«ã®ä¸ã«ããããã®ãã¸ãã¹ãã¸ãã¯ãæ£ãã°ã£ã¦ããç¶æ ã¨ããã®ã¯ãä¸è¦ã¾ã¨ã¾ãããªãããããã¾ããããæ°ãããã¡ã¤ã³ã¢ãã«ãè¦åºãã¦ããããã®ãã³ããããã«éç´ããã¦ããç¶æ ã¨ãæãããã¾ãã ãã®ãããã©ãã«ç½®ãã¹ããä»ã¯è¦åºããã¨ãã§ããªã...ã¨ããå ´åã¯ä¸æ¦ã¢ãã«ã«ãã¸ãã¹ãã¸ãã¯ãæ¸ãã¦ãã¢ãã«ãè²ã¦ã¦ãããã¨ããã®ãè¯ãã®ããªã¨å人çã«ã¯æãã¾ããã ãã®ããã§ããããã«ããã¯ã¡ãã£ã¨è¨ãããããªãã¨ããã¿ã¤ãã³ã°ã§æ§é åä½æ¥ãè¡ã£ã¦ããããã§ããããã®ä½æ¥èªä½ãã¡ã¤ã³ãã©ãæãããï¼ã¨ããæ½è±¡çãªè©±ã§ããããããããªè¦ç¹ãå¿ è¦ã«ãªããã¨ãããé¢ä¿è ãå·»ãè¾¼ãã§è°è«ã®ä¸ã§æ±ºãã¦ããã¨ããã®ãè¯ãããã ãªã¨æãã¾ããã
æ§é åã¸ã®éãæ¢ã
ã§ã¯å®éã«ããæ§é åããã¦ãããï¼ã¨ãªãã¨ãããã¤ãæ¥ããããããªãã®ã§ãã¡ãã£ã¨ç·´ç¿ãã¦ã¿ããã¨æãã¾ããç·´ç¿ãªã®ã§å¤±æãã¦ãè¯ããã ....
è¨ããã§ããã¢ãã«ãç®ã®åã«ããã¨ãã¦ããã®ã¢ãã«ã観å¯ãããã¡ã¤ã³ãã¸ãã¯ä»¥å¤ã«ã©ã®ãããªè²¬åãæ±ãã¦ããã®ãï¼ããã¯ã©ã®ããã«è¡¨ç¾ã§ããã®ãï¼Railsã¯è²¬åã®åé¢ãããããã«ä½ãæä¾ãã¦ããã¦ããã®ãï¼ãããã«ã¤ãã¦èãã¦ããã¾ãã
ECãµã¼ãã¹ãä¾ã«ãã¦ã¿ã¾ãã 顧客ã注æããã¦ãã¤ã³ããä»ä¸ãããã¦ã¼ã¹ã±ã¼ã¹ãèãã¦ã¿ã¾ãã
ãã¡ã¤ã³ã¢ãã«
class Customer < ApplicationRecord has_many :orders has_many :points validates :name, presence: true end class Order < ApplicationRecord belongs_to :customer has_many :order_items validates :total_price, numericality: { greater_than_or_equal_to: 0 } def total_price order_items.sum(quantity * price) end end class OrderItem < ApplicationRecord belongs_to :order validates :quantity, numericality: { greater_than: 0 } validates :price, numericality: { greater_than_or_equal_to: 0 } end class Point < ApplicationRecord belongs_to :customer validates :amount, numericality: { greater_than_or_equal_to: 0 } end
ãã¤ã³ãä»ä¸ã®ãã¸ãã¯ãOrderã«åå¨ããã±ã¼ã¹ã
class Order < ApplicationRecord belongs_to :customer has_many :order_items validates :total_price, numericality: { greater_than_or_equal_to: 0 } def total_price order_items.sum(quantity * price) end # 注ææã«ãã¤ã³ããä»ä¸ããã¡ã½ãã def apply_points points_earned = complex_calc_points customer.points.create(amount: points_earned) end # è¤éãªãã¤ã³ãç®åºå¦ç def complex_calc_points # ifæããããããã£ãããã¦ãä¾ãã°100è¡ãããããã¨ãã¾ãã # ãã¤ã³ãä»ä¸çãå¯å¤ # ãã¤ã³ãã®ç¨®é¡ãè¤æ° # ãã¤ã³ãå士çµã¿åããã¦å©ç¨ã§ãã # ç¹å®ã®ååè³¼å ¥ã®å ´åã«ãã¤ã³ããã¤ãããã end end
å注ã®ãã¡ã¤ã³ãã¸ãã¯ã£ã¦ãªãã§ããããã
注æãä½æãããããä½æããã注æãçºéããããã¨ãã£ã移ãå¤ããã§ããããï¼
ã¡ã½ããã¨ãã¦ã¯ãcomplete
ã¨ããshipped
ã¨ãã®ã¿ãããã°å¥å
¨ã¨ããå°è±¡ã§ãã
ãã®ãããå注ã®åè¨éé¡ã¨ãã¤ã³ãä»ä¸çããããã¤ã³ãæ°ãè¨ç®ãã顧客ã«ä»ä¸ãããã¨ããä»äºã¯Orderã§ã¯ãªãä½ãå¥ã®ãã¡ã¤ã³ã¢ãã«ãæã¤ã¹ã責åã§ããã¨èãããããã§ãã
ãããããã¨ã¨ãã¦ã¯ãOrderãã責åã移åã¯ããããã ãã©ãå ¨ãå¥ã®ã¨ããã«ç½®ãããã§ã¯ãªããè¿ãã¨ããã«ç½®ãã¨ãããã¨ã
ããã«Railsã®concernsã使ããã¨ãã話ã 以ä¸è¨äºãããããããã¨ãããã¨ã§æãã¦ããã£ãã®ã§ç½®ãã¦ããã¾ãã
èªåã¯ããã¾ã§ãconcernsã£ã¦ä½ããããããªã¢ãã«ã§å ±éãã¦åããæ©è½ãæ¸ãå ´æã¨ããç¨åº¦ã®ç解ã ã£ãã®ã§ãããä¸è¨è¨äºã§ã¯
- For common model concerns: we place them in app/models/concerns.
- For model-specific concerns: we place them in a folder matching the model name: app/models/<model_name>.
ã¨ãããµãã«æ¸ããã¦ããããã®modelåºæãã¿ã¼ã³ãFATã¢ãã«è§£æ¶ã«æ´»èºãã¦ããããã§ãã
# app/models/recording.rb class Recording < ApplicationRecord include Completable end # app/models/recording/completable.rb module Recording::Completable extend ActiveSupport::Concern end
concernsã¯"has trait"(ç¹æ§ãæã¤) ã "acts as"(ã®ããã«æ¯ãèã)ã®ããããã¤ã³ããé ã人ã®ããã«æ¯ãèãã¨èãã¦ãPointGiverã¨ããæ©è½ãæã¤ã¨ãã¾ãã
ä»åã¯"ãã¤ã³ããé ã"ã¨"ãã¤ã³ããè¨ç®ãã"ãåãã¦ã¿ã¾ããã ãã¤ã³ããè¨ç®ããã®ã¯ãOrder以å¤ã«ãProductã«ä»ä¸ããããã¤ã³ããè¨ç®ããããããã¨ããããªã¨æã£ãããã§ãããããã£ããã¤ã³ãè¨ç®ç³»ã®å¦çã¯ä¸ã¤ã®é¢å¿äºã¨ãã¦åãåºãã¦ãä»åãªãOrder::PointGiverã«includeãã¾ãããã®ã¡ã®ã¡Product::PointGiverã¿ãããªã®ãåºã¦ãããããããªãã®ã§ãåãã¦ã¿ã¾ããã
# app/models/concerns/order/point_giver.rb module Order::PointGiver extend ActiveSupport::Concern include PointCalculater def give_points_to_customer customer.points.create(amount: complex_calc_points) if customer end end
# app/models/concerns/point_calculater.rb module PointCalculater extend ActiveSupport::Concern # è¤éãªãã¤ã³ãç®åºå¦ç def complex_calc_points # ifæããããããã£ãããã¦ãä¾ãã°100è¡ãããããã¨ãã¾ãã # ãã¤ã³ãä»ä¸çãå¯å¤ # ãã¤ã³ãã®ç¨®é¡ãè¤æ° # ãã¤ã³ãå士çµã¿åããã¦å©ç¨ã§ãã # ç¹å®ã®ååè³¼å ¥ã®å ´åã«ãã¤ã³ããã¤ãããã # æçµçã«rateã0.1ã«ãªã£ãã¨ãã¾ãã rate = 0.1 self.total_price * rate end end
class Order < ApplicationRecord include PointGiver belongs_to :customer has_many :order_items def total_price order_items.sum(quantity * price) end end
concernsã®å°å
¥ã«ãã£ã¦è¯ããªã¨æã£ãç¹ã¨ãã¦ã¯ã以ä¸ã®ããã«@order.give_points_to_customer
ã®ããã«å¼ã³åºãããã¨ã§ãã
å¼ã³åºãæ¹ãã·ã³ãã«ã ããorderãcustomerã«pointãgiveããã¨ãããµãã«èªãã¾ãã
èªåã¯ããã¾ã§ãã¾ãconcernsã使ããã«ãµã¼ãã¹ã使ã£ã¦ããã®ã§ããã¯é常ã«æ°é®®ã§ããã
class OrdersController < ApplicationController def create @order = Order.new(order_params) if @order.save @order.give_points_to_customer # ãã®ä»ã®å¦ç else # ã¨ã©ã¼ãã³ããªã³ã° end end end
ããã«ãããOrderã¨ãããã¡ã¤ã³ã¢ãã«ãããã¤ã³ãã顧客ã«ä»ä¸ããã¡ã½ãããçããã¤ã¤ãå®éã®ãã¡ã¤ã³ã¢ãã«ããã¯é¢å¿äºã移åããã¯ãããã©ãOrderã®è¿ãã«åå¨ãããã¨ãããã¨ãã§ãã¾ããã
ã¾ã¨ã
ä»åè¨äºãæ¸ãã¦ããä¸ã§ä»ã¾ã§ã«ãªããããæ å ±ãéãã¦ä¸æ¦ã®çµè«ãåºãã¦ã¿ã¾ããã æ£ç´ãªã¨ãããããªãé£ããã£ãã§ã... ä»ãå®å ¨ã«ç解ããã¨ããæè¦ã¯ãªãã§ãã
ãã ãã³ã¼ãã£ã³ã°ã®æ¹éã¨ãã¦ä¸ã¤ç¢ºãã«æ±ºã¾ã£ããã¨ããããããã¯åç©«ã§ããã ã¨ããããè¿·ã£ããä¸æ¦ã¢ãã«ã«æ¸ãã¦ããã¨ããã®ãå¾¹åºãããã¨æãã¾ãã ãã®ããã§æ°ãããã¡ã¤ã³ã¢ãã«ããã£ãããããªãã¦ãè¦ãã¦ããããªæããããããã¼ã ã®äººã«è©±ããããã¦ããã¡ã¤ã³ã¢ãã«ã®è§£å度ãååã§é«ãã¦ããããã§ãã
ã¾ããã¢ãã«ãFATã«ãªããã¨ã¯ãããªã«ãããã¨ãããªãã¨ããç解ãå¾ãããã®ã大ããã£ãã§ãã ã¢ãã«ããããã³ã³ããã¼ã©ã¼ããã¥ã¼ã«ãã¸ãã¹ãã¸ãã¯ãç½®ãã¦ãã£ãããããã¨ã®æ¹ãã®ã¡ã®ã¡ãã¡ã¤ã³ã¢ãã«ãèãã¦ããããã§ã®è¶³ããã«ãªããããä»å¾è¦ã¤ãããè³æ¥ã¢ãã«ã«ç§»ãã¦ããããã¨æãã¾ããã
æå¾ã«ãä»åè¨äºãæ¸ããã£ããããããå 輩ã«æè¬ãä¼ãããã¨æãã¾ãã ãããã¨ããããã¾ããï¼