これくらいの実例とともにソリューション選択できるようにしていきたい。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import z from "zod"; | |
const Suit = z.enum(["Spade", "Heart", "Diamond", "Club"]); | |
const Rank = z.enum(["A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"]); | |
const Card = z.object({ | |
suit: Suit, | |
rank: Rank, | |
}); | |
type Card = z.infer<typeof Card>; | |
// 手札 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { match } from "ts-pattern"; | |
import z from "zod"; | |
const Station = z.object({ | |
name: z.string() | |
}) | |
const Time = z.object({ | |
hour: z.number().int().min(0).max(12), | |
minute: z.number().int().min(0).max(59), | |
}) |
アジャイルプロジェクトのアーキテクチャは、別々に記述され定義されなければなりません。すべての意思決定が一度にされるわけでもなく、プロジェクト開始時にすべての意思決定がされてるわけでもありません。
アジャイル手法では、ドキュメンテーションに反対はしませんが、価値のないドキュメンテーションはいけません。チーム自身の助けになるようなドキュメントは価値がありますが、ちゃんと最新化し続けなければなりません。膨大なドキュメントでは、最新化されなくなることでしょう。小さくまとまりのあるドキュメントは少なくとも更新される可能性はありますよね。
また膨大なドキュメントはだれも読みません。たいていの開発者はソースコードサイズの合計よりも(byte的な意味で)大きな仕様書が書かれたプロジェクトを少なくとも1回は経験したことがあるでしょう。開くのにも、読むのにも、更新するのにも、そんなドキュメントは大きすぎます。一口大のピースに分解すれば、すべての関係者にとって消化するのは簡単になりますよね。
プロジェクトが動いている間、追跡するのが難しいことの1つに、ある意思決定の裏に隠された「思い」があります。プロジェクトに新しく参画した人は、それまでに決定されたことに困惑したり、戸惑ったり、喜んだり、怒ったりすることでしょう。理念や因果関係を理解しておかないと、その人は次の2つの選択をすることになります。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.springframework.aop.aspectj.AspectJExpressionPointcut; | |
import org.springframework.aop.config.AopConfigUtils; | |
import org.springframework.context.support.GenericApplicationContext; | |
import org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler; | |
import org.springframework.security.access.expression.method.MethodSecurityExpressionHandler; | |
import org.springframework.security.access.prepost.PreAuthorize; | |
import org.springframework.security.authentication.TestingAuthenticationToken; | |
import org.springframework.security.authorization.AuthorizationManager; | |
import org.springframework.security.authorization.method.AuthorizationManagerBeforeMethodInterceptor; | |
import org.springframework.security.authorization.method.PreAuthorizeAuthorizationManager; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* ------------------------------------------------------------ | |
* "THE YAKINIKUWARE LICENSE" (Revision 42): | |
* <author> wrote this code. As long as you retain this | |
* notice, you can do whatever you want with this stuff. If we | |
* meet someday, and you think this stuff is worth it, you can | |
* treat me grilled meat in return. | |
* ------------------------------------------------------------ | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns bakusatsu | |
(:refer-clojure :exclude [+ -]) | |
(:require [clojure.spec.alpha :as s] | |
[clojure.spec.test.alpha :as stest] | |
[clojure.core :as core])) | |
;; 金額に関する振る舞い(金額同士の加算と減算ができる) | |
(defprotocol IMoney | |
(+ [this money]) | |
(- [this money])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.fasterxml.jackson.databind.BeanDescription; | |
import com.fasterxml.jackson.databind.JavaType; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import com.fasterxml.jackson.databind.SerializationConfig; | |
import com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition; | |
import com.fasterxml.jackson.databind.introspect.ClassIntrospector; | |
import java.util.LinkedHashMap; | |
import java.util.Map; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.UnsupportedEncodingException; | |
import java.util.LinkedList; | |
import java.util.Objects; | |
import java.util.function.BiConsumer; | |
import java.util.stream.Collectors; | |
import java.util.stream.IntStream; | |
import java.util.stream.Stream; | |
public class ShiftJISRegexGenerator { | |
public static void main(String[] args) { |
NewerOlder