1. Lets say I have this hypothetical database (the one I am dealing with is much bigger as you probably can imagine or guess):
Customers
---------
ID
Name
Address
ShippingAddress
OrderID
Orders
------
OrderID
Date
LineItems
---------
ItemID,OrderID
Quantity
Items
-----
ItemID
Description
I have many applications which need customer's ID, Name, and Address, Items' ID, Description. Is it better to create a library which can load the customer ID, Name, and Address and same for the Items by invoking a stored procedure or is it a better design to have a stored procedure which will get whatever I need for the specific application. For example, one application might need customer's id, name, and the number of orders and it might need what items we carry. However, another application might need all the columns of customer and Items. Because too many applications need customers' ID, Name and Adddress, should I create a static class class with static method which invokes a stored procedure and gets the information and if I need more information in other application I simply get those as per need basis, or should I just skip creating a static class library and get everything when I need them by invoking some stored procedure which returns all I need.
If I create a library, the advantage is I can use it in many applications and get the extra columns if I need to (but at least a few apps will not need the extra columns so simply calling the static methods will do the job). However, if I need other columns then I have to get those separately. If I do not create a library, I do not have the advantage of code reuse but I can get whatever fields I need and load them as need for the application all in one shot. I am wondering which solution is more advantageous over the other? Or, is there a better way?