From 5032520fc25b84f03b0213ac4181ec4d952828e5 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sun, 21 Apr 2024 19:10:06 +0900 Subject: [PATCH 01/12] Revise introductory section in 'Technology' documentation This update restructures the initial segment of the 'Technology' documentation in both English and Japanese. It provides a more detailed overview of the BEAR.Sunday characteristics by introducing key categories, which enable readers to locate specific information easier. --- manuals/1.0/en/15.tech.md | 9 ++++++++- manuals/1.0/ja/15.tech.md | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/manuals/1.0/en/15.tech.md b/manuals/1.0/en/15.tech.md index aa5ed6be..50bc3dcb 100644 --- a/manuals/1.0/en/15.tech.md +++ b/manuals/1.0/en/15.tech.md @@ -6,7 +6,14 @@ permalink: /manuals/1.0/en/tech.html --- # Technology -This chapter explains the unique features and technologies of BEAR.Sunday. +BEAR.Sunday's distinctive technologies and features are described in the following chapters. + +* [Architecture and Design Principles](#architecture-and-design-principles) +* [Performance and Scalability](#performance-and-scalability) +* [Developer Experience](#developer-experience) +* [Extensibility and Integration](#extensibility-and-integration) +* [Design Philosophy and Quality](#design-philosophy-and-quality) +* [Value Brought by BEAR.Sunday](#value-brought-by-bearsunday) ## Architecture and Design Principles diff --git a/manuals/1.0/ja/15.tech.md b/manuals/1.0/ja/15.tech.md index 546997d6..e7db91c3 100644 --- a/manuals/1.0/ja/15.tech.md +++ b/manuals/1.0/ja/15.tech.md @@ -6,7 +6,14 @@ permalink: /manuals/1.0/ja/tech.html --- # 技術 -この章では、BEAR.Sundayの特徴的な機能と技術を説明します。 +BEAR.Sundayの特徴的な技術と機能を以下の章に分けて解説します + +* [アーキテクチャと設計原則](#アーキテクチャと設計原則) +* [パフォーマンスとスケーラビリティ](#パフォーマンスとスケーラビリティ) +* [開発者エクスペリエンス](#開発者エクスペリエンス) +* [拡張性と統合](#拡張性と統合) +* [設計思想と品質](#設計思想と品質) +* [BEAR.Sundayのもたらす価値](#bearsundayのもたらす価値) ## アーキテクチャと設計原則 From 3b71448b598732f95e14d4a5e39fb8c575876e70 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sun, 21 Apr 2024 19:37:55 +0900 Subject: [PATCH 02/12] Rephrase sentences in the 'Technology' section of the manuals for clarity and readability. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The changes apply to both the Japanese and English versions of the document. The revised wording aims to improve comprehension about the persistence of backward compatibility and code quality in the BEAR.Sunday framework, as well as the framework's principle-based constraints for building robust applications. 自画自賛はしない。自分でエレガントとか言わない。 --- manuals/1.0/en/15.tech.md | 2 +- manuals/1.0/ja/15.tech.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/manuals/1.0/en/15.tech.md b/manuals/1.0/en/15.tech.md index 50bc3dcb..5f657b08 100644 --- a/manuals/1.0/en/15.tech.md +++ b/manuals/1.0/en/15.tech.md @@ -201,4 +201,4 @@ To provide applications with high code quality, the BEAR.Sunday framework itself Great constraints do not change. The constraints brought by BEAR.Sunday provide specific value to developers, users, and businesses respectively. -BEAR.Sunday is a framework designed based on the principles and spirit of the Web, empowering developers to build flexible and robust applications by providing excellent constraints. +Sunday is a framework designed in the principles and spirit of the Web, empowering developers to build flexible and robust applications by providing clear constraints based on principles. diff --git a/manuals/1.0/ja/15.tech.md b/manuals/1.0/ja/15.tech.md index e7db91c3..3ef10124 100644 --- a/manuals/1.0/ja/15.tech.md +++ b/manuals/1.0/ja/15.tech.md @@ -165,13 +165,13 @@ BEAR.Sundayはアプリケーションを長期的にメンテナンス可能す ### 後方互換性の永続的確保 -BEAR.Sunday は、ソフトウェアの進化において後方互換性の維持を重視して設計されています。現代のソフトウェア開発では、頻繁な後方互換性の破壊と、それに伴う改修やテストの負担が課題となっていますが、BEAR.Sunday はこの問題を避けることを目指し成功しています。 +BEAR.Sundayは、ソフトウェアの進化において後方互換性の維持を重視して設計されており、リリース以来、後方互換性を破壊することなく進化を続けています。現代のソフトウェア開発では、頻繁な後方互換性の破壊と、それに伴う改修やテストの負担が課題となっていますが、BEAR.Sundayはこの問題を回避してきました。 BEAR.Sunday では、セマンティックバージョニングを採用するだけでなく破壊を伴うメジャーバージョンアップを行いません。新しい機能の追加や既存機能の変更が既存のコードに影響を与えることを防いでいます。古くなって使われなくなったコードは「deprecated」の属性が与えられますが、削除されることはなく、既存のコードの動作にも影響を与えません。代わりに、新しい機能が追加され、進化が続けられます。 ### コード品質 -高いコード品質のアプリケーションを提供するためにBEAR.Sundayフレームワークも高い水準でコード品質を保っています。 +高いコード品質のアプリケーションを提供するためにBEAR.Sundayフレームワークも高い水準でコード品質を維持するよう努めています。 * フレームワークのコードは静的解析ツールのpsalmとphpstan双方で最も厳しいレベルで適用しています。 * テストカバレッジ100%を保っていて、タイプカバレッジもほぼ100%です。 @@ -201,4 +201,4 @@ BEAR.Sunday では、セマンティックバージョニングを採用する 優れた制約は変わりません。BEAR.Sundayがもたらす制約は、開発者、ユーザー、ビジネスのそれぞれに具体的な価値を提供します。 -BEAR.Sundayは、Webの原則と精神に基づいて設計されたフレームワークであり、開発者に優れた制約を提供することで、柔軟で堅牢なアプリケーションを構築する力を与えます。 +BEAR.Sundayは、Webの原則と精神に基づいて設計されたフレームワークであり、開発者に原則に基づく明確な制約を提供することで、柔軟で堅牢なアプリケーションを構築する力を与えます。 From 6992fc5fd83e968320347bf4a9221cfa18e9c3fb Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sun, 21 Apr 2024 19:58:51 +0900 Subject: [PATCH 03/12] Update itemization format in 'Technology' section of manuals. Updated the paragraphs in the 'Technology' section of the manuals from dashed list items to bullet list items. Changes have been made in both the Japanese and English versions of the documents to improve readability. --- manuals/1.0/en/15.tech.md | 30 +++++++++++++++--------------- manuals/1.0/ja/15.tech.md | 30 +++++++++++++++--------------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/manuals/1.0/en/15.tech.md b/manuals/1.0/en/15.tech.md index 5f657b08..119f2534 100644 --- a/manuals/1.0/en/15.tech.md +++ b/manuals/1.0/en/15.tech.md @@ -102,10 +102,10 @@ In the original world of DI, users avoid dealing with the injector (DI container BEAR.Sunday allows for easy and effective testing due to the following design characteristics: -- Each resource is independent, and the stateless request nature of REST makes testing straightforward. -- Since resource state and representation are separated, it is possible to test the resource state even when using HTML representation. -- API testing can be performed by following hypermedia links, using the same PHP and HTTP code for testing. -- Different implementations can be bound for testing through context-dependent binding. +* Each resource is independent, and the stateless request nature of REST makes testing straightforward. +* Since resource state and representation are separated, it is possible to test the resource state even when using HTML representation. +* API testing can be performed by following hypermedia links, using the same PHP and HTTP code for testing. +* Different implementations can be bound for testing through context-dependent binding. ### API Documentation Generation @@ -181,23 +181,23 @@ To provide applications with high code quality, the BEAR.Sunday framework itself ### Value for Developers -- Increased productivity: Based on robust design patterns and principles with constraints that do not change over time, developers can focus on core business logic. -- Team collaboration: By providing development teams with consistent guidelines and structure, it keeps the code of different engineers loosely coupled yet unified, improving code readability and maintainability. -- Flexibility and extensibility: BEAR.Sunday's policy of not including libraries gives developers flexibility and freedom in component selection. -- Ease of testing: BEAR.Sunday's DI (Dependency Injection) and ROA (Resource-Oriented Architecture) enhance testability. +* Increased productivity: Based on robust design patterns and principles with constraints that do not change over time, developers can focus on core business logic. +* Team collaboration: By providing development teams with consistent guidelines and structure, it keeps the code of different engineers loosely coupled yet unified, improving code readability and maintainability. +* Flexibility and extensibility: BEAR.Sunday's policy of not including libraries gives developers flexibility and freedom in component selection. +* Ease of testing: BEAR.Sunday's DI (Dependency Injection) and ROA (Resource-Oriented Architecture) enhance testability. ### Value for Users -- High performance: BEAR.Sunday's optimized fast startup and CDN (Content Delivery Network)-centric caching strategy bring users a fast and responsive experience. -- Reliability and availability: BEAR.Sunday's CDN-centric caching strategy minimizes single points of failure (SPOF), allowing users to enjoy stable services. -- Ease of use: BEAR.Sunday's excellent connectivity makes it easy to collaborate with other languages and systems. +* High performance: BEAR.Sunday's optimized fast startup and CDN (Content Delivery Network)-centric caching strategy bring users a fast and responsive experience. +* Reliability and availability: BEAR.Sunday's CDN-centric caching strategy minimizes single points of failure (SPOF), allowing users to enjoy stable services. +* Ease of use: BEAR.Sunday's excellent connectivity makes it easy to collaborate with other languages and systems. ### Value for Businesses -- Reduced development costs: The consistent guidelines and structure provided by BEAR.Sunday promote a sustainable and efficient development process, reducing development costs. -- Reduced maintenance costs: BEAR.Sunday's approach to maintaining backward compatibility increases technological continuity and minimizes the time and cost of change response. -- High scalability: With technologies like DI (Dependency Injection) and AOP (Aspect-Oriented Programming), BEAR.Sunday allows applications to be easily expanded in line with business growth and changes while minimizing code changes. -- Excellent User Experience (UX): By providing high performance and high availability, BEAR.Sunday enhances user satisfaction, increases customer loyalty, expands the customer base, and contributes to business success. +* Reduced development costs: The consistent guidelines and structure provided by BEAR.Sunday promote a sustainable and efficient development process, reducing development costs. +* Reduced maintenance costs: BEAR.Sunday's approach to maintaining backward compatibility increases technological continuity and minimizes the time and cost of change response. +* High scalability: With technologies like DI (Dependency Injection) and AOP (Aspect-Oriented Programming), BEAR.Sunday allows applications to be easily expanded in line with business growth and changes while minimizing code changes. +* Excellent User Experience (UX): By providing high performance and high availability, BEAR.Sunday enhances user satisfaction, increases customer loyalty, expands the customer base, and contributes to business success. Great constraints do not change. The constraints brought by BEAR.Sunday provide specific value to developers, users, and businesses respectively. diff --git a/manuals/1.0/ja/15.tech.md b/manuals/1.0/ja/15.tech.md index 3ef10124..07976849 100644 --- a/manuals/1.0/ja/15.tech.md +++ b/manuals/1.0/ja/15.tech.md @@ -102,10 +102,10 @@ DIの本来の世界では、ユーザーは可能な限りインジェクター BEAR.Sundayは、以下の設計上の特徴により、テストが容易で効果的に行えます。 -- 各リソースは独立していて、RESTのステートレスリクエストの性質によりテストは容易です。 +* 各リソースは独立していて、RESTのステートレスリクエストの性質によりテストは容易です。 リソースの状態と表現が明確に分離されているため、HTML表現の時でもリソースの状態をテストすることが可能です。 -- ハイパーメディアのリンクをたどりながらAPIのテストを行え、PHPとHTTPの同一コードでテストできます。 -- コンテキストによる束縛により、テスト時に異なる実装を束縛することができます。 +* ハイパーメディアのリンクをたどりながらAPIのテストを行え、PHPとHTTPの同一コードでテストできます。 +* コンテキストによる束縛により、テスト時に異なる実装を束縛することができます。 ### APIドキュメント生成 @@ -181,24 +181,24 @@ BEAR.Sunday では、セマンティックバージョニングを採用する ### 開発者にとっての価値 -- 生産性の向上:堅牢な設計パターンと原則に基づき時間による変更にない制約で、開発者はコアなビジネスロジックに集中できます。 -- チームでの協業:開発チームに一貫性のあるガイドラインと構造を提供することで、異なるエンジニアたちのコードを疎結合のまま統一的に保ち、コードの可読性とメンテナンス性を向上します。 -- 柔軟性と拡張性:BEAR.Sundayのライブラリを含まない方針は、開発者にコンポーネントの選択における柔軟性と自由をもたらします。 -- テスト容易性:BEAR.Sunday の DI(依存性の注入)と ROA(リソース指向アーキテクチャ)がテスト容易性を高めます。 +* 生産性の向上:堅牢な設計パターンと原則に基づき時間による変更にない制約で、開発者はコアなビジネスロジックに集中できます。 +* チームでの協業:開発チームに一貫性のあるガイドラインと構造を提供することで、異なるエンジニアたちのコードを疎結合のまま統一的に保ち、コードの可読性とメンテナンス性を向上します。 +* 柔軟性と拡張性:BEAR.Sundayのライブラリを含まない方針は、開発者にコンポーネントの選択における柔軟性と自由をもたらします。 +* テスト容易性:BEAR.Sunday の DI(依存性の注入)と ROA(リソース指向アーキテクチャ)がテスト容易性を高めます。 ### ユーザーにとっての価値 -- 高いパフォーマンス:BEAR.Sundayの最適化された高速起動とCDN(コンテンツ配信ネットワーク)を中心としたキャッシュ戦略はユーザーに高速で応答性の高いエクスペリエンスをもたらします。 -- 信頼性と可用性:BEAR.SundayのCDNを中心としたキャッシュ戦略は、単一障害点(SPOF)を最小化し、ユーザーは安定したサービスを享受できます。 -- 使いやすさ:BEAR.Sundayの優れた接続性は他の言語やシステムと協調することを容易にします。 +* 高いパフォーマンス:BEAR.Sundayの最適化された高速起動とCDN(コンテンツ配信ネットワーク)を中心としたキャッシュ戦略はユーザーに高速で応答性の高いエクスペリエンスをもたらします。 +* 信頼性と可用性:BEAR.SundayのCDNを中心としたキャッシュ戦略は、単一障害点(SPOF)を最小化し、ユーザーは安定したサービスを享受できます。 +* 使いやすさ:BEAR.Sundayの優れた接続性は他の言語やシステムと協調することを容易にします。 ### ビジネスにとっての価値 -- 開発コストの削減:BEAR.Sundayが提供する一貫性のあるガイドラインと構造は、持続的で効率的な開発プロセスを促進し開発コストを削減します。 -- 維持コストの削減:BEAR.Sundayの後方互換性を維持するアプローチは、技術的継続性を高め、変更対応の時間とコストを最小限に抑えます。 -- 高い拡張性:BEAR.Sunday のコードの変更を最小限に抑えながら振る舞いを変えることができるDI(依存性の注入)やAOP(アスペクト指向プログラミング)といった技術で、ビジネスの成長や変化に合わせながらアプリケーションを容易に拡張できます。 -- 優れたユーザーエクスペリエンス(UX):BEAR.Sunday は高いパフォーマンスと高い可用性を提供することで、ユーザーの満足度を高め、顧客ロイヤリティの向上、顧客基盤の拡大、ビジネスの成功に貢献します。 +* 開発コストの削減:BEAR.Sundayが提供する一貫性のあるガイドラインと構造は、持続的で効率的な開発プロセスを促進し開発コストを削減します。 +* 維持コストの削減:BEAR.Sundayの後方互換性を維持するアプローチは、技術的継続性を高め、変更対応の時間とコストを最小限に抑えます。 +* 高い拡張性:BEAR.Sunday のコードの変更を最小限に抑えながら振る舞いを変えることができるDI(依存性の注入)やAOP(アスペクト指向プログラミング)といった技術で、ビジネスの成長や変化に合わせながらアプリケーションを容易に拡張できます。 +* 優れたユーザーエクスペリエンス(UX):BEAR.Sunday は高いパフォーマンスと高い可用性を提供することで、ユーザーの満足度を高め、顧客ロイヤリティの向上、顧客基盤の拡大、ビジネスの成功に貢献します。 優れた制約は変わりません。BEAR.Sundayがもたらす制約は、開発者、ユーザー、ビジネスのそれぞれに具体的な価値を提供します。 -BEAR.Sundayは、Webの原則と精神に基づいて設計されたフレームワークであり、開発者に原則に基づく明確な制約を提供することで、柔軟で堅牢なアプリケーションを構築する力を与えます。 +BEAR.Sundayは、Webの原則と精神に基づいて設計されたフレームワークであり、開発者に明確な制約を提供することで、柔軟で堅牢なアプリケーションを構築する力を与えます。 From f5457de3b2af5ef9352775116378691f280712a1 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sun, 21 Apr 2024 20:00:54 +0900 Subject: [PATCH 04/12] Correct punctuation in 'Technology' section of Japanese manual. Updated a sentence in the 'Technology' section of the Japanese manual to fix punctuation problem. Period has been added at the end of a crucial sentence for improving readability and following the correct grammatical structure. --- manuals/1.0/ja/15.tech.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manuals/1.0/ja/15.tech.md b/manuals/1.0/ja/15.tech.md index 07976849..c893af7e 100644 --- a/manuals/1.0/ja/15.tech.md +++ b/manuals/1.0/ja/15.tech.md @@ -6,7 +6,7 @@ permalink: /manuals/1.0/ja/tech.html --- # 技術 -BEAR.Sundayの特徴的な技術と機能を以下の章に分けて解説します +BEAR.Sundayの特徴的な技術と機能を以下の章に分けて解説します。 * [アーキテクチャと設計原則](#アーキテクチャと設計原則) * [パフォーマンスとスケーラビリティ](#パフォーマンスとスケーラビリティ) From 894aaa89e576a5528c7b36ea6152c3a70a51c299 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sun, 21 Apr 2024 20:05:42 +0900 Subject: [PATCH 05/12] Update sentence in Japanese manual's 'Technology' section https://github.com/bearsunday/bearsunday.github.io/pull/266#discussion_r1573712628 --- manuals/1.0/ja/15.tech.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manuals/1.0/ja/15.tech.md b/manuals/1.0/ja/15.tech.md index c893af7e..2ea191e0 100644 --- a/manuals/1.0/ja/15.tech.md +++ b/manuals/1.0/ja/15.tech.md @@ -105,7 +105,7 @@ BEAR.Sundayは、以下の設計上の特徴により、テストが容易で効 * 各リソースは独立していて、RESTのステートレスリクエストの性質によりテストは容易です。 リソースの状態と表現が明確に分離されているため、HTML表現の時でもリソースの状態をテストすることが可能です。 * ハイパーメディアのリンクをたどりながらAPIのテストを行え、PHPとHTTPの同一コードでテストできます。 -* コンテキストによる束縛により、テスト時に異なる実装を束縛することができます。 +* コンテキストによる束縛により、テスト時に異なる実装を束縛します。 ### APIドキュメント生成 @@ -196,7 +196,7 @@ BEAR.Sunday では、セマンティックバージョニングを採用する * 開発コストの削減:BEAR.Sundayが提供する一貫性のあるガイドラインと構造は、持続的で効率的な開発プロセスを促進し開発コストを削減します。 * 維持コストの削減:BEAR.Sundayの後方互換性を維持するアプローチは、技術的継続性を高め、変更対応の時間とコストを最小限に抑えます。 -* 高い拡張性:BEAR.Sunday のコードの変更を最小限に抑えながら振る舞いを変えることができるDI(依存性の注入)やAOP(アスペクト指向プログラミング)といった技術で、ビジネスの成長や変化に合わせながらアプリケーションを容易に拡張できます。 +* 高い拡張性:BEAR.Sunday のコードの変更を最小限に抑えながら振る舞いを変えるDI(依存性の注入)やAOP(アスペクト指向プログラミング)といった技術で、ビジネスの成長や変化に合わせながらアプリケーションを容易に拡張できます。 * 優れたユーザーエクスペリエンス(UX):BEAR.Sunday は高いパフォーマンスと高い可用性を提供することで、ユーザーの満足度を高め、顧客ロイヤリティの向上、顧客基盤の拡大、ビジネスの成功に貢献します。 優れた制約は変わりません。BEAR.Sundayがもたらす制約は、開発者、ユーザー、ビジネスのそれぞれに具体的な価値を提供します。 From 37bf55b53becb04088a5c796f5312d047918b167 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sun, 21 Apr 2024 20:31:13 +0900 Subject: [PATCH 06/12] =?UTF-8?q?Claude3=E3=81=AB=E3=82=88=E3=82=8B?= =?UTF-8?q?=E6=A0=A1=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manuals/1.0/ja/15.tech.md | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/manuals/1.0/ja/15.tech.md b/manuals/1.0/ja/15.tech.md index 2ea191e0..ba71090f 100644 --- a/manuals/1.0/ja/15.tech.md +++ b/manuals/1.0/ja/15.tech.md @@ -19,11 +19,11 @@ BEAR.Sundayの特徴的な技術と機能を以下の章に分けて解説しま ### リソース指向アーキテクチャ (ROA) -BEAR.Sunday のROAは、Web アプリケーション内でRESTful APIを実現するアーキテクチャです。これはBEAR.Sundayの設計原則の核となるものであり、ハイパーメディアフレームワークであると同時に"サービスとしてのオブジェクト(Object as as service)"をとして扱います。Webと同様に、全てのデータや機能をリソースとみなし、GET、POST、PUT、DELETEなどの標準化されたインターフェースを通じて操作します。 +BEAR.Sunday のROAは、Web アプリケーション内でRESTful APIを実現するアーキテクチャです。これはBEAR.Sundayの設計原則の核となるものであり、ハイパーメディアフレームワークであると同時にサービスとしてのオブジェクト(Object as a service)として扱います。Webと同様に、全てのデータや機能をリソースとみなし、GET、POST、PUT、DELETEなどの標準化されたインターフェースを通じて操作します。 #### URI -URI(Uniform Resource Identifier)はWebの成功の鍵となる要素であり、BEAR.SundayのROAの中核でもあります。アプリケーションが扱うすべてのリソースにURIを割り当てることで、リソースを識別し、アクセスしやすくなります。 URIは、リソースの識別子として機能するだけでなく、リソース間の関係を表現するためにも使用されます。 +URI(Uniform Resource Identifier)はWebの成功の鍵となる要素であり、BEAR.SundayのROAの中核でもあります。アプリケーションが扱うすべてのリソースにURIを割り当てることで、リソースを識別し、アクセスしやすくなります。 URIは、リソースの識別子として機能するだけでなく、リソース間のリンクを表現するためにも使用されます。 #### ユニフォームインターフェース @@ -41,15 +41,13 @@ BEAR.SundayのROAでは、リソースの値と表現が明確に分離されて BEAR.SundayのROAは、従来のMVCアーキテクチャとは異なるアプローチをとっています。MVCはモデル、ビュー、コントローラーの3つのコンポーネントでアプリケーションを構成します。一方、BEAR.Sundayでは、リソースオブジェクトにビューがインジェクトされます。リソースとビューは疎結合で、それぞれの責務が明確に分離されています。 -また、コントローラーとモデルの関係に制約がないのと対照的に、リソースは他のリソースを含むことにハイパーリンクとURIを用いた制約があり、宣言的に行うことができます。 - -MVCのモデルと違って、コンソールを含む多様なクライアントから直接コールすることができますし、 そのめHTMLサイトとAPIサイトを別々に構築する必要がなく、同じリソースを使ってHTMLサイトとAPIサイトを同時に構築できるといった違いがあります。 +また、MVCではコントローラーとモデルの関係に制約がないのと対照的に、リソースは他のリソースを含むことにハイパーリンクとURIを用いた制約があり、宣言的に行うことができます。 ### 依存性の注入 (DI) 依存性の注入 (Dependency Injection, DI) は、オブジェクト指向プログラミングにおけるアプリケーションの設計と構造を強化するための重要な手法です。DIの中心的な目的は、アプリケーションの機能を複数の独立したドメインまたは役割を持つコンポーネントに分割し、それらの間の依存関係を管理することです。 -DIは、1つの機能を複数の機能に水平分割するのに役立ちます。分割された機能は「依存」として各部分を独立して開発、テストができるようになります。単一責任原則に基づき明確な責任と役割を持つそれらの依存を外部から注入することで、オブジェクトの再利用性とテスト性を向上させます。また依存は他の依存へと垂直でも分割され、依存関係のツリーを形成します。 +DIは、1つの機能(関心事、責務)を複数の機能に水平分割するのに役立ちます。分割された機能は「依存」として各部分を独立して開発、テストができるようになります。単一責任原則に基づき明確な責任と役割を持つそれらの依存を外部から注入することで、オブジェクトの再利用性とテスト性を向上させます。また依存は他の依存へと垂直でも分割され、依存関係のツリーを形成します。 BEAR.SundayのDIは[Ray.Di](https://github.com/ray-di/Ray.Di)という独立したパッケージを使用しており、Google社製のDIフレームワークであるGuiceの設計思想を取り入れ、ほぼすべての機能をカバーしています。 @@ -57,7 +55,7 @@ BEAR.SundayのDIは[Ray.Di](https://github.com/ray-di/Ray.Di)という独立し * コンテキストにより束縛を変え、テスト時に異なる実装を注入することができます。 * アトリビュートによる設定でコードの自己記述性が高まります。 -* Ray.Diはコンパイル時に依存性の解決を行うため、ランタイム時のパフォーマンスが向上します。これは、実行時に依存性を解決する他のDIコンテナとは異なる点です。 +* Ray.Diはコンパイル時に依存性の解決を行うため、ランタイム時のパフォーマンスが向上します。これは、ランタイム時に依存性を解決する他のDIコンテナとは異なる点です。 * オブジェクトの依存関係をグラフで可視化できます。例)[アプリケーションスケルトン](/images/app.svg) Ray.Di logo @@ -68,21 +66,21 @@ BEAR.SundayのDIは[Ray.Di](https://github.com/ray-di/Ray.Di)という独立し BEAR.SundayのAOPはRay.Aopという独立したパッケージを使用しており、PHPのアトリビュートをクラスやメソッドに付与して、横断的処理を宣言的に束縛します。Ray.Aopは、Javaの[AOP Alliance](https://aopalliance.sourceforge.net/)に準拠していて、以下のような特徴を持っています。 -AOPは誤解されがちな技術ですが、その存在意義は強力な力のために秩序を壊すものでは決してなく、マッチャーを使った探索的な機能の割り当てや横断的処理の分離などオブジェクト指向が不得意とする分野を補完します。AOPはアプリケーションの横断的な制約を作る、つまりアプリケーションフレームワークとして機能するパラダイムです。 +AOPは「既存の秩序を壊す強い力」と誤解されがちな技術です。その存在意義は制約を超えた力の行使などではなく、マッチャーを使った探索的な機能の割り当てや横断的処理の分離などオブジェクト指向が不得意とする分野を補完にあります。AOPはアプリケーションの横断的な制約を作ることのできる、つまりアプリケーションフレームワークとして機能するパラダイムです。 ## パフォーマンスとスケーラビリティ ### モダンCDNとの統合によるROAベースのイベントドリブンコンテンツ戦略 -BEAR.Sundayは、リソース指向アーキテクチャ(ROA)を中核として、Fastlyなどのインスタントパージ可能なCDNと統合することで、高度なイベントドリブンキャッシュ戦略を実現しています。この戦略では、従来のTTL(Time to Live)によるキャッシュの無効化ではなく、リソースの状態変更イベントに応じてCDNとサーバーサイドのキャッシュ、およびETag(Entity Tag)を即座に無効化します。 +BEAR.Sundayは、リソース指向アーキテクチャ(ROA)を中核として、Fastlyなどのインスタントパージ可能なCDNと統合することで、高度なイベントドリブンキャッシュ戦略を実現しています。この戦略では、従来のTTL(Time to Live)によるキャッシュの無効化ではなく、リソースの状態変更イベントに応じてCDNとサーバーサイドのキャッシュ、およびETag(エンティティタグ)を即座に無効化します。 -この揮発性を排除したアプローチにより、SPOF(Single Point of Failure)を回避し、高い可用性と耐障害性を実現するだけでなく、ユーザー体験とコスト効率を最大化させ、ダイナミックコンテンツでもスタティックコンテンツと同じWeb本来の分散キャッシングを実現します。Webが1990年代から持っていたスケーラブルでネットワークコストも削減する分散キャッシュという原則を、現代的な技術で再実現しているのです。 +このようにCDNに揮発性のない永続的なコンテンツを作るというアプローチにより、SPOF(Single Point of Failure)を回避し、高い可用性と耐障害性を実現するだけでなく、ユーザー体験とコスト効率を最大化させ、ダイナミックコンテンツでもスタティックコンテンツと同じWeb本来の分散キャッシングを実現します。Webが1990年代から持っていたスケーラブルでネットワークコストも削減する分散キャッシュという原則を、現代的な技術で再実現しているのです。 #### セマンティックメソッドと依存によるキャッシュ無効化 BEAR.SundayのROAでは、各リソース操作にセマンティック(意味的な役割)が与えられています。例えば、GET メソッドはリソースを取得し、PUT メソッドはリソースを更新します。これらのメソッドがイベントドリブン方式で連携し、関連するキャッシュを効率的に無効化します。たとえば、特定のリソースが更新された際には、そのリソースを必要とするリソースのキャッシュが無効化されます。これにより、データの一貫性と新鮮さが保たれ、ユーザーに最新の情報が提供されます。 -#### ETagによる同一性確認と迅速な応答 +#### ETagによる同一性確認と高速な応答 システムがブートする前にETagを設定することで、コンテンツの同一性を迅速に確認し、変更がなければ304 Not Modified応答を返しネットワークの負荷を最小化します。 @@ -127,7 +125,7 @@ BEAR.SundayではPHPのインターフェイスを通じて、データベース ### 他システムとの統合 -コンソールアプリケーションと統合し、ソースコードを変えずにWebとコマンドライン双方からアクセス可能にします。また 同一PHPランタイム内で異なるBEAR.Sundayアプリケーションを並行実行できることでマイクロサービスを構築する事なく独立した複数のアプリケーションを強調させることができます。 +コンソールアプリケーションと統合し、ソースコードを変えずにWebとコマンドライン双方からアクセス可能にします。また 同一PHPランタイム内で異なるBEAR.Sundayアプリケーションを並行実行できることでマイクロサービスを構築する事なく独立した複数のアプリケーションを連携させることができます。 ### ストリーム出力 @@ -141,7 +139,7 @@ BEAR.Sundayは段階的な移行パスを提供し、LaravelやSymfonyなどの BEAR.Sunday は、将来の技術的変化や要件の進化に備えて投資を保護します。このフレームワークから別のフレームワークや言語に移行する必要がある場合でも、構築したリソースは無駄になりません。 PHP環境では、BEAR.SundayアプリケーションをComposerパッケージとして統合して継続的に利用できますし、BEAR.Thriftを使用すると、他の言語からBEAR.Sundayリソースに効率的にアクセスできます。Thriftを使用しない時でもHTTPでアクセスが可能です。またSQLコードの再利用も容易です。 -仮に使用しているライブラリが特定のPHPバージョンに強く依存している場合でもBEAR.Thriftを使って異なるバージョンのPHPを共存することができます。 +たとえ使用しているライブラリが特定のPHPバージョンに強く依存している場合でもBEAR.Thriftを使って異なるバージョンのPHPを共存することができます。 ## 設計思想と品質 @@ -161,7 +159,7 @@ BEAR.Sundayはアプリケーションを長期的にメンテナンス可能す #### 全てがインジェクション -フレームワークのクラスが「設定ファイル」や「デバック定数」を実行中に参照して振る舞いを決定する事はありません。振る舞いに応じた依存が注入されます。これにより、アプリケーションの振る舞いを変更するためには、コードを変更する必要がなく、インターフェイスに対する依存性の実装の束縛を変更するだけで済みます。APP_DEBUGやAPP_MODE定数は存在しません。ソフトウエアが起動した後に現在どのモードで動いているか知る方法はありませんし、知る必要もありません。 +フレームワークのクラスが「設定ファイル」や「デバッグ定数」を実行中に参照して振る舞いを決定する事はありません。振る舞いに応じた依存が注入されます。これにより、アプリケーションの振る舞いを変更するためには、コードを変更する必要がなく、インターフェイスに対する依存性の実装の束縛を変更するだけで済みます。APP_DEBUGやAPP_MODE定数は存在しません。ソフトウエアが起動した後に現在どのモードで動いているか知る方法はありませんし、知る必要もありません。 ### 後方互換性の永続的確保 @@ -173,7 +171,7 @@ BEAR.Sunday では、セマンティックバージョニングを採用する 高いコード品質のアプリケーションを提供するためにBEAR.Sundayフレームワークも高い水準でコード品質を維持するよう努めています。 -* フレームワークのコードは静的解析ツールのpsalmとphpstan双方で最も厳しいレベルで適用しています。 +* フレームワークのコードは静的解析ツールのPsalmとPHPStan双方で最も厳しいレベルで適用しています。 * テストカバレッジ100%を保っていて、タイプカバレッジもほぼ100%です。 * 原則的にイミュータブルなシステムであり、テストでも毎回初期化が不要なほどクリーンです。SwooleのようなPHPの非同期通信エンジンの力を引き出します。 @@ -181,14 +179,14 @@ BEAR.Sunday では、セマンティックバージョニングを採用する ### 開発者にとっての価値 -* 生産性の向上:堅牢な設計パターンと原則に基づき時間による変更にない制約で、開発者はコアなビジネスロジックに集中できます。 +* 生産性の向上:堅牢な設計パターンと原則に基づき時間が経っても変わらない制約で、開発者はコアなビジネスロジックに集中できます。 * チームでの協業:開発チームに一貫性のあるガイドラインと構造を提供することで、異なるエンジニアたちのコードを疎結合のまま統一的に保ち、コードの可読性とメンテナンス性を向上します。 * 柔軟性と拡張性:BEAR.Sundayのライブラリを含まない方針は、開発者にコンポーネントの選択における柔軟性と自由をもたらします。 * テスト容易性:BEAR.Sunday の DI(依存性の注入)と ROA(リソース指向アーキテクチャ)がテスト容易性を高めます。 ### ユーザーにとっての価値 -* 高いパフォーマンス:BEAR.Sundayの最適化された高速起動とCDN(コンテンツ配信ネットワーク)を中心としたキャッシュ戦略はユーザーに高速で応答性の高いエクスペリエンスをもたらします。 +* 高いパフォーマンス:BEAR.Sundayの最適化された高速起動とCDNを中心としたキャッシュ戦略はユーザーに高速で応答性の高いエクスペリエンスをもたらします。 * 信頼性と可用性:BEAR.SundayのCDNを中心としたキャッシュ戦略は、単一障害点(SPOF)を最小化し、ユーザーは安定したサービスを享受できます。 * 使いやすさ:BEAR.Sundayの優れた接続性は他の言語やシステムと協調することを容易にします。 @@ -196,7 +194,7 @@ BEAR.Sunday では、セマンティックバージョニングを採用する * 開発コストの削減:BEAR.Sundayが提供する一貫性のあるガイドラインと構造は、持続的で効率的な開発プロセスを促進し開発コストを削減します。 * 維持コストの削減:BEAR.Sundayの後方互換性を維持するアプローチは、技術的継続性を高め、変更対応の時間とコストを最小限に抑えます。 -* 高い拡張性:BEAR.Sunday のコードの変更を最小限に抑えながら振る舞いを変えるDI(依存性の注入)やAOP(アスペクト指向プログラミング)といった技術で、ビジネスの成長や変化に合わせながらアプリケーションを容易に拡張できます。 +* 高い拡張性:BEAR.Sunday のコードの変更を最小限に抑えつつ振る舞いを変えるDI(依存性の注入)やAOP(アスペクト指向プログラミング)といった技術で、ビジネスの成長や変化に合わせながらアプリケーションを容易に拡張できます。 * 優れたユーザーエクスペリエンス(UX):BEAR.Sunday は高いパフォーマンスと高い可用性を提供することで、ユーザーの満足度を高め、顧客ロイヤリティの向上、顧客基盤の拡大、ビジネスの成功に貢献します。 優れた制約は変わりません。BEAR.Sundayがもたらす制約は、開発者、ユーザー、ビジネスのそれぞれに具体的な価値を提供します。 From 2720629924e904a14064e5f804f05769b0179023 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sun, 21 Apr 2024 21:04:20 +0900 Subject: [PATCH 07/12] =?UTF-8?q?Command-R+=E3=81=AB=E3=82=88=E3=82=8B?= =?UTF-8?q?=E8=8B=B1=E8=A8=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manuals/1.0/en/15.tech.md | 162 +++++++++++++++++++------------------- 1 file changed, 79 insertions(+), 83 deletions(-) diff --git a/manuals/1.0/en/15.tech.md b/manuals/1.0/en/15.tech.md index 119f2534..2a258f2c 100644 --- a/manuals/1.0/en/15.tech.md +++ b/manuals/1.0/en/15.tech.md @@ -6,199 +6,195 @@ permalink: /manuals/1.0/en/tech.html --- # Technology -BEAR.Sunday's distinctive technologies and features are described in the following chapters. +This document explains the unique features and technologies of BEAR.Sunday, divided into the following chapters. * [Architecture and Design Principles](#architecture-and-design-principles) * [Performance and Scalability](#performance-and-scalability) * [Developer Experience](#developer-experience) * [Extensibility and Integration](#extensibility-and-integration) * [Design Philosophy and Quality](#design-philosophy-and-quality) -* [Value Brought by BEAR.Sunday](#value-brought-by-bearsunday) +* [Value Proposition of BEAR.Sunday](#value-proposition-of-bearsunday) ## Architecture and Design Principles ### Resource-Oriented Architecture (ROA) -BEAR.Sunday's ROA is an architecture for implementing RESTful APIs within web applications. It is the core of BEAR.Sunday's design principles, serving as both a hypermedia framework and a way to treat "objects as services." Like the Web, all data and functions are considered resources and are manipulated through standardized interfaces such as GET, POST, PUT, DELETE, etc. +BEAR.Sunday's ROA is an architecture that implements RESTful API within web applications. It is a core design principle of BEAR.Sunday, serving as both a hypermedia framework and a service-oriented architecture (SOA). Like the Web, ROA treats all data and functionality as resources, which can be manipulated through standardized interfaces such as GET, POST, PUT, and DELETE. #### URI -URI (Uniform Resource Identifier) is a key element to the success of the Web and is also at the core of BEAR.Sunday's ROA. By assigning URIs to all resources handled by the application, resources can be identified and easily accessed. URIs not only function as identifiers for resources but are also used to express relationships between resources. +URI (Uniform Resource Identifier) is a key element in the success of the Web and is central to BEAR.Sunday's ROA. By assigning URIs to all resources handled by the application, it becomes easier to identify and access them. URIs not only serve as resource identifiers but also express relationships between resources. #### Uniform Interface -Access to resources is done using HTTP methods (GET, POST, PUT, DELETE). These methods specify the operations that can be performed on a resource and provide a common interface regardless of the type of resource. +Resources are accessed using HTTP methods such as GET, POST, PUT, and DELETE. These methods define the operations that can be performed on resources, providing a common interface regardless of the resource type. #### Hypermedia -In BEAR.Sunday's ROA, each resource provides affordances (operations and functions available to the client) through hyperlinks. These links represent the operations available to the client and provide instructions on how to navigate within the application. +In BEAR.Sunday's ROA, each resource provides affordances (available operations and functions for clients) through hyperlinking. These links represent the operations that clients can perform and guide navigation within the application. -#### Separation of Value and Representation +#### Separation of Values and Representations -In BEAR.Sunday's ROA, a resource's value and representation are clearly separated. Resource values are managed by the application's domain logic, while representations are for expressing those values in various formats (JSON, XML, HTML, etc.). This separation results in loose coupling between domain logic and presentation logic. +In BEAR.Sunday's ROA, the values of resources are separated from their representations. The values are managed by the application's domain logic, while representations express those values in various formats such as JSON, XML, or HTML. This separation results in loose coupling between domain logic and presentation logic. #### Differences from MVC -BEAR.Sunday's ROA takes a different approach from the traditional MVC architecture. MVC composes an application with three components: Model, View, and Controller. In contrast, BEAR.Sunday injects views into resource objects. Resources and views are loosely coupled, with their responsibilities clearly separated. +BEAR.Sunday's ROA takes a different approach from traditional MVC (Model-View-Controller) architecture. While MVC separates an application into three components (model, view, and controller), BEAR.Sunday injects views into resource objects. Resources and views are loosely coupled, with clear separation of concerns. -Also, in contrast to the lack of constraints on the relationship between controllers and models, resources have constraints on including other resources using hyperlinks and URIs, and this can be done declaratively. - -Unlike MVC models, resources can be directly called from diverse clients including the console, and there are differences such as being able to simultaneously build HTML sites and API sites using the same resources without needing to construct HTML sites and API sites separately. +Unlike MVC, where there are no constraints on the relationship between controllers and models, BEAR.Sunday uses hyperlinks and URIs to constrain the inclusion of other resources, allowing for declarative implementation. ### Dependency Injection (DI) -Dependency Injection (DI) is an important technique for enhancing the design and structure of applications in object-oriented programming. The central purpose of DI is to divide an application's functionality into multiple components with independent domains or roles and manage the dependencies between them. +Dependency Injection (DI) is a crucial technique in object-oriented programming that enhances the design and structure of applications. The primary purpose of DI is to divide an application's functionality into multiple independent domains or roles and manage the dependencies between them. -DI helps horizontally split a single function into multiple functions. The split functions can be independently developed and tested as "dependencies." Based on the single responsibility principle, by injecting those dependencies with clear responsibilities and roles from the outside, it improves object reusability and testability. Dependencies are also vertically split into other dependencies, forming a tree of dependencies. +DI helps in horizontally splitting a single function into multiple functions. The split functions become "dependencies" that can be independently developed and tested. By injecting these dependencies, which have clear responsibilities and roles based on the single responsibility principle, object reusability and testability are improved. Dependencies are also vertically split into other dependencies, forming a tree of dependencies. -BEAR.Sunday's DI uses a separate package called [Ray.Di](https://github.com/ray-di/Ray.Di), which incorporates the design philosophy of Google's DI framework Guice and covers almost all of its features. +BEAR.Sunday's DI utilizes an independent package called [Ray.Di](https://github.com/ray-di/Ray.Di), incorporating the design philosophy of Guice, Google's DI framework. It covers almost all the features of Guice. -Other features include: +Additionally, BEAR.Sunday's DI offers the following advantages: -* Bindings can be changed based on context, allowing different implementations to be injected during testing. -* Configuration via attributes increases code self-descriptiveness. -* Ray.Di resolves dependencies at compile-time, improving runtime performance. This differs from other DI containers that resolve dependencies at runtime. -* Object dependencies can be visualized as a graph. Example: [Application Skeleton](/images/app.svg) +* The ability to change bindings based on context, allowing for different implementations during testing. +* Enhanced code self-descriptiveness through attribute-based configuration. +* Improved runtime performance compared to other DI containers by resolving dependencies at compile time. +* Visualization of object dependencies as a graph, e.g., [Application Skeleton](/images/app.svg). Ray.Di logo ### Aspect-Oriented Programming (AOP) -Aspect-Oriented Programming (AOP) is a pattern that enables flexible applications by separating core concerns such as business logic from cross-cutting concerns such as logging and caching. Cross-cutting concerns refer to functions or processes that span multiple modules or layers. Binding of cross-cutting processes based on search conditions is possible, allowing for flexible configurations based on context. - -BEAR.Sunday's AOP uses a separate package called Ray.Aop, which declaratively binds cross-cutting processes by attaching PHP attributes to classes or methods. Ray.Aop adheres to Java's [AOP Alliance](https://aopalliance.sourceforge.net/) and has the following characteristics. +Aspect-Oriented Programming (AOP) is a pattern that enhances application flexibility by separating core concerns (such as business logic) from cross-cutting concerns (such as logging and caching). Cross-cutting concerns refer to functionalities or processes that span multiple modules or layers. BEAR.Sunday's AOP allows for flexible configuration based on context by binding transversal processing declaratively using attributes in PHP. Ray.Aop, an independent package used by BEAR.Sunday, complies with the [AOP Alliance](https://aopalliance.sourceforge.net/) in Java and offers the following features: -AOP is one of the most misunderstood technologies. Its purpose is never to break order for the sake of powerful capabilities, but rather to complement areas where object-orientation struggles, such as the exploratory assignment of functionality using matchers and the separation of cross-cutting processes. AOP is a paradigm that functions as an application framework by creating cross-cutting constraints for applications. +AOP is often misunderstood as a technique that breaks existing order with its powerful capabilities. However, its true value lies in complementing areas where object-oriented programming falls short, such as exploratory function assignment using matchers and separation of transversal processing. AOP is a paradigm that enables the creation of transversal constraints within an application, functioning as an application framework. ## Performance and Scalability -### ROA-based Event-Driven Content Strategy with Modern CDN Integration +### Event-Driven Content Strategy Based on ROA and Integration with Modern CDN -BEAR.Sunday achieves an advanced event-driven caching strategy by integrating with instant-purgeable CDNs like Fastly, with its Resource-Oriented Architecture (ROA) at the core. Instead of traditional cache invalidation based on Time to Live (TTL), this strategy immediately invalidates the CDN, server-side cache, and ETag (Entity Tag) based on resource state change events. +BEAR.Sunday, with its core ROA, integrates with instant-purgable CDNs like Fastly to implement an advanced event-driven caching strategy. Instead of traditional TTL (Time to Live) cache invalidation, this strategy instantly invalidates CDN, server-side caches, and ETags (Entity Tags) based on resource state change events. -This approach, which eliminates volatility, not only avoids Single Point of Failure (SPOF) and achieves high availability and fault tolerance but also maximizes user experience and cost efficiency, realizing the Web's original distributed caching for dynamic content just like static content. It re-implements the scalable and network cost-reducing distributed caching principles that the Web has had since the 1990s using modern technologies. +By adopting this non-volatile approach to CDN content, BEAR.Sunday avoids SPOF (Single Point of Failure), ensuring high availability and fault tolerance. It also maximizes user experience and cost efficiency, enabling dynamic content to benefit from the same distributed caching as static content, thus realizing the Web's original principle of scalability and network cost reduction through distributed caching, empowered by modern technology. -#### Cache Invalidation through Semantic Methods and Dependencies +#### Cache Invalidation Based on Semantic Methods and Dependencies -In BEAR.Sunday's ROA, each resource operation is given a semantic (meaningful role). For example, the GET method retrieves a resource, while the PUT method updates a resource. These methods work together in an event-driven manner to efficiently invalidate related caches. For instance, when a specific resource is updated, the cache of resources that require that resource is invalidated. This ensures data consistency and freshness, providing users with the latest information. +In BEAR.Sunday's ROA, each resource operation is assigned a semantic meaning. For example, the GET method retrieves a resource, while the PUT method updates it. These methods work in an event-driven manner, efficiently invalidating related caches. When a specific resource is updated, the caches of resources that depend on it are invalidated, ensuring data consistency and freshness, and providing users with the latest information. -#### Rapid Response with ETag for Identity Verification +#### ETag-Based Identity Verification and Fast Response -By setting the ETag before the system boots, content identity can be quickly verified, and if there are no changes, a 304 Not Modified response is returned to minimize network load. +By setting ETags before system boot, BEAR.Sunday quickly verifies content identity and returns a 304 Not Modified response if there are no changes, minimizing network load. -#### Partial Updates with Donut Caching and ESI +#### Donut Caching and Partial Updates with ESI -BEAR.Sunday adopts the donut caching strategy and uses ESI (Edge Side Includes) to enable partial content updates at the CDN edge. This technology allows dynamic updates of only the necessary parts without re-caching the entire page, improving caching efficiency. +BEAR.Sunday employs a donut caching strategy, utilizing ESI (Edge Side Includes) to enable partial content updates at the CDN edge. This technique allows dynamic updates of only the necessary parts without re-caching the entire page, improving cache efficiency. -In this way, BEAR.Sunday's ROA-based caching strategy integrated with Fastly not only achieves advanced distributed caching but also improves application performance and enhances fault tolerance. +The integration of BEAR.Sunday with Fastly, along with the ROA-based caching strategy, not only enables advanced distributed caching but also enhances application performance and resilience. -### Faster Startup +### Faster Boot-up -In the original world of DI, users avoid dealing with the injector (DI container) directly as much as possible. Instead, the application is started by creating a single root object at the application's entry point. In BEAR.Sunday's DI, there is essentially no DI container manipulation even during configuration. The root object is huge but is a single variable, so it is reused across requests to realize a highly optimized bootstrap. +In the world of DI, users typically avoid direct handling of injectors (DI containers). Instead, they generate a single root object at the application entry point to start the application. In BEAR.Sunday's DI, there is essentially no manipulation of the DI container during configuration. Although the root object is large, it is a single variable that is reused across requests, resulting in an extremely optimized bootstrap process. ## Developer Experience -### Ease of Testing +### Testability -BEAR.Sunday allows for easy and effective testing due to the following design characteristics: +BEAR.Sunday facilitates testing and makes it more effective due to the following design characteristics: -* Each resource is independent, and the stateless request nature of REST makes testing straightforward. -* Since resource state and representation are separated, it is possible to test the resource state even when using HTML representation. -* API testing can be performed by following hypermedia links, using the same PHP and HTTP code for testing. -* Different implementations can be bound for testing through context-dependent binding. +* Each resource is independent, and the stateless nature of REST requests simplifies testing. + The separation of resource values and representations allows for testing the state of resources even when using HTML representations. +* API testing can be performed by following hypermedia links, using the same PHP and HTTP code. +* Contextual binding allows for injecting different implementations during testing. ### API Documentation Generation -API documentation is automatically generated from code, maintaining consistency between code and documentation and improving maintainability. +API documentation is automatically generated from the code, ensuring consistency between the code and documentation and improving maintainability. ### Visualization and Debugging -By leveraging the technical feature of resources rendering themselves, during development, the scope of resources can be indicated on HTML, resource states can be monitored, and PHP code and HTML templates can be edited in an online editor and reflected in real-time. +By leveraging the feature of resources rendering themselves, BEAR.Sunday provides visualization of resource boundaries during development. It also enables monitoring of resource states and real-time reflection of changes made in online editors for PHP code or HTML templates. ## Extensibility and Integration -### Integration of PHP Interfaces and SQL Execution +### Integration of PHP Interface and SQL Execution -In BEAR.Sunday, SQL statements for interacting with databases can be easily managed using PHP interfaces. SQL execution objects can be directly bound to PHP interfaces without implementing classes. The boundary between the domain and infrastructure is connected by PHP interfaces. +BEAR.Sunday simplifies the management of SQL statement execution for database interactions through PHP interfaces. Without implementing classes, you can directly bind SQL execution objects to PHP interfaces. This approach connects the domain and infrastructure layers through PHP interfaces. -Arguments can also be typed, and any missing arguments are resolved by DI and used as strings. Even when the SQL execution requires the current time, there is no need to pass it explicitly; it is automatically bound. This helps keep the code concise as the client is not responsible for passing all arguments. +You can specify argument types, and if there are missing dependencies, DI will resolve them as strings. For example, if the current time is needed for SQL execution, it will be automatically bound without the need for manual passing, reducing the client's responsibility for passing all arguments. -Direct management of SQL also facilitates debugging when errors occur. The behavior of SQL queries can be directly observed, allowing for quick identification and correction of issues. +Direct management of SQL also simplifies debugging by allowing direct observation of SQL query behavior, facilitating issue identification and resolution. ### Integration with Other Systems -Integration with console applications allows access from both the Web and command line without changing the source code. Also, by enabling the concurrent execution of different BEAR.Sunday applications within the same PHP runtime, multiple independent applications can be coordinated without building microservices. +BEAR.Sunday integrates with console applications, enabling access from both web and command-line interfaces without modifying the source code. Additionally, it allows parallel execution of different BEAR.Sunday applications within the same PHP runtime, eliminating the need for microservices and facilitating the coordination of multiple independent applications. ### Stream Output -By assigning streams like file pointers to the body of a resource, large-scale content that cannot be handled in memory can be output. Streams can also be mixed with regular variables, allowing flexible output of large responses. +By assigning streams, such as file pointers, to the body of a resource, BEAR.Sunday enables the output of large-scale content that cannot be handled in memory. Streams can coexist with regular variables, providing flexibility in handling large responses. ### Gradual Migration from Other Systems -BEAR.Sunday provides a gradual migration path, enabling seamless integration with other frameworks and systems such as Laravel and Symfony. Since this framework can be implemented as a Composer package, developers can gradually introduce BEAR.Sunday's features into their existing codebase. +BEAR.Sunday offers a gradual migration path, seamlessly integrating with other frameworks and systems like Laravel and Symfony. As a Composer package, BEAR.Sunday can be incrementally introduced into an existing codebase, allowing developers to leverage its features without a complete rewrite. -### Flexibility of Technology Migration +### Flexibility in Technology Migration -BEAR.Sunday protects investments by preparing for future technological changes and evolving requirements. Even if there is a need to migrate from this framework to another framework or language, the resources built will not be wasted. In the PHP environment, BEAR.Sunday applications can be integrated as Composer packages and continuously utilized, and BEAR.Thrift allows efficient access to BEAR.Sunday resources from other languages. Even when not using Thrift, access via HTTP is possible. Reuse of SQL code is also easy. +BEAR.Sunday protects your investment by considering future technological changes and evolving requirements. Even if you need to migrate to another framework or language, the resources built with BEAR.Sunday will not be wasted. In the PHP ecosystem, you can continue using BEAR.Sunday applications as Composer packages, and with BEAR.Thrift, you can efficiently access BEAR.Sunday resources from other languages. HTTP access is also possible without using Thrift. Additionally, SQL code is easily reusable. -If the dependent libraries strongly depend on a specific PHP version or library, making it difficult to upgrade to the latest PHP version, BEAR.Thrift can be used to coexist with different PHP versions. +Even if your libraries have strong dependencies on specific PHP versions, BEAR.Thrift allows you to coexist with different PHP versions. ## Design Philosophy and Quality -### Adoption of standard technologies and elimination of proprietary standards +### Adoption of Standard Technologies and Avoidance of Proprietary Specifications -BEAR.Sunday follows a design philosophy of adopting standard technologies wherever possible and eliminating framework-specific standards and rules. For example, it supports content negotiation for JSON format and www-form format HTTP requests by default and uses the [vnd.error+json](https://github.com/blongden/vnd.error) media type format for error responses. It actively incorporates standard technologies and specifications, such as using [HAL](https://datatracker.ietf.org/doc/html/draft-kelly-json-hal) (Hypertext Application Language) for links between resources and [JsonSchema](https://json-schema.org/) for validation. +BEAR.Sunday embraces standard technologies and avoids proprietary specifications and rules as much as possible. For example, it supports JSON and www-form-urlencoded formats for HTTP request content negotiation by default and uses the [vnd.error+json](https://github.com/blongden/vnd.error) media type format for error responses. For resource linking, it adopts [HAL](https://datatracker.ietf.org/doc/html/draft-kelly-json-hal) (Hypertext Application Language) and utilizes [JsonSchema](https://json-schema.org/) for validation. -On the other hand, it eliminates framework-specific validation rules and standards as much as possible. +At the same time, BEAR.Sunday refrains from introducing its own validation rules or framework-specific specifications. ### Object-Oriented Principles -BEAR.Sunday emphasizes object-oriented principles to make applications maintainable in the long term. +BEAR.Sunday emphasizes object-oriented principles to ensure the long-term maintainability of applications. -#### Composition over Inheritance +#### Composition Over Inheritance -Composition is recommended over inheritance classes. In general, directly calling parent class methods from child classes can potentially increase coupling between classes. There is only one abstract class that requires inheritance at runtime by design, which is `BEAR\Resource\ResourceObject` in the resource class, but its methods only exist for other classes to use. There are no classes in BEAR.Sunday where the user calls methods of an inherited framework parent class at runtime. +BEAR.Sunday encourages the use of composition over inheritance. Directly calling methods from a parent class in a child class can increase coupling between classes. In BEAR.Sunday, the only abstract class that requires runtime inheritance for design purposes is `BEAR\Resource\ResourceObject`, and its methods exist solely for use by other classes. There is no instance in BEAR.Sunday where a framework's parent class method is called at runtime by a user. -#### Everything is Injected +#### Everything is Injection -Framework classes do not refer to "configuration files" or "debug constants" at runtime to determine their behavior. Dependencies corresponding to the behavior are injected. This means that to change the application's behavior, there is no need to change the code; only the binding of the implementation of the dependency to the interface needs to be changed. There are no APP_DEBUG or APP_MODE constants. There is no way to know the current mode the software is running in after it has started, and there is no need to know. +In BEAR.Sunday, framework classes do not refer to "configuration files" or "debug constants" during execution to determine their behavior. Instead, dependencies corresponding to the desired behavior are injected. This approach eliminates the need to modify code when changing application behavior; you only need to change the binding of dependencies to interfaces. Constants like APP_DEBUG or APP_MODE do not exist in BEAR.Sunday. There is no way to know, nor is there a need to know, which mode the software is running in after it has started. -### Permanent Backward Compatibility +### Persistent Backward Compatibility -BEAR.Sunday is designed with a focus on maintaining backward compatibility in the evolution of software. In modern software development, frequent breaking of backward compatibility and the associated burden of modifications and testing have become a challenge, but BEAR.Sunday aims to avoid this problem and has been successful. +BEAR.Sunday is designed with a strong focus on maintaining backward compatibility, and since its release, it has continued to evolve without breaking backward compatibility. In modern software development, frequent backward-incompatible changes and the associated burden of modifications and testing are common challenges. However, BEAR.Sunday has successfully avoided these issues. -BEAR.Sunday not only adopts semantic versioning but also does not perform major version upgrades that involve breaking changes. It prevents the addition of new features or changes to existing features from impacting existing code. Deprecated code is given a "deprecated" attribute but is never removed, and it does not affect the operation of existing code. Instead, new features are added, and evolution continues. +BEAR.Sunday not only adopts semantic versioning but also refrains from performing breaking changes in major version updates. The addition of new features or modification of existing ones does not affect existing code. Deprecated code is attributed but not removed, and it does not impact the behavior of existing code. Instead, new features are introduced, and evolution continues. ### Code Quality -To provide applications with high code quality, the BEAR.Sunday framework itself maintains a high standard of code quality. +To deliver high-quality applications, the BEAR.Sunday framework itself maintains a high level of code quality: -* The framework code applies the most stringent levels of both psalm and phpstan static analysis tools. -* It maintains 100% test coverage, and type coverage is also nearly 100%. -* It is fundamentally an immutable system and is so clean that reinitialization is unnecessary even in tests. It brings out the power of PHP's asynchronous communication engines like Swoole. +* The framework's code is analyzed with strict settings using static analysis tools like Psalm and PHPStan. +* It achieves 100% test coverage and nearly 100% type coverage. +* The system is primarily immutable, and tests do not require initialization, resulting in a clean and efficient testing process. BEAR.Sunday takes advantage of the power of PHP's asynchronous communication engines like Swoole. -## Value Brought by BEAR.Sunday +## Value Proposition of BEAR.Sunday ### Value for Developers -* Increased productivity: Based on robust design patterns and principles with constraints that do not change over time, developers can focus on core business logic. -* Team collaboration: By providing development teams with consistent guidelines and structure, it keeps the code of different engineers loosely coupled yet unified, improving code readability and maintainability. -* Flexibility and extensibility: BEAR.Sunday's policy of not including libraries gives developers flexibility and freedom in component selection. -* Ease of testing: BEAR.Sunday's DI (Dependency Injection) and ROA (Resource-Oriented Architecture) enhance testability. +* **Improved Productivity**: Based on robust design patterns and principles that remain unchanged over time, developers can focus on core business logic. +* **Team Collaboration**: By providing consistent guidelines and structures, BEAR.Sunday promotes collaboration among developers, ensuring unified and loosely coupled code, enhancing code readability and maintainability. +* **Flexibility and Extensibility**: The decision to exclude libraries from BEAR.Sunday gives developers the freedom and flexibility to choose components. +* **Testability**: DI (Dependency Injection) and ROA (Resource-Oriented Architecture) in BEAR.Sunday enhance testability. ### Value for Users -* High performance: BEAR.Sunday's optimized fast startup and CDN (Content Delivery Network)-centric caching strategy bring users a fast and responsive experience. -* Reliability and availability: BEAR.Sunday's CDN-centric caching strategy minimizes single points of failure (SPOF), allowing users to enjoy stable services. -* Ease of use: BEAR.Sunday's excellent connectivity makes it easy to collaborate with other languages and systems. +* **High Performance**: BEAR.Sunday's optimized fast boot-up and CDN-centric caching strategy deliver a fast and responsive user experience. +* **Reliability and Availability**: BEAR.Sunday's CDN-centric caching strategy minimizes SPOF (Single Point of Failure), ensuring stable and reliable service for users. +* **Usability**: BEAR.Sunday's superior connectivity simplifies integration with other languages and systems. ### Value for Businesses -* Reduced development costs: The consistent guidelines and structure provided by BEAR.Sunday promote a sustainable and efficient development process, reducing development costs. -* Reduced maintenance costs: BEAR.Sunday's approach to maintaining backward compatibility increases technological continuity and minimizes the time and cost of change response. -* High scalability: With technologies like DI (Dependency Injection) and AOP (Aspect-Oriented Programming), BEAR.Sunday allows applications to be easily expanded in line with business growth and changes while minimizing code changes. -* Excellent User Experience (UX): By providing high performance and high availability, BEAR.Sunday enhances user satisfaction, increases customer loyalty, expands the customer base, and contributes to business success. +* **Reduced Development Costs**: BEAR.Sunday's consistent guidelines and structures promote efficient and sustainable development processes, leading to reduced development costs. +* **Lower Maintenance Costs**: BEAR.Sunday's approach to maintaining backward compatibility minimizes the time and cost associated with adapting to changes, ensuring technological continuity. +* **High Extensibility**: BEAR.Sunday enables easy application extension by modifying behavior with minimal code changes, utilizing techniques like DI (Dependency Injection) and AOP (Aspect-Oriented Programming) to accommodate business growth and changes. +* **Superior User Experience (UX)**: BEAR.Sunday's high performance and availability contribute to user satisfaction, fostering customer loyalty, expanding the customer base, and driving business success. -Great constraints do not change. The constraints brought by BEAR.Sunday provide specific value to developers, users, and businesses respectively. +Excellent constraints remain unchanged. The constraints imposed by BEAR.Sunday bring specific value to developers, users, and businesses alike. -Sunday is a framework designed in the principles and spirit of the Web, empowering developers to build flexible and robust applications by providing clear constraints based on principles. +BEAR.Sunday is a framework designed based on the principles and spirit of the Web, empowering developers with clear constraints to build flexible and robust applications. From be8682036493655883d96780836f01c91828e8d6 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sun, 21 Apr 2024 22:00:48 +0900 Subject: [PATCH 08/12] =?UTF-8?q?Calude3=E3=81=AB=E3=82=88=E3=82=8B?= =?UTF-8?q?=E8=8B=B1=E8=A8=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manuals/1.0/en/15.tech.md | 164 +++++++++++++++++++------------------- 1 file changed, 83 insertions(+), 81 deletions(-) diff --git a/manuals/1.0/en/15.tech.md b/manuals/1.0/en/15.tech.md index 2a258f2c..8c4f8c39 100644 --- a/manuals/1.0/en/15.tech.md +++ b/manuals/1.0/en/15.tech.md @@ -6,195 +6,197 @@ permalink: /manuals/1.0/en/tech.html --- # Technology -This document explains the unique features and technologies of BEAR.Sunday, divided into the following chapters. +The distinctive technologies and features of BEAR.Sunday are explained in the following chapters. * [Architecture and Design Principles](#architecture-and-design-principles) * [Performance and Scalability](#performance-and-scalability) * [Developer Experience](#developer-experience) * [Extensibility and Integration](#extensibility-and-integration) * [Design Philosophy and Quality](#design-philosophy-and-quality) -* [Value Proposition of BEAR.Sunday](#value-proposition-of-bearsunday) +* [The Value BEAR.Sunday Brings](#the-value-bearsunday-brings) ## Architecture and Design Principles -### Resource-Oriented Architecture (ROA) +### Resource Oriented Architecture (ROA) -BEAR.Sunday's ROA is an architecture that implements RESTful API within web applications. It is a core design principle of BEAR.Sunday, serving as both a hypermedia framework and a service-oriented architecture (SOA). Like the Web, ROA treats all data and functionality as resources, which can be manipulated through standardized interfaces such as GET, POST, PUT, and DELETE. +BEAR.Sunday's ROA is an architecture that realizes RESTful API within a web application. It is the core of BEAR.Sunday's design principles and serves as a hypermedia framework as well as treating "object as a service". Similar to the Web, all data and functions are considered resources and are operated through standardized interfaces such as GET, POST, PUT, and DELETE. #### URI -URI (Uniform Resource Identifier) is a key element in the success of the Web and is central to BEAR.Sunday's ROA. By assigning URIs to all resources handled by the application, it becomes easier to identify and access them. URIs not only serve as resource identifiers but also express relationships between resources. +URI (Uniform Resource Identifier) is a key element to the success of the Web and is also at the heart of BEAR.Sunday's ROA. By assigning URIs to all resources handled by the application, resources can be easily identified and accessed. URIs not only function as identifiers for resources but are also used to express links between resources and enable navigation. #### Uniform Interface -Resources are accessed using HTTP methods such as GET, POST, PUT, and DELETE. These methods define the operations that can be performed on resources, providing a common interface regardless of the resource type. +Access to resources is done using HTTP methods (GET, POST, PUT, DELETE). These methods specify the operations that can be performed on resources and provide a common interface regardless of the type of resource. #### Hypermedia -In BEAR.Sunday's ROA, each resource provides affordances (available operations and functions for clients) through hyperlinking. These links represent the operations that clients can perform and guide navigation within the application. +In BEAR.Sunday's Resource Oriented Architecture (ROA), each resource provides affordances (available operations and functions for the client) through hyperlinks. These links represent the operations available to the client and instruct how to navigate within the application. -#### Separation of Values and Representations +#### Separation of Value and Representation -In BEAR.Sunday's ROA, the values of resources are separated from their representations. The values are managed by the application's domain logic, while representations express those values in various formats such as JSON, XML, or HTML. This separation results in loose coupling between domain logic and presentation logic. +In BEAR.Sunday's ROA, the value and representation of resources are clearly separated. The value of a resource is managed by the application's domain logic, and the representation is for expressing that value in various formats (JSON, XML, HTML, etc.). This separation allows for loose coupling between domain logic and presentation logic. #### Differences from MVC -BEAR.Sunday's ROA takes a different approach from traditional MVC (Model-View-Controller) architecture. While MVC separates an application into three components (model, view, and controller), BEAR.Sunday injects views into resource objects. Resources and views are loosely coupled, with clear separation of concerns. +BEAR.Sunday's ROA takes a different approach from the conventional MVC architecture. MVC composes an application with three components: model, view, and controller. In contrast, BEAR.Sunday injects views into resource objects. Resources and views are loosely coupled, and their responsibilities are clearly separated. -Unlike MVC, where there are no constraints on the relationship between controllers and models, BEAR.Sunday uses hyperlinks and URIs to constrain the inclusion of other resources, allowing for declarative implementation. +Also, in contrast to MVC where there are no constraints on the relationship between the controller and the model, resources have constraints on including other resources using hyperlinks and URIs, and this can be done declaratively. ### Dependency Injection (DI) -Dependency Injection (DI) is a crucial technique in object-oriented programming that enhances the design and structure of applications. The primary purpose of DI is to divide an application's functionality into multiple independent domains or roles and manage the dependencies between them. +Dependency Injection (DI) is an important technique for enhancing the design and structure of applications in object-oriented programming. The central purpose of DI is to divide an application's responsibilities into multiple components with independent roles and manage the dependencies between them. -DI helps in horizontally splitting a single function into multiple functions. The split functions become "dependencies" that can be independently developed and tested. By injecting these dependencies, which have clear responsibilities and roles based on the single responsibility principle, object reusability and testability are improved. Dependencies are also vertically split into other dependencies, forming a tree of dependencies. +DI helps to horizontally divide one responsibility into multiple functions. The divided functions can be developed and tested independently as "dependencies". By injecting those dependencies with clear responsibilities based on the single responsibility principle from the outside, the reusability and testability of objects are improved. Dependencies can also be vertically divided into other dependencies, forming a tree of dependencies. -BEAR.Sunday's DI utilizes an independent package called [Ray.Di](https://github.com/ray-di/Ray.Di), incorporating the design philosophy of Guice, Google's DI framework. It covers almost all the features of Guice. +BEAR.Sunday's DI uses a separate package called [Ray.Di](https://github.com/ray-di/Ray.Di), which adopts the design philosophy of Google's DI framework Guice and covers almost all of its features. -Additionally, BEAR.Sunday's DI offers the following advantages: +It also has the following characteristics: -* The ability to change bindings based on context, allowing for different implementations during testing. -* Enhanced code self-descriptiveness through attribute-based configuration. -* Improved runtime performance compared to other DI containers by resolving dependencies at compile time. -* Visualization of object dependencies as a graph, e.g., [Application Skeleton](/images/app.svg). +* Bindings can be changed by context, allowing different implementations to be injected during testing. +* Attribute-based configuration enhances the self-descriptiveness of the code. +* Ray.Di performs dependency resolution at compile-time, improving runtime performance. This is different from other DI containers that resolve dependencies at runtime. +* Object dependencies can be visualized as a graph. Example: [Application Skeleton](/images/app.svg) Ray.Di logo -### Aspect-Oriented Programming (AOP) +### Aspect Oriented Programming (AOP) -Aspect-Oriented Programming (AOP) is a pattern that enhances application flexibility by separating core concerns (such as business logic) from cross-cutting concerns (such as logging and caching). Cross-cutting concerns refer to functionalities or processes that span multiple modules or layers. BEAR.Sunday's AOP allows for flexible configuration based on context by binding transversal processing declaratively using attributes in PHP. Ray.Aop, an independent package used by BEAR.Sunday, complies with the [AOP Alliance](https://aopalliance.sourceforge.net/) in Java and offers the following features: +Aspect-Oriented Programming (AOP) is a pattern that realizes flexible applications by separating essential concerns such as business logic from cross-cutting concerns such as logging and caching. Cross-cutting concerns refer to functions or processes that span across multiple modules or layers. It is possible to bind cross-cutting processes based on search conditions and flexibly configure them based on context. -AOP is often misunderstood as a technique that breaks existing order with its powerful capabilities. However, its true value lies in complementing areas where object-oriented programming falls short, such as exploratory function assignment using matchers and separation of transversal processing. AOP is a paradigm that enables the creation of transversal constraints within an application, functioning as an application framework. +BEAR.Sunday's AOP uses a separate package called Ray.Aop, which declaratively binds cross-cutting processes by attaching PHP attributes to classes and methods. Ray.Aop conforms to Java's [AOP Alliance](https://aopalliance.sourceforge.net/) and has the following characteristics. + +AOP is often misunderstood as a technology that "has the strong power to break the existing order". However, its raison d'être is not to exercise power beyond constraints but to complement areas where object-orientation is not well-suited, such as exploratory assignment of functions using matchers and separation of cross-cutting processes. AOP is a paradigm that can create cross-cutting constraints for applications, in other words, it functions as an application framework. ## Performance and Scalability -### Event-Driven Content Strategy Based on ROA and Integration with Modern CDN +### ROA-based Event-Driven Content Strategy with Modern CDN Integration -BEAR.Sunday, with its core ROA, integrates with instant-purgable CDNs like Fastly to implement an advanced event-driven caching strategy. Instead of traditional TTL (Time to Live) cache invalidation, this strategy instantly invalidates CDN, server-side caches, and ETags (Entity Tags) based on resource state change events. +BEAR.Sunday realizes an advanced event-driven caching strategy by integrating with instant purge-capable CDNs such as Fastly, with Resource Oriented Architecture (ROA) at its core. Instead of invalidating caches based on the conventional TTL (Time to Live), this strategy immediately invalidates the CDN and server-side caches, as well as ETags (entity tags), in response to resource state change events. -By adopting this non-volatile approach to CDN content, BEAR.Sunday avoids SPOF (Single Point of Failure), ensuring high availability and fault tolerance. It also maximizes user experience and cost efficiency, enabling dynamic content to benefit from the same distributed caching as static content, thus realizing the Web's original principle of scalability and network cost reduction through distributed caching, empowered by modern technology. +By taking this approach of creating non-volatile and persistent content on CDNs, it not only avoids SPOF (Single Point of Failure) and achieves high availability and fault tolerance but also maximizes user experience and cost efficiency. It realizes the same distributed caching as static content for dynamic content, which is the original principle of the Web. It re-realizes the scalable and network cost-reducing distributed caching principle that the Web has had since the 1990s with modern technology. -#### Cache Invalidation Based on Semantic Methods and Dependencies +#### Cache Invalidation by Semantic Methods and Dependencies -In BEAR.Sunday's ROA, each resource operation is assigned a semantic meaning. For example, the GET method retrieves a resource, while the PUT method updates it. These methods work in an event-driven manner, efficiently invalidating related caches. When a specific resource is updated, the caches of resources that depend on it are invalidated, ensuring data consistency and freshness, and providing users with the latest information. +In BEAR.Sunday's ROA, each resource operation is given a semantic role. For example, the GET method retrieves a resource, and the PUT method updates a resource. These methods collaborate in an event-driven manner and efficiently invalidate related caches. For instance, when a specific resource is updated, the cache of resources that require that resource is invalidated. This ensures data consistency and freshness, providing users with the latest information. -#### ETag-Based Identity Verification and Fast Response +#### Identity Confirmation and Fast Response with ETag -By setting ETags before system boot, BEAR.Sunday quickly verifies content identity and returns a 304 Not Modified response if there are no changes, minimizing network load. +By setting ETags before the system boots, content identity can be quickly confirmed, and if there are no changes, a 304 Not Modified response is returned to minimize network load. -#### Donut Caching and Partial Updates with ESI +#### Partial Updates with Donut Caching and ESI -BEAR.Sunday employs a donut caching strategy, utilizing ESI (Edge Side Includes) to enable partial content updates at the CDN edge. This technique allows dynamic updates of only the necessary parts without re-caching the entire page, improving cache efficiency. +BEAR.Sunday adopts a donut caching strategy and uses ESI (Edge Side Includes) to enable partial content updates at the CDN edge. This technology allows for dynamic updates of only the necessary parts without re-caching the entire page, improving caching efficiency. -The integration of BEAR.Sunday with Fastly, along with the ROA-based caching strategy, not only enables advanced distributed caching but also enhances application performance and resilience. +In this way, BEAR.Sunday and Fastly's integration of ROA-based caching strategy not only realizes advanced distributed caching but also enhances application performance and fault tolerance. -### Faster Boot-up +### Accelerated Startup -In the world of DI, users typically avoid direct handling of injectors (DI containers). Instead, they generate a single root object at the application entry point to start the application. In BEAR.Sunday's DI, there is essentially no manipulation of the DI container during configuration. Although the root object is large, it is a single variable that is reused across requests, resulting in an extremely optimized bootstrap process. +In the original world of DI, users avoid dealing directly with the injector (DI container) as much as possible. Instead, they generate a single root object at the application's entry point to start the application. In BEAR.Sunday's DI, there is virtually no DI container manipulation even at configuration time. The root object is huge but is a single variable, so it is reused beyond requests, realizing an optimized bootstrap to the limit. ## Developer Experience -### Testability +### Ease of Testing -BEAR.Sunday facilitates testing and makes it more effective due to the following design characteristics: +BEAR.Sunday allows for easy and effective testing due to the following design features: -* Each resource is independent, and the stateless nature of REST requests simplifies testing. - The separation of resource values and representations allows for testing the state of resources even when using HTML representations. -* API testing can be performed by following hypermedia links, using the same PHP and HTTP code. -* Contextual binding allows for injecting different implementations during testing. +* Each resource is independent, and testing is easy due to the stateless request nature of REST. + Since the state and representation of resources are clearly separated, it is possible to test the state of resources even when they are in HTML representation. +* API testing can be performed while following hypermedia links, and tests can be written in the same code for PHP and HTTP. +* Different implementations are bound during testing through context-based binding. ### API Documentation Generation -API documentation is automatically generated from the code, ensuring consistency between the code and documentation and improving maintainability. +API documentation is automatically generated from the code. It maintains consistency between code and documentation and improves maintainability. ### Visualization and Debugging -By leveraging the feature of resources rendering themselves, BEAR.Sunday provides visualization of resource boundaries during development. It also enables monitoring of resource states and real-time reflection of changes made in online editors for PHP code or HTML templates. +Utilizing the technical feature of resources rendering themselves, during development, the scope of resources can be indicated on HTML, resource states can be monitored, and PHP code and HTML templates can be edited in an online editor and reflected in real-time. ## Extensibility and Integration -### Integration of PHP Interface and SQL Execution +### Integration of PHP Interfaces and SQL Execution -BEAR.Sunday simplifies the management of SQL statement execution for database interactions through PHP interfaces. Without implementing classes, you can directly bind SQL execution objects to PHP interfaces. This approach connects the domain and infrastructure layers through PHP interfaces. +In BEAR.Sunday, the execution of SQL statements for interacting with databases can be easily managed through PHP interfaces. It is possible to directly bind SQL execution objects to PHP interfaces without implementing classes. The boundary between the domain and infrastructure is connected by PHP interfaces. -You can specify argument types, and if there are missing dependencies, DI will resolve them as strings. For example, if the current time is needed for SQL execution, it will be automatically bound without the need for manual passing, reducing the client's responsibility for passing all arguments. +In that case, types can also be specified for arguments, and any missing parts are dependency-resolved by DI and used as strings. Even when the current time is needed for SQL execution, there is no need to pass it; it is automatically bound. This helps keep the code concise as the client is not responsible for passing all arguments. -Direct management of SQL also simplifies debugging by allowing direct observation of SQL query behavior, facilitating issue identification and resolution. +Moreover, direct management of SQL makes debugging easier when errors occur. The behavior of SQL queries can be directly observed, allowing for quick identification and correction of problems. ### Integration with Other Systems -BEAR.Sunday integrates with console applications, enabling access from both web and command-line interfaces without modifying the source code. Additionally, it allows parallel execution of different BEAR.Sunday applications within the same PHP runtime, eliminating the need for microservices and facilitating the coordination of multiple independent applications. +Integration with console applications allows access from both the web and the command line without changing the source code. Also, by being able to concurrently execute different BEAR.Sunday applications within the same PHP runtime, multiple independent applications can be coordinated without building microservices. ### Stream Output -By assigning streams, such as file pointers, to the body of a resource, BEAR.Sunday enables the output of large-scale content that cannot be handled in memory. Streams can coexist with regular variables, providing flexibility in handling large responses. +By assigning streams such as file pointers to the body of a resource, large-scale content that cannot be handled in memory can be output. In that case, streams can also be mixed with ordinary variables, allowing flexible output of large-scale responses. ### Gradual Migration from Other Systems -BEAR.Sunday offers a gradual migration path, seamlessly integrating with other frameworks and systems like Laravel and Symfony. As a Composer package, BEAR.Sunday can be incrementally introduced into an existing codebase, allowing developers to leverage its features without a complete rewrite. +BEAR.Sunday provides a gradual migration path and enables seamless integration with other frameworks and systems such as Laravel and Symfony. This framework can be implemented as a Composer package, allowing developers to gradually introduce BEAR.Sunday's features into their existing codebase. ### Flexibility in Technology Migration -BEAR.Sunday protects your investment by considering future technological changes and evolving requirements. Even if you need to migrate to another framework or language, the resources built with BEAR.Sunday will not be wasted. In the PHP ecosystem, you can continue using BEAR.Sunday applications as Composer packages, and with BEAR.Thrift, you can efficiently access BEAR.Sunday resources from other languages. HTTP access is also possible without using Thrift. Additionally, SQL code is easily reusable. +BEAR.Sunday protects investments in preparation for future technological changes and evolving requirements. Even if there is a need to migrate from this framework to another framework or language, the constructed resources will not go to waste. In a PHP environment, BEAR.Sunday applications can be integrated as Composer packages and continuously utilized, and BEAR.Thrift allows efficient access to BEAR.Sunday resources from other languages. When not using Thrift, access via HTTP is also possible. SQL code can also be easily reused. -Even if your libraries have strong dependencies on specific PHP versions, BEAR.Thrift allows you to coexist with different PHP versions. +Even if the library being used is strongly dependent on a specific PHP version, different versions of PHP can coexist using BEAR.Thrift. ## Design Philosophy and Quality -### Adoption of Standard Technologies and Avoidance of Proprietary Specifications +### Adoption of Standard Technologies and Elimination of Proprietary Standards -BEAR.Sunday embraces standard technologies and avoids proprietary specifications and rules as much as possible. For example, it supports JSON and www-form-urlencoded formats for HTTP request content negotiation by default and uses the [vnd.error+json](https://github.com/blongden/vnd.error) media type format for error responses. For resource linking, it adopts [HAL](https://datatracker.ietf.org/doc/html/draft-kelly-json-hal) (Hypertext Application Language) and utilizes [JsonSchema](https://json-schema.org/) for validation. +BEAR.Sunday has a design philosophy of adopting standard technologies as much as possible and eliminating framework-specific standards and rules. For example, it supports content negotiation for JSON format and www-form format HTTP requests by default and uses the [vnd.error+json](https://github.com/blongden/vnd.error) media type format for error responses. It actively incorporates standard technologies and specifications such as adopting [HAL](https://datatracker.ietf.org/doc/html/draft-kelly-json-hal) (Hypertext Application Language) for links between resources and using [JsonSchema](https://json-schema.org/) for validation. -At the same time, BEAR.Sunday refrains from introducing its own validation rules or framework-specific specifications. +On the other hand, it eliminates proprietary validation rules and framework-specific standards and rules as much as possible. ### Object-Oriented Principles -BEAR.Sunday emphasizes object-oriented principles to ensure the long-term maintainability of applications. +BEAR.Sunday emphasizes object-oriented principles to make applications maintainable in the long term. -#### Composition Over Inheritance +#### Composition over Inheritance -BEAR.Sunday encourages the use of composition over inheritance. Directly calling methods from a parent class in a child class can increase coupling between classes. In BEAR.Sunday, the only abstract class that requires runtime inheritance for design purposes is `BEAR\Resource\ResourceObject`, and its methods exist solely for use by other classes. There is no instance in BEAR.Sunday where a framework's parent class method is called at runtime by a user. +Composition is recommended over inheritance classes. Generally, directly calling a parent class's method from a child class can potentially increase the coupling between classes. The only abstract class that requires inheritance at runtime by design is the resource class `BEAR\Resource\ResourceObject`, but the methods of ResourceObject exist solely for other classes to use. There is no case in BEAR.Sunday where a user calls a method of a framework's parent class that they have inherited at runtime. -#### Everything is Injection +#### Everything is Injected -In BEAR.Sunday, framework classes do not refer to "configuration files" or "debug constants" during execution to determine their behavior. Instead, dependencies corresponding to the desired behavior are injected. This approach eliminates the need to modify code when changing application behavior; you only need to change the binding of dependencies to interfaces. Constants like APP_DEBUG or APP_MODE do not exist in BEAR.Sunday. There is no way to know, nor is there a need to know, which mode the software is running in after it has started. +Framework classes do not refer to "configuration files" or "debug constants" during execution to determine their behavior. Dependencies corresponding to the behavior are injected. This means that to change the application's behavior, there is no need to change the code; only the binding of the implementation of the dependency to the interface needs to be changed. Constants like APP_DEBUG or APP_MODE do not exist. There is no way to know in what mode the software is currently running after it has started, and there is no need to know. -### Persistent Backward Compatibility +### Permanent Assurance of Backward Compatibility -BEAR.Sunday is designed with a strong focus on maintaining backward compatibility, and since its release, it has continued to evolve without breaking backward compatibility. In modern software development, frequent backward-incompatible changes and the associated burden of modifications and testing are common challenges. However, BEAR.Sunday has successfully avoided these issues. +BEAR.Sunday is designed with an emphasis on maintaining backward compatibility in the evolution of software and has continued to evolve without breaking backward compatibility since its release. In modern software development, frequent breaking of backward compatibility and the associated burden of modification and testing have become a challenge, but BEAR.Sunday has avoided this problem. -BEAR.Sunday not only adopts semantic versioning but also refrains from performing breaking changes in major version updates. The addition of new features or modification of existing ones does not affect existing code. Deprecated code is attributed but not removed, and it does not impact the behavior of existing code. Instead, new features are introduced, and evolution continues. +BEAR.Sunday not only adopts semantic versioning but also does not perform major version upgrades that involve breaking changes. It prevents new feature additions or changes to existing features from affecting existing code. Code that has become old and unused is given the attribute "deprecated" but is never deleted and does not affect the behavior of existing code. Instead, new features are added, and evolution continues. ### Code Quality -To deliver high-quality applications, the BEAR.Sunday framework itself maintains a high level of code quality: +To provide applications with high code quality, the BEAR.Sunday framework also strives to maintain a high standard of code quality. -* The framework's code is analyzed with strict settings using static analysis tools like Psalm and PHPStan. -* It achieves 100% test coverage and nearly 100% type coverage. -* The system is primarily immutable, and tests do not require initialization, resulting in a clean and efficient testing process. BEAR.Sunday takes advantage of the power of PHP's asynchronous communication engines like Swoole. +* The framework code is applied at the strictest level by both static analysis tools, Psalm and PHPStan. +* It maintains 100% test coverage and nearly 100% type coverage. +* It is fundamentally an immutable system and is so clean that initialization is not required every time, even in tests. It unleashes the power of PHP's asynchronous communication engines like Swoole. -## Value Proposition of BEAR.Sunday +## The Value BEAR.Sunday Brings ### Value for Developers -* **Improved Productivity**: Based on robust design patterns and principles that remain unchanged over time, developers can focus on core business logic. -* **Team Collaboration**: By providing consistent guidelines and structures, BEAR.Sunday promotes collaboration among developers, ensuring unified and loosely coupled code, enhancing code readability and maintainability. -* **Flexibility and Extensibility**: The decision to exclude libraries from BEAR.Sunday gives developers the freedom and flexibility to choose components. -* **Testability**: DI (Dependency Injection) and ROA (Resource-Oriented Architecture) in BEAR.Sunday enhance testability. +* Improved productivity: Based on robust design patterns and principles with constraints that don't change over time, developers can focus on core business logic. +* Collaboration in teams: By providing development teams with consistent guidelines and structure, it keeps the code of different engineers loosely coupled and unified, improving code readability and maintainability. +* Flexibility and extensibility: BEAR.Sunday's policy of not including libraries brings developers flexibility and freedom in component selection. +* Ease of testing: BEAR.Sunday's DI (Dependency Injection) and ROA (Resource Oriented Architecture) increase the ease of testing. ### Value for Users -* **High Performance**: BEAR.Sunday's optimized fast boot-up and CDN-centric caching strategy deliver a fast and responsive user experience. -* **Reliability and Availability**: BEAR.Sunday's CDN-centric caching strategy minimizes SPOF (Single Point of Failure), ensuring stable and reliable service for users. -* **Usability**: BEAR.Sunday's superior connectivity simplifies integration with other languages and systems. +* High performance: BEAR.Sunday's optimized fast startup and CDN-centric caching strategy brings users a fast and responsive experience. +* Reliability and availability: BEAR.Sunday's CDN-centric caching strategy minimizes single points of failure (SPOF), allowing users to enjoy stable services. +* Ease of use: BEAR.Sunday's excellent connectivity makes it easy to collaborate with other languages and systems. -### Value for Businesses +### Value for Business -* **Reduced Development Costs**: BEAR.Sunday's consistent guidelines and structures promote efficient and sustainable development processes, leading to reduced development costs. -* **Lower Maintenance Costs**: BEAR.Sunday's approach to maintaining backward compatibility minimizes the time and cost associated with adapting to changes, ensuring technological continuity. -* **High Extensibility**: BEAR.Sunday enables easy application extension by modifying behavior with minimal code changes, utilizing techniques like DI (Dependency Injection) and AOP (Aspect-Oriented Programming) to accommodate business growth and changes. -* **Superior User Experience (UX)**: BEAR.Sunday's high performance and availability contribute to user satisfaction, fostering customer loyalty, expanding the customer base, and driving business success. +* Reduced development costs: The consistent guidelines and structure provided by BEAR.Sunday promote a sustainable and efficient development process, reducing development costs. +* Reduced maintenance costs: BEAR.Sunday's approach to maintaining backward compatibility increases technical continuity and minimizes the time and cost of change response. +* High extensibility: With technologies like DI (Dependency Injection) and AOP (Aspect Oriented Programming) that change behavior while minimizing code changes, BEAR.Sunday allows applications to be easily extended in line with business growth and changes. +* Excellent User Experience (UX): BEAR.Sunday provides high performance and high availability, increasing user satisfaction, enhancing customer loyalty, expanding the customer base, and contributing to business success. -Excellent constraints remain unchanged. The constraints imposed by BEAR.Sunday bring specific value to developers, users, and businesses alike. +Excellent constraints do not change. The constraints brought by BEAR.Sunday provide specific value to developers, users, and businesses respectively. -BEAR.Sunday is a framework designed based on the principles and spirit of the Web, empowering developers with clear constraints to build flexible and robust applications. +BEAR.Sunday is a framework designed based on the principles and spirit of the Web, providing developers with clear constraints to empower them to build flexible and robust applications. From 64e3f8675582538ed8e23b5517329aa1cef88d31 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sun, 21 Apr 2024 22:03:55 +0900 Subject: [PATCH 09/12] =?UTF-8?q?Claude3=E3=81=8CCommand-R=E3=81=AE?= =?UTF-8?q?=E7=BF=BB=E8=A8=B3=E3=81=A8=E6=AF=94=E8=BC=83=E3=81=97=E3=81=A6?= =?UTF-8?q?=E8=89=AF=E3=81=84=E3=81=A8=E3=81=93=E3=82=8D=E3=82=92=E9=83=A8?= =?UTF-8?q?=E5=88=86=E7=9A=84=E3=81=AB=E8=87=AA=E3=82=89=E5=8F=96=E3=82=8A?= =?UTF-8?q?=E5=85=A5=E3=82=8C=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manuals/1.0/en/15.tech.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/manuals/1.0/en/15.tech.md b/manuals/1.0/en/15.tech.md index 8c4f8c39..9041caf4 100644 --- a/manuals/1.0/en/15.tech.md +++ b/manuals/1.0/en/15.tech.md @@ -19,35 +19,35 @@ The distinctive technologies and features of BEAR.Sunday are explained in the fo ### Resource Oriented Architecture (ROA) -BEAR.Sunday's ROA is an architecture that realizes RESTful API within a web application. It is the core of BEAR.Sunday's design principles and serves as a hypermedia framework as well as treating "object as a service". Similar to the Web, all data and functions are considered resources and are operated through standardized interfaces such as GET, POST, PUT, and DELETE. +BEAR.Sunday's ROA is an architecture that realizes RESTful API within a web application. It is the core of BEAR.Sunday's design principles, functioning as both a hypermedia framework and a service-oriented architecture. Similar to the Web, all data and functions are considered resources and are operated through standardized interfaces such as GET, POST, PUT, and DELETE. #### URI -URI (Uniform Resource Identifier) is a key element to the success of the Web and is also at the heart of BEAR.Sunday's ROA. By assigning URIs to all resources handled by the application, resources can be easily identified and accessed. URIs not only function as identifiers for resources but are also used to express links between resources and enable navigation. +URI (Uniform Resource Identifier) is a key element to the success of the Web and is also at the heart of BEAR.Sunday's ROA. By assigning URIs to all resources handled by the application, resources can be easily identified and accessed. URIs not only function as identifiers for resources but also express links between resources. #### Uniform Interface -Access to resources is done using HTTP methods (GET, POST, PUT, DELETE). These methods specify the operations that can be performed on resources and provide a common interface regardless of the type of resource. +Access to resources is done using HTTP methods such as GET, POST, PUT, and DELETE. These methods specify the operations that can be performed on resources and provide a common interface regardless of the type of resource. #### Hypermedia -In BEAR.Sunday's Resource Oriented Architecture (ROA), each resource provides affordances (available operations and functions for the client) through hyperlinks. These links represent the operations available to the client and instruct how to navigate within the application. +In BEAR.Sunday's Resource Oriented Architecture (ROA), each resource provides affordances (available operations and functions for the client) through hyperlinks. These links represent the operations that clients can perform and guide navigation within the application. #### Separation of Value and Representation -In BEAR.Sunday's ROA, the value and representation of resources are clearly separated. The value of a resource is managed by the application's domain logic, and the representation is for expressing that value in various formats (JSON, XML, HTML, etc.). This separation allows for loose coupling between domain logic and presentation logic. +In BEAR.Sunday's ROA, the value of a resource is clearly separated from its representation. The value of a resource is managed by the application's domain logic, while the representation is for expressing that value in various formats (JSON, XML, HTML, etc.). This separation allows for loose coupling between domain logic and presentation logic. #### Differences from MVC -BEAR.Sunday's ROA takes a different approach from the conventional MVC architecture. MVC composes an application with three components: model, view, and controller. In contrast, BEAR.Sunday injects views into resource objects. Resources and views are loosely coupled, and their responsibilities are clearly separated. +BEAR.Sunday's ROA takes a different approach from the conventional MVC (Model-View-Controller) architecture. While MVC composes an application with three components: model, view, and controller, BEAR.Sunday injects views into resource objects. Resources and views are loosely coupled, and their responsibilities are clearly separated. Also, in contrast to MVC where there are no constraints on the relationship between the controller and the model, resources have constraints on including other resources using hyperlinks and URIs, and this can be done declaratively. ### Dependency Injection (DI) -Dependency Injection (DI) is an important technique for enhancing the design and structure of applications in object-oriented programming. The central purpose of DI is to divide an application's responsibilities into multiple components with independent roles and manage the dependencies between them. +Dependency Injection (DI) is an important technique for enhancing the design and structure of applications in object-oriented programming. The central purpose of DI is to divide an application's responsibilities into multiple components with independent domains or roles and manage the dependencies between them. -DI helps to horizontally divide one responsibility into multiple functions. The divided functions can be developed and tested independently as "dependencies". By injecting those dependencies with clear responsibilities based on the single responsibility principle from the outside, the reusability and testability of objects are improved. Dependencies can also be vertically divided into other dependencies, forming a tree of dependencies. +DI helps to horizontally divide one responsibility into multiple functions. The divided functions can be developed and tested independently as "dependencies". By injecting those dependencies with clear responsibilities and roles based on the single responsibility principle from the outside, the reusability and testability of objects are improved. Dependencies can also be vertically divided into other dependencies, forming a tree of dependencies. BEAR.Sunday's DI uses a separate package called [Ray.Di](https://github.com/ray-di/Ray.Di), which adopts the design philosophy of Google's DI framework Guice and covers almost all of its features. @@ -100,7 +100,7 @@ In the original world of DI, users avoid dealing directly with the injector (DI BEAR.Sunday allows for easy and effective testing due to the following design features: -* Each resource is independent, and testing is easy due to the stateless request nature of REST. +* Each resource is independent, and testing is easy due to the stateless nature of REST requests. Since the state and representation of resources are clearly separated, it is possible to test the state of resources even when they are in HTML representation. * API testing can be performed while following hypermedia links, and tests can be written in the same code for PHP and HTTP. * Different implementations are bound during testing through context-based binding. From 11111481656cc52ffefffd04f6cb687e2366baaf Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sun, 21 Apr 2024 22:17:52 +0900 Subject: [PATCH 10/12] Implement smooth scrolling for anchor links The commit introduces a new JavaScript file, scroller.js, which applies smooth scroll behavior to all anchor links when clicked. Additionally, the code modifies the browser's history to include the target of the click event. An event listener for 'popstate' has also been added, which smoothly scrolls to the historical state when triggered, improving user site navigation. --- _includes/manuals/1.0/footer.html | 1 + js/scroller.js | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 js/scroller.js diff --git a/_includes/manuals/1.0/footer.html b/_includes/manuals/1.0/footer.html index 65794b33..b4bf52eb 100644 --- a/_includes/manuals/1.0/footer.html +++ b/_includes/manuals/1.0/footer.html @@ -33,6 +33,7 @@ window.ga = function () { ga.q.push(arguments) }; ga.q = []; ga.l = +new Date; ga('create', 'UA-6074569-8', 'bearsunday.github.io'); ga('send', 'pageview'); + {% if page.category == 'Manual' %} diff --git a/js/scroller.js b/js/scroller.js new file mode 100644 index 00000000..afefadd8 --- /dev/null +++ b/js/scroller.js @@ -0,0 +1,23 @@ +// Added smooth scroll behavior to anchor links +document.querySelectorAll('a[href^="#"]').forEach(anchor => { + anchor.addEventListener('click', function (e) { + e.preventDefault(); + const target = document.querySelector(this.getAttribute('href')); + const targetTop = target.getBoundingClientRect().top + window.pageYOffset; + const targetId = this.getAttribute('href'); + history.pushState({ id: targetId, top: targetTop }, null, targetId); + target.scrollIntoView({ + behavior: 'smooth' + }); + }); +}); + +window.addEventListener('popstate', function(e) { + if (e.state && e.state.id) { + const target = document.querySelector(e.state.id); + window.scrollTo({ + top: e.state.top, + behavior: 'smooth' + }); + } +}); From 5c9b6415093f6be0a3c4e94ffd91b0b43972acb7 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sun, 21 Apr 2024 22:24:13 +0900 Subject: [PATCH 11/12] Update manuals/1.0/en/15.tech.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- manuals/1.0/en/15.tech.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manuals/1.0/en/15.tech.md b/manuals/1.0/en/15.tech.md index 9041caf4..f097f364 100644 --- a/manuals/1.0/en/15.tech.md +++ b/manuals/1.0/en/15.tech.md @@ -6,7 +6,7 @@ permalink: /manuals/1.0/en/tech.html --- # Technology -The distinctive technologies and features of BEAR.Sunday are explained in the following chapters. +The distinctive technologies and features of BEAR.Sunday are explained in the following chapters. * [Architecture and Design Principles](#architecture-and-design-principles) * [Performance and Scalability](#performance-and-scalability) From b187d7a271606bc06445eeb7d82479e9e09c5901 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sun, 21 Apr 2024 22:24:24 +0900 Subject: [PATCH 12/12] Update manuals/1.0/ja/15.tech.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- manuals/1.0/ja/15.tech.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manuals/1.0/ja/15.tech.md b/manuals/1.0/ja/15.tech.md index ba71090f..e85356b5 100644 --- a/manuals/1.0/ja/15.tech.md +++ b/manuals/1.0/ja/15.tech.md @@ -41,7 +41,7 @@ BEAR.SundayのROAでは、リソースの値と表現が明確に分離されて BEAR.SundayのROAは、従来のMVCアーキテクチャとは異なるアプローチをとっています。MVCはモデル、ビュー、コントローラーの3つのコンポーネントでアプリケーションを構成します。一方、BEAR.Sundayでは、リソースオブジェクトにビューがインジェクトされます。リソースとビューは疎結合で、それぞれの責務が明確に分離されています。 -また、MVCではコントローラーとモデルの関係に制約がないのと対照的に、リソースは他のリソースを含むことにハイパーリンクとURIを用いた制約があり、宣言的に行うことができます。 +また、MVCではコントローラーとモデルの関係に制約がないのと対照的に、リソースは他のリソースを含むことにハイパーリンクとURIを用いた制約があり、宣言的に行います。 ### 依存性の注入 (DI)