4

Is it bad practice to name classes after the façade pattern?

public class OrderFacade {}
public class InvoiceFacade {}
public class ThingFacade {} ...

These classes do follow the Façade pattern.

  • Are these classes implementing the facade pattern? – Ixrec Apr 26 '16 at 18:34
  • In some contexts it can make sense, in others not. Who knows your context if not you? – Doc Brown Apr 26 '16 at 18:46
  • @Ixrec good question. Yes. – Price Jones Apr 26 '16 at 19:04
12

I would name them based on what the facade does for consumers, or what it needs to "look like" to the outside world. The fact that it is a facade is an implementation-detail.

So instead of, say, BillingSystemFacade, I'd present it as a BillingService. Heck, perhaps someday I can get rid of whatever clunky API is behind it, and rewrite it from scratch, but the consumers don't need to know whether it is/isn't a facade, only what it promises to do for them.

  • 1
    Agree. Your consumers don't care whether it's a facade or not. – Robert Harvey Apr 26 '16 at 18:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.