I am writing a Java program using the MVC design pattern.
I have classes
Supplier. In the database they are connected through a
I'm writing a method which will give me all suppliers for a specific item (using itemID):
public ArrayList<Supplier> getItemSuppliers(int itemID)
I have a DB layer as well and I have
DBSupplier. Where should this method go? I will use it only (mostly) on my
ItemUI so I am thinking of
DBItem as the correct place.
Usually when we have the SalesLineItem pattern (Sales * - 1 SalesLineItem 1 - * Item) we have a separate class, but in that case, do I need such as my only interaction with that table (
item_supplier) will be with this printing (and one updating) method?
Basically, do I need to do a
ItemSupplier model layer class and respectively
DBItemSupplier or can I just have those two methods
updateItemSuppliers on either
DBSupplier (and if the latter, where?)