G
Guest
Hello All:
I work at an insurance company and we are changing the design of an ASP.NET
application (for those have followed my postings, we're going to redesign
some parts of the application - thank you Kevin and Bruce!). The application
processes claims. We have two types of claims, PClaim and WClaim (property
claims and worker's comp claims). PClaim and WClaim share some common traits
so I can have them inherit from an abstract Claim class and not have to worry
about implementing these in the PClaim and WClaim classes.
PClaim and WClaim also have some differing traits. So I can define in each
of their classes the properties and methods that are particular to each type
of claim. So far, so good.
Implementing this, I find:
Dim myClaim As New PClaim
myClaim.whatever() //shows properties and methods for Claim and
PClaim
Dim myClaim As New Claim
myClaim.whatever() //shows properties and methods for Claim only
But when I do this, I don't see any of the properties or methods defined in
PClaim or WClaim.
Can someone help me to understand why this is and how I could restructure
this to get what I want.
I would like to design this so that a PClaim or a WClaim can be generically
treated as a Claim and have the claim carry it's claim type (i.e.
myClaim.ClaimType = ClaimType.Property or myClaim.ClaimType =
ClaimType.WorkersComp) so that the business layer can retrieve the claim's
data from the appropriate source (i.e. the business layer class irequests
the claim type from the claim and, depending on the type of claim, retrieves
the claim's info from either a third-party system or a home-grown database).
This way I can avoid having to maintain two seperate calls in the busines
layer to retrieve claim data. In other words I would like to code this:
Function RetrieveClaimInfo(c as Claim) as Claim
'code checks claim type and retrieves data from appropriate source
'then retrurns Claim with either the appropriate PClaim properties and
methods
'or Claim with either the appropriate WClaim properties and methods
End Function
as opposed to this:
Function RetrievePropertyClaimInfo(c as PClaim) as PClaim
'code retrieves data from appropriate source and returns a PClaim
End Function
Function RetrieveWorkersCompClaimInfo(c as WClaim) as WClaim
'code retrieves data from appropriate source and returns a WClaim
End Function
I would also like to avoid having several places in the UI project where I
would have to code:
If (PropertyClaim) Then
Dim myClaim As New PClaim
Else
Dim myClaim As New WClaim
End If
I would appreciate any help with this.
TiA,
I work at an insurance company and we are changing the design of an ASP.NET
application (for those have followed my postings, we're going to redesign
some parts of the application - thank you Kevin and Bruce!). The application
processes claims. We have two types of claims, PClaim and WClaim (property
claims and worker's comp claims). PClaim and WClaim share some common traits
so I can have them inherit from an abstract Claim class and not have to worry
about implementing these in the PClaim and WClaim classes.
PClaim and WClaim also have some differing traits. So I can define in each
of their classes the properties and methods that are particular to each type
of claim. So far, so good.
Implementing this, I find:
Dim myClaim As New PClaim
myClaim.whatever() //shows properties and methods for Claim and
PClaim
Dim myClaim As New Claim
myClaim.whatever() //shows properties and methods for Claim only
But when I do this, I don't see any of the properties or methods defined in
PClaim or WClaim.
Can someone help me to understand why this is and how I could restructure
this to get what I want.
I would like to design this so that a PClaim or a WClaim can be generically
treated as a Claim and have the claim carry it's claim type (i.e.
myClaim.ClaimType = ClaimType.Property or myClaim.ClaimType =
ClaimType.WorkersComp) so that the business layer can retrieve the claim's
data from the appropriate source (i.e. the business layer class irequests
the claim type from the claim and, depending on the type of claim, retrieves
the claim's info from either a third-party system or a home-grown database).
This way I can avoid having to maintain two seperate calls in the busines
layer to retrieve claim data. In other words I would like to code this:
Function RetrieveClaimInfo(c as Claim) as Claim
'code checks claim type and retrieves data from appropriate source
'then retrurns Claim with either the appropriate PClaim properties and
methods
'or Claim with either the appropriate WClaim properties and methods
End Function
as opposed to this:
Function RetrievePropertyClaimInfo(c as PClaim) as PClaim
'code retrieves data from appropriate source and returns a PClaim
End Function
Function RetrieveWorkersCompClaimInfo(c as WClaim) as WClaim
'code retrieves data from appropriate source and returns a WClaim
End Function
I would also like to avoid having several places in the UI project where I
would have to code:
If (PropertyClaim) Then
Dim myClaim As New PClaim
Else
Dim myClaim As New WClaim
End If
I would appreciate any help with this.
TiA,