Saturday, January 16, 2010

Delphi Development Environment

Delphi, an extension of pascal has proved to be a great object oriented language used for building powerful GUI. Dragging and droping the components automatically adds the appropriate code to the program which makes programming more simple and efficient. The quickest way to select a group of components is to drag a bounding rectangle around them.

Visual Objects can be manipulated at design time. Only visual componens can be seen at design time.The objects placed by designer on the windows form are called components, .dpr (project file), .pas and .dfm file types are needed to build an application in Delphi.

When one component owns another, the memory for the owned component is freed, when its owner's memory is freed. When a form is destroyed, all the components on a form are destroyed.

Delphi vocabulary consists of following terms:

1. Frame Object: It is designed as kind of a template for a part of a form.All windows of a delphi application are based on TForm object.

2. TMenu: To build the menu structure.

3. Pop up Menu: Windows that appear on right clicking

4. Labels: To label items on a form.

5. Edit Boxes: For entering editable user information.

6. Memo Boxes: For displaying single string as multi line wrapped text display.

7. Buttons: For providing user mechanism to choose 1 of the given options. if a button is disabled, its text is grayed out.

8. Check Boxes: For letting user enter a Yes/No choice.

9. List Boxes: To provide selectable names.

10. Scroll Bar: For providing horizontal/vertical scrolling option. If autoscroll is true, the scroll bar appears automatically when necessary.

11. Radio Group Panels: For providing user multiple choice options.Components such as group box, panel and page control can contain other components.

12. Code Reuse: Associating an event with an existing event handler in Delphi is used in purpose of code reuse.

13. Container: The idea of a conainer is that all the components will behave as one at the design time, the child components move with the parent inside a container.

14. DLL: Dynamic linked library called from executable programs leading to effective code reuse.

15. Object Inspector: Located on the left side of the screen for modifying component's properties and events.

16. Event Handler: A section of code invoked in an application in response to an event.
17. Set: A collection of values of one type, e.g. a set of font types.
18: Dynamic Allocation: Memory required for an object is allocated from the heap; heap refers to computer's virtual memory.
19. Self: A pointer to the instance of the class in memory. This pointer should be never modified.

Delhi 5,6,7 editions also provide spell check for 18 languages using 26 dictionaries.

Well, need not say Delphi development interface looks quite different and enriching for OOPS enthusiasts!

Links For Reference:


1. In Delphi, every project has atleast how many windows?
2. How can a button and menu item be handled to do the same task?

3. Ignoring the OOPS front, Delhi city is located in which country?

4. Is Delphi case sensitive; what about the case senstivity of its ancestor Pascal?

5. What is the easiest way to place multiple components of the same type on a form?

6. Can three components share the same event handler, what about 10?

7. Can the name and width property of a component be changed at run time? Will it be a good idea to do so?

8. What is a cursor's hot spot?
9. By default class in Delphi is public or private?


Sandy said...

Hey, isn't Delphi an obsolete language? I haven't seen any applications written in Delphi coming in for a while. Is it used in the telecom domain? Even Pascal has taken a beating with Python, Perl, Erlang, and more recently Lua and Go! I might be wrong here for I do not have much knowledge about these technologies. But for sure, whatever memoirs I have of the platform, its great!

Anyways, nice post which reminds me of my early struggle choosing a platform to learn when minds were over burdened with choice.

Sandy said...

When one component owns another, the memory for the owned component is freed, when its owner's memory is freed.

It may not always be the case. An object may not be reclaimed when its parent is reclaimed, if the same object is being referenced from another component. It may be mostly true for UI components, but again, it does not always hold good. This is where object graphs come into picture. Detection of orphans get tricky with orphan-islands. Garbage collection is not very robust in Delphi, as compared to other prevalent runtime's when it comes to detection of orphan islands. The following articles describes an easier technique on the same As given in the article, when using try..finally it is up to the user to handle all of it, with care.

Piyush said...

I also used delphi a couple of times maybe around 7-8 years back. Mostly for writing some simple applications just for fun of it. I remember I made a multiple choice questionarier app once. I used to like it very much, especially the ease with which you can make GUIs. It was called RAD (rapid app development) or something. Never really learnt Delphi very thoroughly and now I probably have forgotten most of the syntax. Could not answer any of the questions. Except one, which is about more about history/geography :-). Delphi (oracle of delphi) was in greece. It was the centre of old Greek religion . Especially famous were the preistesses who would go in trance and answer questions about future (and past) submitted by people. Some kind of Greek shamans. Greeks always fascinate me...