EventHelix.com: CASE Tools; Real-time and Embedded System Design; Object Oriented Design
  Home  |  EventStudio System Designer 5  |  VisualEther Protocol Analyzer 1.0  Real-time Mantra  Contact Us

EventHelix Update August 2002

 

Recent updates to EventHelix.com

(Please feel free to forward this e-mail to your friends)

Optimizing C and C++ Code update

Embedded software often runs on processors with limited computation power, thus optimizing the code becomes a necessity. In this article we will explore the following optimization techniques for C and C++ code developed for Real-time and Embedded Systems. 

  1. Adjust structure sizes to power of two
  2. Place case labels in narrow range
  3. Place frequent case labels first
  4. Break big switch statements into nested switches
  5. Minimize local variables
  6. Declare local variables in the inner most scope
  7. Reduce the number of parameters
  8. Use references for parameter passing and return value for types bigger than 4 bytes
  9. Don't define a return value if not used
  10. Consider locality of reference for code and data
  11. Prefer int over char and short
  12. Define lightweight constructors
  13. Prefer initialization over assignment
  14. Use constructor initialization lists
  15. Do not declare "just in case" virtual functions
  16. In-line 1 to 3 line functions

AutoDrive: Regular Driving Use Case pdf new

AutoDrive is a completely automated highway driving system. By 2030 all major interstates in the US are expected to support "AutoDrive lanes" with completely automated car and commercial vehicle driving. Any car updated for AutoDrive can enter these lanes and enjoy speed limits of around 130 mph. This use case describes the operations that would be carried out when AutoDrive is steering the car.

Object Oriented Design Tips II update

We have already covered object oriented design tips in a previous article. Here we will look at more tips that will help you improve your object oriented design skills:

  1. Class with just get-set methods points to missed delegation
  2. Replace an array of structures with an array of objects
  3. Delegate work to helper class
  4. Multi-dimensional arrays point to incomplete class identification
  5. Multiple nested loops point to incomplete delegation
  6. Class with very large numbers of methods points to incomplete class identification
  7. Don't go overboard with inheritance
  8. Prefer delegation to inheritance 
  9. Don't scatter the abstraction
  10. Consider group of objects to split work amongst team members
  11. Use nested classes for lightweight helper classes
  12. Use templates to improve type safety and performance
  13. Divide your code into framework and application parts

Open Closed Principle new

The open closed principle of object oriented design states:

Software entities like classes, modules and functions should be open for extension but closed for modifications.

The Open Close Principle encourages software developers to design and write code in a fashion that adding new functionality would involve minimal changes to existing code. Most changes will be handled as new methods and new classes. Designs following this principle would result in resilient code which does not break on addition of new functionality.

In this article, we will explore the the open closed principle via an example of a resource allocator


 

Subscribe to EventHelix Update (a quarterly newsletter)
Powered by groups.yahoo.com
 
  Home  |  EventStudio System Designer 5  |  VisualEther Protocol Analyzer 1.0  Real-time Mantra  Contact Us
Copyright © 2000-2011 EventHelix.com Inc. All Rights Reserved.