# Symfony アーキテクチャ (Symfony) > Hexagonal architecture、DDD、CQRS、repositories、DTOs、value objects、bounded contexts - 24 面接問題 - Senior - [面接問題: Symfony](https://sharpskill.dev/ja/technologies/symfony/interview-questions.md) ## 1. hexagonal architecture において、ports の主な役割は何ですか? **回答** ports は、ビジネスドメインと外部世界との間の契約を定義するインターフェースです。primary ports(または driving ports)は外部アクターがドメイン内のアクションをトリガーできるようにし、secondary ports(または driven ports)はドメインがデータベースやサードパーティサービスなどの外部インフラと連携できるようにします。この抽象化により、ビジネスドメインに影響を与えることなく実装を変更できます。 ## 2. Symfony の hexagonal architecture における adapter とは何ですか? **回答** adapter は、外部世界と domain をつなぐ port の具体的な実装です。例えば、DoctrineUserRepository は UserRepositoryInterface port を実装する adapter です。primary 側では、Symfony controller が HTTP リクエストを domain の use case に適応させる adapter となります。この分離により、infrastructure とは独立して domain をテストできます。 ## 3. Domain-Driven Design において、Value Object の主な特徴は何ですか? **回答** Value Object は、識別子ではなく属性によって定義されます。同じ値を持つ 2 つの Value Object は等しいとみなされます。これらは不変であり、変更を加えると新しいインスタンスが生成されます。例えば、Email や Money オブジェクトは典型的な Value Object です。この不変性によりデータの一貫性が保証され、複雑なシステムにおいてコードを推論しやすくなります。 ## さらに21問利用可能 - DDD における Aggregate Root の役割は何ですか? - DTO(Data Transfer Object)とは何ですか、そして Symfony ではいつ使用しますか? 無料で登録: https://sharpskill.dev/ja/login ## その他のSymfony面接トピック - [モダンPHP (8.1+)](https://sharpskill.dev/ja/technologies/symfony/interview-questions/php-modern-features.md): 20問, Junior - [Symfony の基礎](https://sharpskill.dev/ja/technologies/symfony/interview-questions/symfony-basics.md): 25問, Junior - [Routing & Controllers](https://sharpskill.dev/ja/technologies/symfony/interview-questions/routing-controllers.md): 20問, Junior - [Twig & Templates](https://sharpskill.dev/ja/technologies/symfony/interview-questions/twig-templates.md): 20問, Junior - [Doctrine ORM の基礎](https://sharpskill.dev/ja/technologies/symfony/interview-questions/doctrine-orm-basics.md): 25問, Junior - [Symfony フォーム](https://sharpskill.dev/ja/technologies/symfony/interview-questions/forms.md): 22問, Junior - [データバリデーション](https://sharpskill.dev/ja/technologies/symfony/interview-questions/validation.md): 18問, Junior - [Dependency Injection & Services](https://sharpskill.dev/ja/technologies/symfony/interview-questions/dependency-injection.md): 24問, Mid-Level - [Security & Authentication](https://sharpskill.dev/ja/technologies/symfony/interview-questions/security-authentication.md): 26問, Mid-Level - [Doctrine 上級](https://sharpskill.dev/ja/technologies/symfony/interview-questions/doctrine-advanced.md): 24問, Mid-Level - [API Platform](https://sharpskill.dev/ja/technologies/symfony/interview-questions/api-platform.md): 22問, Mid-Level - [Serializer Component](https://sharpskill.dev/ja/technologies/symfony/interview-questions/serializer.md): 20問, Mid-Level - [Events & Event Subscribers](https://sharpskill.dev/ja/technologies/symfony/interview-questions/events-subscribers.md): 20問, Mid-Level - [Console & Commands](https://sharpskill.dev/ja/technologies/symfony/interview-questions/console-commands.md): 18問, Mid-Level - [Messenger Component](https://sharpskill.dev/ja/technologies/symfony/interview-questions/messenger.md): 22問, Mid-Level - [HTTP Client](https://sharpskill.dev/ja/technologies/symfony/interview-questions/http-client.md): 18問, Mid-Level - [キャッシュとパフォーマンス](https://sharpskill.dev/ja/technologies/symfony/interview-questions/cache.md): 20問, Mid-Level - [Workflow Component](https://sharpskill.dev/ja/technologies/symfony/interview-questions/workflow.md): 18問, Mid-Level - [Testing Symfony](https://sharpskill.dev/ja/technologies/symfony/interview-questions/testing.md): 22問, Mid-Level - [Mailer Component](https://sharpskill.dev/ja/technologies/symfony/interview-questions/mailer.md): 16問, Mid-Level - [翻訳と i18n](https://sharpskill.dev/ja/technologies/symfony/interview-questions/translations.md): 16問, Mid-Level - [EasyAdmin Bundle](https://sharpskill.dev/ja/technologies/symfony/interview-questions/easyadmin.md): 18問, Mid-Level - [パフォーマンスと最適化](https://sharpskill.dev/ja/technologies/symfony/interview-questions/performance-optimization.md): 22問, Senior - [高度なセキュリティ](https://sharpskill.dev/ja/technologies/symfony/interview-questions/security-advanced.md): 22問, Senior - [カスタムバンドル](https://sharpskill.dev/ja/technologies/symfony/interview-questions/custom-bundles.md): 20問, Senior - [Symfony によるマイクロサービス](https://sharpskill.dev/ja/technologies/symfony/interview-questions/microservices.md): 22問, Senior - [Real-time & WebSockets](https://sharpskill.dev/ja/technologies/symfony/interview-questions/real-time.md): 18問, Senior - [Deployment & DevOps](https://sharpskill.dev/ja/technologies/symfony/interview-questions/deployment-devops.md): 20問, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/ja/technologies/symfony/interview-questions/architecture-patterns