Download presentation
Presentation is loading. Please wait.
1
Business Object Payne Ch. 15 MIS 424 MIS 424 Professor Sandvig Professor Sandvig
2
Overview What are business objects Benefits How to Create How to use 2 examples 2 examples Usage Tips
3
What are Business Objects Extensions of.NET class library Create new classes Properties Properties Methods Methods Events Events Web site Presentation User Controls Presentation User Controls Code/logic Business Objects Code/logic Business Objects
4
Benefits of Business Objects Key element of OOP Encapsulation Encapsulation Reusability Reusability N-tier application development Compiled Protect proprietary code (sort of) Protect proprietary code (sort of) Mix & match languages.aspx pages, different components.aspx pages, different components
5
How to Create Steps: 1.Create new class file.vb (or.cs) extension.vb (or.cs) extension App_code directory App_code directory Contains class functionality Contains class functionality 2.Call new class from.aspx file 3.Test in VS 2005 4.Upload.vb and.aspx files to server
6
1. Creating Class file 1.Create file with.vb extension in folder App_Code 2.Import need libraries Not part of.aspx page 3.Define Namespace 4.Define class 5.Write code for the class Example: SimpleQuote.vb SimpleQuote.vb
7
2. Call from.aspx page Import Namespace New class is part of Application’s class library New class is part of Application’s class library Just like other classes in.NET library Just like other classes in.NET library Instantiate class Example: SimpleQuote.aspx code, output SimpleQuote.aspx code, outputcodeoutputcodeoutput
8
Example 2: Calculator Pass in properties Declare as public variables Declare as public variablesExample: SimpleCalculator.vb code SimpleCalculator.vb codecode SimpleCalculator.aspx code, output SimpleCalculator.aspx code, outputcodeoutputcodeoutput
9
Usage Tips When to Use Business Objects Subjective Subjective Opinion 1: all business logic Business Layer Business Layer Opinion 2: Only reusable code
10
Usage Tips Debugging No response.write in BOs No response.write in BOs Write & debug code with: VS 2005 or VS 2005 or Visual Web Developer or Visual Web Developer or Dreamweaver Dreamweaver Bugs in ANY BO can disable entire application.
11
Summary Goal of Business objects Encapsulation Encapsulation Reusability Reusability When to use Large programs Large programsModularity Code used > 1 Code used > 1 Web Services Web Services
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.