Advanced OOP and Inheritance.
Tom Eberhard.
NET361.
These session notes serve primarily to share the content of the session and as a reference for me. They may also provide some value to those interested in the session topics. Some of the information found in these notes may be inaccurate due to my typing errors or a lack of understanding of the subject matter. DevTeach policy is that session material is available online to registered attendees only, so I cannot respond to any requests for session PPTs or source.
OOP
Scalability also means being able to wrap something (as in a web service)
Provide a foundation for our future applications.
Many 2-tier apps still being built. Still stuffing the logic and db code in the UI layer. With sprocs, business logic can be pushed to the database. Maintenance and scalability more difficult.
3-tier apps. Logical separation. Not physical separation. Must logically separate to support physical separation.
In first sample, the business layer includes the database connection/logic. Not good.
N-tier. UI --> facade layer-->main business layer-->data access layer.
UI differs little. Calling a different class.
BaseForm inheritance. Tom has one level of inheritence from the MS form with no functionality whatsoever to handle future release changes, to serve as a buffer.
When controls are encapsulated, each lives in its own box. The properties have support of the functionality of the entire control.
Reference form on aspx page (in aspx) protected AddressForm as HTMLForm to access the form properties.
HomeAddress1 =LoadConttrol("address.ascx", Address).
Give it an ID for reference from the postback.
Handling an event from the control to the page. Event bubbling. Add events to the base control. Private sub txtZip_TextChanged calls ContentChanged() event.
In web page add Protected WithEvents AddressEvents control.
Must check out samples!...
Summary: Tom is always a 10. I’ve been looking for a good description of event bubbling up from the control. I promise myself to dig into his code. 10 out of 10.