I have an object called
LineItem, which can be added to an object called
Quote can have 0 or more of
I have a service, which is a class, whose purpose is to add
LineItem to the
Quote. This class has a method called
addLineItemToQuote. The method
- Reads the current number of lines from the
Quoterepresentation on database
- writes the counter+1 to the
LineItem, which will be positioned last.
- writes quote_id into
LineItemobject to link it to the
INSERTcommand to the database with the
I am having a hard time naming this service class.
I want to name it
LineItemService but it does not deal strictly with the line item. It goes outside of the scope of the line item, since for example it counts the number of other line items on the quote.
I could call it
QuoteService, but I already have another
QuoteService that adds generic product line items (such as
LineItem) and also specialty line items such as line items for packaging that are not considered to be a product.
What are some guidelines I can use to name this service so that it most closely reflects its purpose?