I am writing a Web Service to retrieve Invoice information from a database table. The specifics are as follows:
I intend to give InvoiceAgentId
as input and retrieve PayerId
,PayerName
, EffDate
and InvoiceAgentId
.
Now,
1. In the InvoiceInfoSearch.asmx.cs
file I have the WebMethod
... GetInvoiceInfo
2. I have the DTO objects InvoiceInfoRequest
and InvoiceInfoResponse
3. I have the BusinessLayer manager class InvoiceSearchmanager
4. I have the DAL InvoiceInfoDAL
The web method in point #1 instantiates the InvoiceSearchManager
class and calls the GetInvoiceInfo
method in the manager by passing the InvoiceInfoRequest
. Then the manager method instantiates InvoiceInfoDAL
and calls the GetInvoiceInfo
method in the DAL by passing the InvoiceInfoRequest
. In the DAL method the InvoiceInfoResponse
is instantiated and populated with retrieved record set and then propagated back to web method.
My questions:
1. Can both the InvoiceInfoRequest
and InvoiceInfoResponse
DTO classes have the exact same members? In my case PayerId
,PayerName
, EffDate
and InvoiceAgentId
.
2. Is this layering correct? Can it be bettered?