Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Refactoring
Message
De
09/10/2009 15:49:34
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Divers
Thread ID:
01428495
Message ID:
01428557
Vues:
43
There isn't any real code in the ABusiness object that would be duplicated. I would simply copy that class and paste it into a new class. That way both the ABusinessObject and RegBusinessObject class would both be subclassed from the mm stuff and be identical. Then add what you want your reg classes to have in common to the RegBusinessObject class.

Then just change your reg classes to be subclassed from RegBusinessObject instead of ABusinessObject. Keeps it simple this way.
Tim

>Hmm...didn't quite work. I did
>
> abstract class Reg : ABusinessObject<ABusinessEntity>
>    {
>        
>    }
>
>
>but my actual class definition doesn't compile now.
>
>public partial class Reg_Golf : Reg
>	{
>		
>		#region Association Properties
>
>		/// <summary>
>		/// Business Entity object
>		/// </summary>
>-------->	public override Reg_GolfEntity Entity
>
>
>The error on the highlighted line there is
>Error	3	'Wala.Membership.Business.Reg_Golf.Entity': type must be 'Wala.Membership.Business.ABusinessEntity' to match overridden member 'OakLeaf.MM.Main.Business.mmBusinessObjectGeneric<Wala.Membership.Business.ABusinessEntity>.Entity'	
>
>
>I try various ways to define the class, such as
public partial class Reg_Golf : Reg<Reg_GolfEntity>
and
public partial class Reg_Golf : Reg<ABusinessEntity>
but nothing makes it happy.
>
>
>
>>That sounds good. So I tried:
>>
>>namespace Wala.Membership.Business
>>{
>>    
>>    public partial class Reg : ABusinessObject<ABusinessEntity>
>>    {
>>
>>    }
>>
>>      
>>}
>>
>>
>>and then changing
>>
>>namespace Wala.Membership.Business
>>{
>>	public partial class Reg_Seminar : Reg
>>	...
>>
>>
>>I see that I had to explicitly cast some types down below. Should that do it?
>>
>>Thanks so much!
>>
>>Eric
>>
>>>>
>>>
>>>You currently have ABusinessObject as your base class for these. You could put the functionality in the AbusinessObject class or you could create another ABusinessObjectReg (or whatever name) class that is identical to ABusinessObject and then extend it. Then just change the three classes to inherit that one instead of the ABusinessObject class.
>>>Tim
Timothy Bryan
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform