Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 1
    Craig, I wasn't aware of the Single Responsability Principle, and just read about it. The first thing that came to my mind was, what's the scope of a Responsability? for a PO I would say is managing its state, and that's the reason for the issuePO, approvePO and cancelPO methods, but also includes interacting with the PurchaseOrderItem class which handles the PO item's state. So I'm not clear if this approach is consistent with the SRP. what would you say? Commented Oct 24, 2010 at 6:07
  • 1
    +1 for a very nice and succinct answer. Realistically, there cannot be a definitive measure for how large a class should be. Applying the SRP ensures that the class is only as large as it needs to be. Commented Feb 16, 2012 at 13:45
  • 2
    @MiguelVeloso - Approving a PO probably has different logic and rules associate with it than issuing a PO. If so, it makes sense to separate the responsibilities into a POApprover and a POIssuer. The idea is that if the rules change for one, why would you want to mess with the class that contains the other. Commented May 10, 2012 at 5:10