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

Example classes structure

demo-app
catalogue
dto
Product.java
Category.java
port
ProductFinder.java
GetProductEndpoint.java
GetCategoryEndpoint.java
StoreProductEndpoint.java
RepositoryProductFinder.java
CategoryNormalizer.java
authors
dto
Author.java
port
AuthorCrud.java
StoreNewAuthorEndpoint.java
DatabaseAuthorCrud.java
DemoApplication.java

Project with cqrs

polygon.yml

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

Example classes structure

demo-app
app
ports
CommandsBus.java
AsyncCommandsBus.java
shipments
ports
FindShipmentQuery.java
events
DeliverShipmentCommand.java
SendShipmentCommand.java
OrderShippedEvent.java
ShipmentDeliveredEvent.java
ShippingStatus.java
Shipment.java
ShipmentRepository.java
invoices
ports
FindInvoiceQuery.java
events
CreateInvoiceCommand.java
InvoiceCreatedEvent.java
Invoice.java
InvoiceLine.java
InvoiceItem.java
Tax.java
TaxInvoice.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 classes structure

demo-app
customers
events
CustomerCreatedEvent.java
CustomerDeletedEvent.java
ChangeCustomerStatusEvent.java
dto
Customer.java
CreateCustomerEndpoint.java
DeleteCustomerEndpoint.java
CustomerRepository.java
offer
events
NewDiscountAppearedEvent.java
PromoOfferSentToCustomerEvent.java
dto
Offer.java
OfferItem.java
Discount.java
NewCustomerListener.java
OfferSender.java
DemoApplication.java