Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Search the Tips
Tip Bank > Application Design > Design Patterns

Design Patterns - Page 4

61-79 of 79     Previous     Next
Use derivation instead of type-fields
by Danny Kalev
Whenever your class uses a type-field, as in the following ...
Use Mem-initializer to Initialize Embedded Objects
by Danny Kalev
If your class contains other object(s) as members, you should initialize the embedded object(s) in a mem-initializer list instead of assigning their values inside the class ...
Why you should avoid direct access to data members
by Danny Kalev
Sometimes it may be tempting to declare class data members as public. However, this is not recommended for the following ...
When is virtual inheritance needed?
by Danny Kalev
Multiple inheritance is a powerful and useful feature in C++, but it can lead to a problem known as the DDD or "Deadly Diamond of Derivation", as in this ...
Formatting Text
by DevX Pro
I am doing a word processing programs which perform a task called center justification on one paragraph user enters--similar with the center justification function performed by MS-Word. I have to use dynamic memory manipulation and pointers. Could you give me an idea about the design? Or, Could you tell me any reference book that talk about word processing?
Member or Global Function?
by DevX Pro
I have a function that takes 2 classes as arguments. Should I make the function global or inside the class? If that should be a member function, is there any rules to select which class should I place the function in?
Queues & Stacks
by DevX Pro
Though I've been programming in C/C++ for several years now, I've never understood how to build a queue or stack. I used to resort to some of the included libraries in Borland C++. But things have changed... I'm going to be moving over to a new O/S, and I want to build a template or class that for both queues and stacks so that I can both learn how they work as well as become overly dependant on the classes. :-) Any ideas would be greatly appreciated. Thank you, Raymond
Increase Code Reusability
by Randy Kahle
Instead of exposing fields of a Java class, such as in ...
Create a Single Instance of an Object
by Randy Kahle
There are situations when you need to insure that only a single ...
Inheritance design
by DevX Pro
Suppose I've got the following class hierarchies: Surface_Plot ContourSurface_Plot, child of Surface_Plot Surface_Data GridSurface_Data, child of Surface_Data Surface_Plot contains a Surface_Data object, ContourSurface_Plot contains a GridSurface_Data object. What is the most elegant way to arrange the data members of the Surface_Plot hierarchy so that the Surface_Plot class can access the GridSurface_Data object's Surface_Data behaviors, and ContourSurface_Plot can access its extended behaviors? My approach has been to make the xxxData objects pointers, and to have both a GridSurface_Data and Surface_Data pointer referencing the same data member. This route to a solution seems terribly ugly and error-prone. Furthermore, my real hierarchies are much longer, resulting in a plethora of redundant pointers of increasingly sophisticated types. There must be a cleaner way!
Screen resolution
by DevX Pro
I am developing an application in Delphi 2.0 on a 1024x768 resolution (large fonts), and have been trying to get it to act properly in 800x600 mode with little success. Borland has a short informational TI that describes how to get around this, but it does not resize the form properly. Any suggestions?
How to draw a picture with more pixel than screen
by DevX Pro
I want to draw a picture with bigger coordinates (x,y) than the screen can contain. For example, my screen's resolution is 600x800, but I will draw a filled ellipse on (20000,3000). Then how can I draw it at the location I want?
Extending TCustomControl Painting
by DevX Pro
I have two questions: Question 1: How can I extend the painting functionality of a TWinControl like the TGraphicControl's Paint method? Question 2: I cannot find the Paint method in TWinControl to override. Specifically, I want to extend the TDBEdit class. The TDBEdit class implements the WMPaint method that is private.
Flat Combo
by DevX Pro
Do you know how to create a flat, non-3D combo box with only a thin black border? Setting CTL3D to False doesn't seem to have an effect on the combo.
Help Files
by DevX Pro
I would like to begin by saying your site is great. I have used Ask the VB Pro in the past, so I hope you can help with this one. I have just started with Delphi 1.0 and I am having a problem compiling help files. I am using HC31 to complie, but I get a Not Enough Memory message each time I try to compile a (small) help file. I have tried on a PC with 8MB of RAM and one with 16MB, both with the same result. Any help would be appreciated.
How to Use the CreateToolbarEx Function
by DevX Pro
How do you use the CreateToolbarEx function? I want to use it to create dockable tool bars.
Resizing Resolution
by DevX Pro
How do I re-size the buttons, etc. on my forms when the resolution changes? If I create something in Delphi at a high resolution and run it on a computer with a low resolution, the controls or components are oversized. Please help.
Can I Build 'Query By Form' Applications Using Delphi?
by DevX Pro
I used Oracle Forms for a long time to build Query By Form applications. I have recently switched to Delphi, and am wondering if it's possible to build Query By Form applications in it.
Getting at a TRadioGroup's Individual Buttons
by DevX Pro
Is there a way to manipulate the appearance of the individual buttons in a TRadioGroup?
61-79 of 79     Previous     Next
Thanks for your registration, follow us on our social networks to keep up-to-date