Polygons examples

The gallery with sample polygon.yml file which you can grab, and use in your application.

Previous page

Simple web application

polygon.yml

polygon:
  packagePrivate: -1
  packages:
    dto:
      types: ['class']
      public: -1
    port:
      types: ['interface']
      public: -1
    endpoint:
      types: ['class']
      packagePrivate: -1

Example structure

.
├── 📂 catalogue
|   ├── 📂 dto
|   |   └── 🔓 Product.java
|   |   └── 🔓 Category.java
|   ├── 📂 port
|   |   └── 🔓 ProductFinder.java
|   └── ⚬ GetProductEndpoint.java
|   └── ⚬ GetCategoryEndpoint.java
|   └── ⚬ StoreProductEndpoint.java
│   └── ⚬ RepositoryProductFinder.java
│   └── ⚬ CategoryNormalizer.java
├── 📂 authors
|   ├── 📂 dto
|   |   └── 🔓 Author.java
|   ├── 📂 port
|   |   └── 🔓 AuthorStorer.java
|   └── ⚬ StoreNewAuthorEndpoint.java
│   └── ⚬ DatabaseAuthorStorer.java
└── 🔓 SampleApplication.java

Project with cqrs

polygon.yml

polygon:
  packagePrivate: -1
  packages:
    command:
      types: ['class']
      packagePrivate: -1
    query:
      types: ['class']
      packagePrivate: -1
    events:
      types: ['class']
      public: -1
    ports:
      types: ['interface']
      public: -1

Example structure

.
├── 📂 app
|   ├── 📂 ports
|   |   └── 📄 CommandsBus.java
|   |   └── 📄 QueriesBus.java
│   └── 📄 RxCommandsBus.java
│   └── 📄 QueriesCommandsBus.java
├── 📂 shipments
|   ├── 📂 command
|   |   └── 📄 DeliverShipmentCommand.java
|   |   └── 📄 SendShipmentCommand.java
|   ├── 📂 query
|   |   └── 📄 FindShipmentQuery.java
|   ├── 📂 events
|   |   └── 📄 OrderShippedEvent.java
|   |   └── 📄 ShipmentDeliveredEvent.java
|   └── 📄 ShippingStatus.java
|   └── 📄 Shipment.java
│   └── 📄 ShipmentRepository.java
│   └── 📄 ShipmentRepository.java
├── 📂 invoices
|   ├── 📂 command
|   |   └── 📄 CreateInvoiceCommand.java
|   ├── 📂 query
|   |   └── 📄 FindInvoiceQuery.java
|   ├── 📂 events
|   |   └── 📄 InvoiceCreatedEvent.java
|   └── 📄 Invoice.java
|   └── 📄 InvoiceLine.java
|   └── 📄 InvoiceItem.java
|   └── 📄 Tax.java
|   └── 📄 TaxPolicy.java
│   └── 📄 InvoicesRepository.java
│   └── 📄 NewShipmentEventListener.java
└── 📄 FooApplication.java

Events based polygons

polygon.yml

polygon:
  # all events listeners goes here
  packagePrivate: -1
  packages:
    events:
      types: ['class']
      public: -1
    dto:
      types: ['class']
      public: -1

Example structure

.
├── 📂 customers
|   ├── 📂 events
|   |   └── 📄 CustomerCreatedEvent.java
|   |   └── 📄 CustomerDeletedEvent.java
|   |   └── 📄 ChangeCustomerStatusEvent.java
|   ├── 📂 dto
|   |   └── 📄 Customer.java
│   └── 📄 CreateCustomerEndpoint.java
│   └── 📄 DeleteCustomerEndpoint.java
│   └── 📄 CustomerRepository.java
├── 📂 offer
|   ├── 📂 events
|   |   └── 📄 NewDiscountEvent.java
|   |   └── 📄 PromoOfferSentToCustomerEvent.java
|   ├── 📂 dto
|   |   └── 📄 Offer.java
|   |   └── 📄 OfferItem.java
|   |   └── 📄 Discount.java
│   └── 📄 NewCustomerListener.java
│   └── 📄 OfferSender.java
└── 📄 FooApplication.java