Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Field level validation questions - separating tiers
Message
From
23/10/2007 13:33:12
 
 
To
23/10/2007 13:13:47
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01262778
Message ID:
01262862
Views:
10
No, of course I will have base classes for all of the controls used :o) I just didn't want to have multiple subclasses for every conceivable condition of the same control...




>Tracy,
>
>Paul has given you a good suggestion in your other post (under the MM category). I just wanted to comment on one thing that you said:
>
>>Other than subclassing controls and then dropping all of those subclasses on a form, what would be a good way to emulate that behavior in dotnet?
>
>I hope that you're not saying that you're not going to have base classes for all your UI controls ... that would be a big no-no. <g>
>
>~~Bonnie
>
>
>
>
>
>>In VFP, I validate in a custom method that is called from the validate or lostfocus of a control. The method could be called presave() and then perhaps a postsave() as well. In the presave() I would basically do what the business level should do. Other than subclassing controls and then dropping all of those subclasses on a form, what would be a good way to emulate that behavior in dotnet? Would an interface work or what about delagates? I'm trying to wrap my head around this and I may be thinking wrong to begin with.
>>
>>I have to save each field as I pass through the controls on the form. Form level saving is not an option in this case.
>>
>>The valid or lostfocus of the control now calls the presave() and if it passes, then the save is done (insert or update in sql server). In some cases, the business logic to determine whether or not the check passes and a save should be done, may need to be overridden. In addition to the actual saving (which I assume would be done via a call to the business object), where does the business logic go to do the check for the field validation? I think I've over confused myself in this whole process due to the validation at the field level...
>>
>>For example, if I want to process default behavior for 80% of the time in a control, but in 20% of the time I want to do something in addition to the default behavior or even not perform the default behavior, what then? Does it have to be done at the form control (UI) level using virtual and override, or can it be passed to the business level (hopefully a separate dll) somehow? What would go in the business level then? Would it be an interface? Or do I have a separate group of subclasses to maintain?
>>
>>And now to confuse the matter even more, what about a separate webform ui? I don't want to duplicate anything I don't have to and still be able to validate at the field level...
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform