Justifying a recovered multiplicity

While reverse engineering a billing system, you find that the class below is the only code that creates or modifies Invoice objects; assume nothing creates them by other means such as reflection or deserialization. Customer has no field referring to Invoice.


Java
public class Invoice {
    private final Customer customer;
    private LineItem[] items;

    public Invoice(Customer customer) {
        if (customer == null) {
            throw new IllegalArgumentException("customer required");
        }
        this.customer = customer;
        this.items = new LineItem[0];
    }
}


What multiplicity should the recovered class diagram show at the Customer end of the association between Invoice and Customer?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Reverse Engineering Questions: