Fog Creek Software
Discussion Board

Naming an interface, any ideas?

The answers to Sathyaish's question on naming were pretty good so I thought I'd ask one of my own. (apologies if it's covered in Patterns book somewhere)

We have a classic parent child relationship of an Order and it's Items. I'd like to have a base Interface/Class that represents the four (related) sets of Order/Items we have

Sale Order
Sales Invoice
Purchase Order
Purchase Invoice

Last time I did this I called the base interface IOrder with the children implementing IOrderItem.
I'm just wondering does anyone have a better name? I just think it stinks that I end up with documentation thats things like "The purchase invoice class implements IOrder,IPurchaseInvoice"

Peter Ibbotson
Thursday, August 5, 2004

If you have a collection of IOrderItem then I'd be persuaded to have a collection called IOrderItems of IOrderItem.

Then I guess it gets long winded.

ISalesOrders -> ISalesOrder -> ISalesOrderItems -> ISalesOrderItem

IPurchaseOrders -> IPurchaseOrder -> IPurchaseOrderItems -> IPurchaseOrderItem

I wish I'd used the editor to write this now.

Simon Lucy
Thursday, August 5, 2004

Not quite what I meant Simon, it's a name for the common interface between all four. Lots of the code can be reused across all four types, my problem is because an order and an invoice are for the most part very similar (they both have accounts and a list of items consisting of products and quanitities) but they are two different objects. I just object to having to write that my SalesInvoice class implements the IOrder interface and I'm looking for a more neutral word. (and Parent/Child isn't really specific enough)
For the customer/supplier split I end up with an IAccount interface which works well I'm just looking for a similar name for the Order/Invoice split.

Peter Ibbotson
Thursday, August 5, 2004

Umm, Transaction?

Thursday, August 5, 2004


Ewan's Dad
Thursday, August 5, 2004

Sorry transaction has already been taken.

Peter Ibbotson
Thursday, August 5, 2004

Ahhh gotcha


Simon Lucy
Thursday, August 5, 2004

Not bad Simon, it's a lot closer but it still could mean almost anything, on the other hand at least it doesn't tie us down too badly and I could probably reuse that name in a couple of other circumstances.

Peter Ibbotson
Friday, August 6, 2004


Chuck Boyer
Wednesday, August 11, 2004

*  Recent Topics

*  Fog Creek Home