EETimes

Embedded Systems October 2000 Vol13_11

Issue link: http://dc.ee.ubm-us.com/i/71842

Contents of this Issue

Navigation

Page 134 of 181

Object-Oriented Meets Web Development by Adam Kolawa We continue our discussion by taking a look at object-oriented techniques. In light of the current trend towards Web development, it is only natural that developers will try to compare object-oriented development to the Web paradigm. But a closer examination reveals that with a few mental adjustments, object-oriented developers can use both approaches in tandem for their various projects. The main mental adjustment that object-oriented developers must make is to understand how state is recorded. Web pages do not have memory, so each interaction with a Web page has to be handled independently without regard for what events occurred in the past. Even dynamic pages cannot keep track of state; each time you travel from one page to the next, you can only carry the state by using state variables. Storing information in state variables breaks the object-oriented paradigm. A fundamental principle of object-oriented programming is that al l necessary information is encapsulated inside the objects. Objects have to carry state information from one page to another page. But in Web development, state dies each time a user leaves a particular page, and each page is a new instance. Developers who are trained in object-oriented programming often enter Web development with the false assumption that if they have the variables stored in their objects, the variables will be ready to apply to the new page. Ironically, these developers can gain a better understanding of Web development if they just think back to the old rules of FORTRAN programming, in which external variables carried information between functions and subroutines. The functions and subroutines executed tasks on their own, out of the developer's sight. Dynamic Web development most certain ly breaks the object-oriented paradigm, and it keeps object- oriented developers on their toes. Object-oriented developers can take Web development as a new challenge to their mental versatility, and can use its best paints to enhance their applications. Dne example of how the two techniques can complement each other is Java Server Pages (JSP) technology, which encapsulates business logic in JavaBeans but allows developers to build HTML pages to control the display of the application. Adam Kolawa, Ph.D., is Chairman and CEO of ParaSoft. You can reach him at ak@parasoft.com ParaSofr mI C 2000 ParaSol! Corporation, Monrovia, CA, USA. ParaSoft is a registered trademark. CodeWizard is a registered trademark of ParaSoft. codewizard® ParaSoff ' CodeWizard® prevents C/C++ errors and slashes your debugging time 'CodeWizard is awesome. I am recommending our management to purchase at least 5 copies .. .. ParaSolt has a lot to offer to the world 01 C++ development.' -Piyush Shaw, Arrowsmith Technotogies, tnc. CodeWizard~ is a tool that helps you prevent errors by automatically performing static analysis on C/C++ code. The first thing you'll notice about CodeWizard is that it cuts down on the thing you hate the most: debugging. Preventing errors with CodeWizard is pain less and saves you time in the long run . cl icks, you can tell CodeWizard to enforce only the standards that are most important to you at a particular stage of your project. Using the RuleWizard feature, you can point and click to build your own sophisticated coding standards. RuleWizard guides you through the coding standard building process and lets you know when your coding standard is ready for enforcement by CodeWizard. ,.-' • .. ' v .... .... " .. '. ... ........ , r-'" 0111 "'_111 You won't have any problem adding CodeWizard to your arsenal of development tools, because it installs directly into Windows and UNIX development environments. In Microsoft Developer Studio, you'll begin testing with a single cl ick of the CodeWizard icon. On UNIX platforms, CodeWizard is a wrapper around the compi ler. Learn a few simple commands, and you'll be on your way to cleaner code. :.' :.~:~I_I_t.t Il _' ' • • 0.,., r ...... . I.:_~~_~.::::::::::::::~,."~~~~~'f www.parasoft.com/besCoct.htm.orcall(888)305- 0041 for more information. download CodeWizard today Code Wizard enlorces over 120 sophisticated CIC+ coding standards. CodeWizard automatical ly enforces a sophisticated set of C/C++ coding standards. These language-specific rules are designed by industry experts such as Scott Meyers to help you avoid dangerous coding constructs. CodeWizard parses your code, clearly displays violations of the coding standards, and gives you all the information you need to make repairs, including suggestions on better coding constructs. Follow CodeWizard's coding suggestions, and you'll immediately begin to write cleaner, more reliable code. The key to CodeWizard is that you can customize the program to fit your development schedule. With a few If you would like to prevent errors with a customizable tool that conforms to your development cycle, at

Articles in this issue

Archives of this issue

view archives of EETimes - Embedded Systems October 2000 Vol13_11