The Origin of LINQ to SQL ã訳ãã¦ã¿ã
ãThe Wayward WebLogããã Matt Warren ã®ãThe Origin of LINQ to SQLã
æ¨æ¥ãã°ãé£ã¹ã¦ããä½æ¥ãåãã¦ï¼æ¬å½ã¯æ¨å¹´ä¸ã«çµãããã£ããã§ããï¼çµå±ããè¾¼ãã§ãã¾ãã¾ããï¼æ訳å
¨éã¨ãããã¨ããã£ã¦ï¼ã ãã¶èª¤èªã»èª¤è¨³ãæ··ãã£ã¦ãããªã®ã«ã注æãï¼ããã¾ã§å¿
æ»ã«è±æèªãã ã®ã¯å¤§å¦ã®å
¥è©¦å強以æ¥ããï¼ç´°ããã¨ããã®è¦ç´ãã¯ã¡ããã¨ãã£ã¦ããªãã®ã§ï¼å¾ã§æ°ä»ããããªããã¾ãï¼
LINQ to SQL ã®èµ·æº (原文)
LINQ to SQLï¼ããã¤ã¯æãããã¤ã¯ãã½ããã 10 å¹´ææ¦ãã¦ããä¸ã§åãã¦å®éã«åºè·ããã Object/Relational Mapping ã ãã©ï¼ãã¤ã¦ããã¯åå¨ããã¨ããæããã¦ããªãã£ããã ï¼
ããã¯ã¡ã£ã½ã㪠Visual Studio Project ã¨ãã¦ç§ã®ãã¹ã¯ãããæ©ã§å§ã¾ã£ããã ï¼é¡ãã㨠2003 å¹´ã®ç§ï¼ããã«ã¤ãã¦èª°ããè³ã«ããéãåã«ï¼æ¬¡ã«ä½ã訪ãããã誰ããèããéãåã«ãï¼ãã®ããã°ã®èªè
ãé¤ãã¦ã¯ï¼ãã¡ããï¼å¾©å·ã«ä½¿ãæ£ããã¯ã³ã¿ã¤ã ããã*1ãããã°ï¼ç§ãä½ãèãã¦ãããæ³åã§ããããï¼ã¨ãããããç§ã®æ稿ã¯é·ã£ãããã飲ã¿è¾¼ã¿ã«ããï¼ããã¦æã«ãµã¤ã±ããªãã¯ãªèè¡é転ã ã£ããã ãã©ï¼ç§ã¯æ¥ãã¹ãä½ãã«åãããã®ããã¸ã§ã¯ããå¿
è¦ã¨ãã¦ããï¼ç§ã«ã¯ expression trees ã¨åºæ¬ç㪠SQL ã®éã®ãã©ã³ã¹ã¬ã¼ã¿ãå¿
è¦ã ã£ãï¼C# ã®ã³ã¼ããã¼ã¹ãæã«ã¨ãï¼ãããå¥ã®è¨èªï¼æ°å転æã«å®éä½ãé¢ç½ããã¨ããã¦ãããè¨èªï¼ã©ã®ããã« query ããããç¥ã£ã¦ããè¨èªï¼ã«å¤ãããã®æ¥ã«åãã¦ãï¼(ãã㧠FoxPro ãã¡ã³ã«åå³ï¼)
ã©ããã¼ãªãã¨ã«ï¼åºæ¬çãªé¨åãåããã®ã«ããã»ã©æéã¯ããããªãã£ãï¼ç¥ã£ã¦ã®éãï¼ç§ããããããã®ææ㧠ORM ãä½ã£ããï¼è¨èªãå¼ã£ã¦ã¯ã¨ãªè½åãå ãããããã®ã¯æåã®ãã¨ãããªãï¼ObjectSpacesï¼ãã㦠C-Omega ã®ä¸é¨ãæ¢ã«ãã¶ã¤ã³ãçµãã¦ããã®ã§ï¼ç§ã¯ç¢ºãã«ä»äºãçµãããã¨ãã§ãããã ï¼å¹¸ãã«ãï¼â次ã«â ä½ãããã¶ã¤ã³ãã¦ä½ãã¨ãã«ã¯ãã£ã¨ç°¡åã«ãªãï¼ç¹ã«åã«ãã¶ã¤ã³ããã®ãããèªèº«ã§ï¼ãããæ°ãã«ããç´ãæ©ä¼ãã¤ããã ã®ã§ããã°ï¼LINQ to SQL 㯠ObjectSpaces vNextï¼ããã㯠vNextNext ã¨ãã¦å§ã¾ã£ãã¨è¨ãããããããªãï¼ãªãã£ã¦ç§ã¯å®éã« ObjectSpaces ã 1 ã¤ã®å½¢ã«è½ã¡çãã¾ã§ã«ç°ãªã 3 ã¤ã®åä½ãããããã¿ã¤ããä½ã£ã¦ããï¼ãã®å¾ C-Omega ã®åºç¤ã¨ãªãããã²ã¨ã¤ã®ã·ã³ãã«ãªãã®ãä½ã£ãããï¼
ã§ãï¼ç§ã¯æ¬å½ã«å
¨ã¦ãå
¼ãåãã ORM system ã®ä½æã«åãããã£ã¦ãããããããªãã£ããã ï¼ç§ã¯åã« LINQ ã®ã¿ã¤ã¤ãåãããã®ä½ãï¼ããã° mock LINQ Provider ãå¿
è¦ã¨ãã¦ããã ãã ã£ãï¼ãã®ã¨ãæã
ã¿ããªãèãã¦ããã®ã¯ï¼çµå± ObjectSpacesï¼ãã㦠WinFS ã§ããï¼æã
ãæ»åºãããã¿ã¼ã³ãåãå
¥ããã ããã£ã¦ãã¨ã ã£ãï¼ã ããç§ã¯åç´ã« ObjectSpaces ã¨ã¨ãã«å§ãããã¨ã«ããï¼ããã¦æ£ç´ãªã¨ããç§ã¯ãããããã£ããã ï¼ã§ãç§ã¯ï¼LINQ ãå°ãå¥ã®ä½ããå¿
è¦ã¨ããã ãããã¨ãç¥ã£ã¦ããï¼ãåãã®ããã« ObjectSpaces ã¯å
ã
Whidbey ãªããããããã¶ãåã«ç»å ´ããã¯ãã ã£ãï¼ãã®æ¬æ¥ã®ã¿ã¼ã²ãã㯠Everett (.NET 1.1) ã ã£ããã ï¼Luca*2 ã¨ç§ããã®ããã¸ã§ã¯ããå§ããã®ããããã .NET 1.0 ã®åºãæ°å¹´åã ã¨ç解ãã¦ããã°ï¼ãããªã«ããããªè©±ã«ã¯èãããªãããï¼(å½æï¼ç§ã®ããã¼ã¸ã£ã¯ObjectSpaces ã®å¾ã«ä½ãæ¥ãããããã ããç§ã«å°ãããã ï¼æ¬¡ã«æ¥ã大ããªãã®ã¯ä½ã ï¼ ã£ã¦ï¼ããã°ã©ãã³ã°è¨èªã¸ã®çµ±åãã¾ãã«ããã ï¼ã¨ããã«æãè³ã£ãï¼æååããã¯ã¨ãªãå¤ã«åºãã¦ï¼ã³ã³ãã¤ã«æã®åãã§ãã¯ãåãæ»ãã¦ããããã¤ã³ããªã»ã³ã¹ã¨ããã«ä¼¼ã奴ï¼ç§ãããã»ã©è¡æã§ãå
è¦ã®æããã£ãããã§ããªããã ãã©ï¼ç§ãã¡ã¯æ¢ã«æ°ãããã¼ã¿ãã¼ã¹ããã°ã©ãã³ã°è¨èªã®ããã®ã¢ã¤ãã£ã¢ã®èä»ãã«åãçµãã§ããããï¼å½¼ã®ãªãã£ã¹ã«è¡ãã¾ã§ã«ã¯ãã®äºã§å¿ããã£ã±ãã ã£ããã ï¼ ObjectSpaces ã®å¤§ããªæ¬ ç¹ã¯ï¼ãã®ã¯ã¨ãªè½åã®å¶éããã¦ãã¦ï¼è¿°èªã ãï¼ï¼æååã®ä¸ã®ã¯ã¨ãªã«ã ã注ç®ãã¦ãã¦ï¼ãã㦠Generics ã«ããå¼·ãåä»ããæ¬ ãã¦ãããã¨ã ã£ãï¼ãã¨ã ObjectSpaces ãé
ã㦠Whidbey ããããç®æ¨ã«è¨å®ãç´ããã¨ãã¦ãï¼åçãªå¤æ´ã«ã¤ãã¦èãåããã«ã¯ãã¶ã¤ã³ã¨ããç¹ã§å½¼ãã¯æ¢ã«é ãã¾ã§æ¥ããã¦ããï¼ã¤ãã§ã«ç§ãè¨èªã«ãããã¨ãã¦ãããã¨ã¯ã©ããï¼å½¼ããåºè·ãã¦ããé·ããã¨çµã¤ã¾ã§å½¼ãã«å½±é¿ãä¸ããªããã¨ã ã£ãï¼ã ããï¼å½¼ã㯠LINQ ã«çæããã®ã¯æ¬¡ã®ãã¼ã¸ã§ã³ã§ï¼ã¨ãããã¨ã«ãããã ï¼
ããç§ã LINQ ã«é£ããã¦ããå¿
è¦ããã£ãã®ã¯ï¼ã¾ãã«ã³ã³ãã¤ã©ã«ãã£ã¦çæãããå¼·ãåä»ããããã¯ã¨ãªããªã¼ã«ãã£ã¦ï¼ãªã¬ã¼ã·ã§ãã«ã«å®å
¨ãªã¯ã¨ãªãå¦çããï¼Generics 㨠IEnumerable å¨ãã«ã¤ãã¦ãã¶ã¤ã³ãç´ãããï¼è¨èªã«çµ±åããã ObjectSpaces ã ã£ãï¼ã¾ãã«ãããããï¼ çµæçã«ObjectSpaces v2ããããªã£ã¦æ¬²ããã¨ç§ãé¡ã£ããã®ã ã£ãï¼ã§ãç§ã«ã¯ã¾ãã«ãã®ã¨ãï¼LINQ ããã¶ã¤ã³ãå¶ä½ãã対象ã¨ãã¦ã®ä½ããå¿
è¦ã ã£ãï¼
ãªã WinFS ã¨å§ããªãã£ããã£ã¦ï¼ çµå±ã®ã¨ãããã®ã¨ãããã¤ã¯ SQL Server å
ã®éã§å¤§æµè¡ãã¦ããï¼æ®å¿µãªãã¨ã« ObjectSpaces ã¨åã話ãï¼å½¼ãã¯æã
ããå
ã«åºè·ãããã¨ãã¦ããï¼æã
ã¯å½¼ãã®ã¬ã¼ãã¼ã®ä¸ã«ã¯ããªãã£ãï¼å½¼ãã¯æã
ããããã©ã¤ãã«åãåºã¾ã£ã¦ãããã ï¼è¨ãã¾ã§ããªãWinFS ã¯ç§ã証è¨ã§ããæ大ã®å¤±æ
ã ã¨ä¿¡ãã¦ãããã©ï¼ã¾ãããã¯å¥ã®ã話ï¼
ããã§ãï¼ãã®è©±ã®ä¸é¨ã¯ LINQ to SQL ãå®éã®è£½åã«ããåååã ã£ããã ï¼
WinFS ã®ã¯ã©ã¤ã¢ã³ã API ã¯ï¼ ObjectSpaces ã®ã³ã¼ããã¼ã¹ãã¾ãã¾ãã³ãã¼ããã¨ããããã¾ãå§ã¾ã£ã¦ï¼å
¨ã¦åãéçãæã£ã¦ããï¼ããã¤ã¯ãã ï¼ç¤¾å
å¢åå³ã®ãªãã®é«ãã¨ããã«ãããæ¹ã«ææ®ããã¦ããããããå¼·ãæ¿æ²»çå½±é¿åããã£ã¦ãã¦ï¼ããã¦å£®å¤§ãªå
é¨ã®ç¸å¼µãäºããçã¿åºãæµãã®ä¸ã«ä½ç½®ã¥ãããã¦ãããã ï¼å¤ããè¦ã¦ããç§ãã¡ã¯ï¼ãã¤ã¦ WinFS ã®ãã¨ããããè¨ã£ã¦ããï¼ ãã©ãã¯ãã¼ã«ï¼æ°¸é ã«å¤§ãããªããªãã¦ï¼å©ç¨ã§ãããªã½ã¼ã¹ãå
¨ã¦é£²ã¿è¾¼ãã§ï¼ä½ãè±åºã§ããªãã¦ï¼ããã¦æå¾ã«ã¯å¥ã®ç¾å®ã«éããã²ã¼ãã¦ã§ã¤ä»¥å¤ã®ä½ãçã¿åºããªãï¼æã
ã®å¤ãã®å人ã¨ååãæ¢ã«é£²ã¿è¾¼ã¾ãã¦ããï¼ããã¦æ¯é±ã®ã¬ãã¼ãã¨å¤±æè«ã¯æããããã®ã ã£ãï¼çµå±ãã㯠ObjectSpaces ã飲ã¿è¾¼ãã§ãã¾ã£ãï¼ããã«ããéç¨ã§ WinFS v2 ãä½ããããæ´åãã§ããããã«ï¼
ãã®ã¨ãï¼LINQ ããã¶ã¤ã³ãã¦ããæã
ã¯ããã»ã©å¿é
ãã¦ããªãã£ãï¼éçºé¨é㧠WinFS ã®ããã·ã§ã³ãä¿¡ãã¦ãã人ã¯ããå¤ãã¯ãªãã£ããã ï¼å¤§è¡åãéçºãã¼ã«ã«ã¯ï¼ãã¼ã¨ã³ããã¿ã¼ã²ããã¨ããã·ã³ãã«ãªä½ãã§ãããã¨ãéè¦ã ããï¼ãã¤ã¦ããã ã£ã ObjectSpaces ã¯ï¼ä»ãéå»ã®ãã®ã ãã©ï¼ WinFS v2 ãçµå±æ£ãããåãæ»ãã¦ä½¿ããããä¸è¬ç㪠ORM ãã¼ã«ã«ãªãã¨ããå¯è½æ§ã¯ãããã«æ®ã£ã¦ãï¼ã§ãå
¨ã¦ã®å¸æ㯠Vista ãã WinFS ãå¼ãæãããã¨ãã«æã¡ç ããï¼åå¨èªä½ãå±ãããªã£ã¦ãã¾ã£ãï¼å½¼ãã¯ããã«å¼ãè¿ã㦠ObjectSpaces ãæã£ã¦ãã¦ï¼ããã¯ç¢ºãã«åããã®ã§ã¯ãã£ããã©ï¼ã§ãéã®æ°ã¶æã§ï¼ObjectSpaces 㯠.NET 2.0 ã®ä¸é¨ã«ãªãããã®å¼ãè¿ãéçç¹ãããããã«æ»ã£ã¦ãã¾ã£ã¦ãããã ï¼SQL å
ã®ä¸ã§ã®äººäºç°åã¯ã³ã³ããã¼ã«ã失ã£ã¦ããããåãï¼ãã㦠ORM ã«ã¤ãã¦ä½ã§ãç¥ã£ã¦ããå°é家ã®å¤§åã¯æ¢ã«éãåºãã¦ããå¾ã ã£ãï¼
ãã®ã¨ãæã
ã¯é¸æè¢ããªããã¨ã«æ°ä»ãããã ï¼LINQ ãæåããã«ã¯ï¼ç«ã¤ããã®è¶³ãä½æ¬ãå¿
è¦ã ã£ãï¼ç§ãä½ã£ã¦ãã Mock ã® ORM ã¯ããªãè¯ã競æè
ã«ãªãã¤ã¤ãã£ãï¼C# 3.0 ã®ãã¶ã¤ã³ã°ã«ã¼ãã®ä¸é¨ã¨ãã¦ï¼LINQ ã¨æ©èª¿ãåãããªããæã
ã¯ãããä¸ç·ã«ãã¶ã¤ã³ãï¼æ¬å½ã«ããã¯ä¸äººåã®å®è£
ã«ãªã£ããã ï¼æã
ã¯ãããæ¬å½ã«è£½åã¨ãã¦åºè·ããã¨ã¯æã£ã¦ãªãã£ããã ï¼åã«ããã¯ï¼ä»ãåå¨ããªã製åã®ããã®ä»£å½¹ã¨ãã¦åãã¯ãã ã£ãï¼ããã¦ï¼LINQ ã¨ä¸è¬ã®éçºè
ã®ããã«ï¼å
¬å¼ã«æã
㯠ORM ã®æ¾æãæ²ãããã ï¼æã
ãä½ãèãã¦ãããå
é¨ã«ã¢ãã¦ã³ã¹ãï¼ãã®å¾ 3 å¹´éã®ç§ã®äººçã¨ãªãæ¿æ²»çãªæªå¤¢ã®å¹ãéããªããï¼
ãããã¦èªã¿ãã
- Black hole projects
- Paul Vick ã«ããã(Microsoft ã«ããã) Black hole projects ã¨ã¯ãªãããï¼ã
- é©å½è¨³
- http://www.panopticoncentral.net/archive/2006/06/26/12870.aspx:title=
- æ¥ä»ã«æ³¨ç®
- http://oakleafblog.blogspot.com/2006/06/microsoft-bites-bullet-winfs-bites.html:title=
- LINQ to SQL 以åã®æ´å²ã®ãããã