Embedded Systems Design - August 2008 - (Page 11) BY Jack W. Crenshaw programmer’s toolbox Reusing code and inverting matrices T braries” for my software were two his month, as promised, I’m sections of my desk drawer; one continuing to flesh out the containing the source code (on C++ matrix class. But first, I IBM punched cards) for reusable want to talk about the value of functions, the other, object decks. reusable code and how it’s supportReusing those functions was as ed by the Microsoft compiler called easy as lifting the object decks out Visual C++ Express. Regular readof the drawer. The incentive to not ers may remember how highly I recode was strong. praised this compiler, because of its I should also note in passing ease of use and all its neat features. that none of the software Since then, I’ve had a few probmethodologies, from top-down lems. This is by no means to sugdesign to the latest UML-based gest that I’m reverting back to my methods, are very effective in former, anti-Microsoft stance. Aldefining candidates for reuse. though I’ve been doing C++ for a The reason is simple: you don’t long time, I’m a total newbie to What is reusable code? Is it a get those candidates from any this compiler and perfectly willing to accept that my problems are retemplate to base projects on single project-development efsults of pilot error. However, havor single piece of code used fort. What you get from such an effort is the specifications for ing loaded up with books on the in multiple programs? software needed for that particuorder of Microsoft Visual C++ for lar project. As a ridiculous examDummies and having contacted Microsoft seems confused. ple, you might find several places folks in the developers’ communiin a given project that a vector ty and Internet forums, without addition is needed, but none with vector subtraction. A much success, I’m still having the problems. In the future, I strict application of formal methods would never lead to hope to establish a dialog with folks at Microsoft who can a vector subtraction function. set me straight. In the meantime, I’d like to share my expeBy definition, reusable software is software that’s riences with you. See what you think. used on multiple projects. You identify candidates for One of the big selling points of object-oriented design reuse by asking “will I ever need to use this function and development has always been that it encourages softagain?” In the end, the answer comes much more from ware reuse. If we design our C++ classes carefully, we the experience and foresight of the human designer than should be able to generate software packages that can be from any formal method. used again and again, in new projects, without modificaSo how does this discussion of software reuse relate to tions. I stress that last phrase, because you’re not really reusing software if you have to modify it for the next appli- Visual C++ Express? When I was developing the software for the vector class, I created a project that included the files cation. My incentive to develop classes for vector and matrix operations comes directly from this notion of reuse. Vectors and SimpleVec (cpp and h). These files grew and I can’t resist reporting that I had my own version of evolved as the project went forward. At first, all these files software reuse, going on in the 1960s and 1970s. The “liwere in the main project directory, but eventually I created a library folder for them, which is intended to become the modernized version of my desk drawer. Jack Crenshaw is a systems engineer and When I started the development of the matrix class, I the author of Math Toolkit for Real-Time Programming. He holds a PhD in physics created a new project, which included the same files (you from Auburn University. E-mail him at can see where this is going, right?). As this project evolved, I jcrens@earthlink.net. www.embedded.com | embedded systems design | AUGUST 2008 11 http://www.embedded.com
Table of Contents Feed for the Digital Edition of Embedded Systems Design - August 2008 Embedded Systems Design - August 2008 Contents Number Include Parity Bit Programmer's Toolbox Cover Feature: Virtualization for Embedded X86 Multiprocessor Applications Wanted: Industry Standards for Benchmarking Embedded VMM Hypervisors Achieving Cache Coherence in a MIPS32 Multicore Design Memory Allocation in C Advertising Index Break Points Marketplace Embedded Systems Design - August 2008 Embedded Systems Design - August 2008 - Embedded Systems Design - August 2008 (Page Cover1) Embedded Systems Design - August 2008 - Embedded Systems Design - August 2008 (Page Cover2) Embedded Systems Design - August 2008 - Embedded Systems Design - August 2008 (Page 1) Embedded Systems Design - August 2008 - Embedded Systems Design - August 2008 (Page 2) Embedded Systems Design - August 2008 - Contents (Page 3) Embedded Systems Design - August 2008 - Contents (Page 4) Embedded Systems Design - August 2008 - Number Include (Page 5) Embedded Systems Design - August 2008 - Number Include (Page 6) Embedded Systems Design - August 2008 - Number Include (Page 7) Embedded Systems Design - August 2008 - Number Include (Page 8) Embedded Systems Design - August 2008 - Parity Bit (Page 9) Embedded Systems Design - August 2008 - Parity Bit (Page 10) Embedded Systems Design - August 2008 - Programmer's Toolbox (Page 11) Embedded Systems Design - August 2008 - Programmer's Toolbox (Page 12) Embedded Systems Design - August 2008 - Programmer's Toolbox (Page 13) Embedded Systems Design - August 2008 - Programmer's Toolbox (Page 14) Embedded Systems Design - August 2008 - Programmer's Toolbox (Page 15) Embedded Systems Design - August 2008 - Cover Feature: Virtualization for Embedded X86 Multiprocessor Applications (Page 16) Embedded Systems Design - August 2008 - Cover Feature: Virtualization for Embedded X86 Multiprocessor Applications (Page 17) Embedded Systems Design - August 2008 - Cover Feature: Virtualization for Embedded X86 Multiprocessor Applications (Page 18) Embedded Systems Design - August 2008 - Cover Feature: Virtualization for Embedded X86 Multiprocessor Applications (Page 19) Embedded Systems Design - August 2008 - Cover Feature: Virtualization for Embedded X86 Multiprocessor Applications (Page 20) Embedded Systems Design - August 2008 - Cover Feature: Virtualization for Embedded X86 Multiprocessor Applications (Page 21) Embedded Systems Design - August 2008 - Cover Feature: Virtualization for Embedded X86 Multiprocessor Applications (Page 22) Embedded Systems Design - August 2008 - Cover Feature: Virtualization for Embedded X86 Multiprocessor Applications (Page 23) Embedded Systems Design - August 2008 - Cover Feature: Virtualization for Embedded X86 Multiprocessor Applications (Page 24) Embedded Systems Design - August 2008 - Cover Feature: Virtualization for Embedded X86 Multiprocessor Applications (Page 25) Embedded Systems Design - August 2008 - Cover Feature: Virtualization for Embedded X86 Multiprocessor Applications (Page 26) Embedded Systems Design - August 2008 - Wanted: Industry Standards for Benchmarking Embedded VMM Hypervisors (Page 27) Embedded Systems Design - August 2008 - Wanted: Industry Standards for Benchmarking Embedded VMM Hypervisors (Page 28) Embedded Systems Design - August 2008 - Wanted: Industry Standards for Benchmarking Embedded VMM Hypervisors (Page 29) Embedded Systems Design - August 2008 - Achieving Cache Coherence in a MIPS32 Multicore Design (Page 30) Embedded Systems Design - August 2008 - Achieving Cache Coherence in a MIPS32 Multicore Design (Page 31) Embedded Systems Design - August 2008 - Achieving Cache Coherence in a MIPS32 Multicore Design (Page 32) Embedded Systems Design - August 2008 - Achieving Cache Coherence in a MIPS32 Multicore Design (Page 33) Embedded Systems Design - August 2008 - Achieving Cache Coherence in a MIPS32 Multicore Design (Page 34) Embedded Systems Design - August 2008 - Memory Allocation in C (Page 35) Embedded Systems Design - August 2008 - Memory Allocation in C (Page 36) Embedded Systems Design - August 2008 - Memory Allocation in C (Page 37) Embedded Systems Design - August 2008 - Memory Allocation in C (Page 38) Embedded Systems Design - August 2008 - Memory Allocation in C (Page 39) Embedded Systems Design - August 2008 - Memory Allocation in C (Page 40) Embedded Systems Design - August 2008 - Memory Allocation in C (Page 41) Embedded Systems Design - August 2008 - Memory Allocation in C (Page 42) Embedded Systems Design - August 2008 - Advertising Index (Page 43) Embedded Systems Design - August 2008 - Advertising Index (Page 44) Embedded Systems Design - August 2008 - Break Points (Page 45) Embedded Systems Design - August 2008 - Break Points (Page 46) Embedded Systems Design - August 2008 - Marketplace (Page 47) Embedded Systems Design - August 2008 - Marketplace (Page 48) Embedded Systems Design - August 2008 - Marketplace (Page Cover3) Embedded Systems Design - August 2008 - Marketplace (Page Cover4)
For optimal viewing of this digital publication, please enable JavaScript and then refresh the page. If you would like to try to load the digital publication without using Flash Player detection, please click here.