Get all associate/composite objects inside an object (in Abstract way)

I think you might want to step back from the design for a moment. What I’ve heard is this:

A payment consists of one or more components, and each component can be one of a variety of types

What it sounds like you need is a Payment table, then a PaymentComponent table with a foreign key relation back to the Payment table. You can then implement inheritance on the PaymentComponent table for your various forms of payment.

Leave a Comment