Doma 2.0-beta-2 がリリースできて一段落ということで、半年くらい前に書いた Doma 2 素案 を振り返ります。
結論としては、おおむね計画通りでした。
Doma 2.0-beta-2 がリリースできて一段落ということで、半年くらい前に書いた Doma 2 素案 を振り返ります。
結論としては、おおむね計画通りでした。
| package example; | |
| import static java.util.stream.Collectors.groupingBy; | |
| import static java.util.stream.Collectors.mapping; | |
| import static java.util.stream.Collectors.toList; | |
| import static org.junit.Assert.assertEquals; | |
| import java.util.Arrays; | |
| import java.util.LinkedHashMap; | |
| import java.util.List; |
| // 構造的部分型 = Structural Subtyping | |
| // 構造的部分型 (インタフェース) | |
| module withInterface { | |
| interface IHello { | |
| name: string; | |
| greeting(word: string): string; | |
| } | |
| function doGreeting(hello: IHello) { |
| // http://stackoverflow.com/a/18654421 | |
| // を参考にしている | |
| // | |
| // このコード片を以下のアプリに追加して動作確認 | |
| // https://github.com/angular/angular-phonecat | |
| phonecatApp.factory('MyInterceptor', | |
| function ($q, $rootScope, $injector) { | |
| // リトライの上限回数 | |
| var retryMaxCount = 2; | |
| return function (promise) { |
| # Description: | |
| # Follow-up | |
| # | |
| # Dependencies: | |
| # None | |
| # | |
| # Configuration: | |
| # None | |
| # | |
| # Commands: |
| let add = fun x y -> | |
| x + y | |
| open Checked | |
| let addWithCheck = fun x y -> | |
| x + y | |
| open Unchecked |
| infix operator |> { associativity left precedence 80 } | |
| func |> <T, U>(value: T, function: (T -> U)) -> U { | |
| return function(value) | |
| } | |
| func increment(x: Int) -> Int { | |
| return x + 1 | |
| } |
| using MvcApplication3.Controllers; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Web; | |
| using System.Web.Http; | |
| using System.Web.Mvc; | |
| using System.Web.Optimization; | |
| using System.Web.Routing; |
| package boilerplate.entity; | |
| import lombok.Data; | |
| import org.seasar.doma.Entity; | |
| import org.seasar.doma.GeneratedValue; | |
| import org.seasar.doma.GenerationType; | |
| import org.seasar.doma.Id; | |
| import org.seasar.doma.SequenceGenerator; | |
| import org.seasar.doma.Version; |
| 'use strict'; | |
| describe('Karma reporter', function () { | |
| var $rootScope; | |
| var $q; | |
| beforeEach(inject(function (_$rootScope_, _$q_) { | |
| $rootScope = _$rootScope_; | |
| $q = _$q_; |