brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
software-architecture-hexagonalGuides the implementation of hexagonal (ports and adapters) architecture, focusing on best practices for decoupling business logic from external concerns.
Independent GitHub snapshot · Automated classification · Original documentation governs
name: software-architecture-hexagonal description: Guides the implementation of hexagonal (ports and adapters) architecture, focusing on best practices for decoupling business logic from external concerns. license: MIT compatibility: opencode metadata: version: "1.0.0" domain: coding triggers: hexagonal architecture, ports and adapters, hexagonal design patterns archetypes:
archetypes: tactical, educational anti_triggers: tightly coupled design response_profile: verbosity: medium directive_strength: high abstraction_level: tactical
Guides the implementation of hexagonal (ports and adapters) architecture, focusing on best practices for decoupling business logic from external concerns.
Core Domain Logic Implementation:
# Example demonstrating core domain logic separate from infrastructure
class Account:
def __init__(self, id, balance):
self.id = id
self.balance = balance
class AccountService:
def __init__(self, repository):
self.repository = repository
def create_account(self, id, initial_balance):
account = Account(id, initial_balance)
self.repository.save(account)
Establishing Ports and Adapters:
# Defining an Adapter for external service interactions
class PaymentProcessor:
def process_payment(self, account_id, amount):
# Logic to process payment through an external API
print(f'Processing payment of {amount} for account {account_id}')
Integration Example:
# Example showing integration with external services via adapters
payments:
url: http://payment-service/api
description: Service to handle payment processing
class Product:
def __init__(self, name, price):
self.name = name
self.price = price
class ProductService:
def add_product(self, product):
# Add logic for adding the product
pass
# Adapter example
class ExternalServiceAdapter:
def call_service(self):
# Logic to interact with an external service
pass