home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 31 / CDASC_31_1996_juillet_aout.iso / vrac / del2faq.zip / TI2780.ZIP / TI2780.ASC
Text File  |  1996-02-28  |  33KB  |  804 lines

  1.    NUMBER  :  2780
  2.   PRODUCT  :  Delphi
  3.   VERSION  :  1.0
  4.        OS  :  Windows
  5.      DATE  :  February 28, 1996                       
  6.  
  7.     TITLE  :  Delphi vs Visual Basic
  8.  
  9. An Evaluation of
  10. Rapid Application Development Tools for Windows: 
  11. A Comparison Between 
  12. Delphi and Visual Basic
  13.  
  14. Table Of Contents
  15.  
  16. Introduction   
  17. Windows Visual Development    
  18. Performance
  19. Benchmarks     
  20. Benchmark Results   
  21. Rapid Application Development (RAD)     
  22. Controls  
  23. Control Icon Array  
  24. Templates and Experts    
  25. Object Placement    
  26. Property Lists 
  27. Code Window    
  28. Debugging And Object Inspecting    
  29. Component Reuse     
  30. Shared Event Functions   
  31. Reusable Functions and Libraries   
  32. Components     
  33. Programming Language     
  34. OOP Design Methodology   
  35. Database Scalability     
  36. Moving Up to Delphi 
  37. Conclusion     
  38.  
  39. Introduction
  40.  
  41. With the growing demands on Windows applications developers to
  42. create increasingly complex applications in less time, the
  43. evolution of Rapid Application Development (RAD) tools has become
  44. a crucial focus of the development community. First-generation
  45. RAD tools for Windows included application frameworks (such as
  46. OWL and MFC), DLL-based class libraries, and VBXs (Visual Basic
  47. custom controls). 
  48.  
  49. The release of Borland's Delphi heralds a new generation of RAD
  50. tools that combines the power of traditional 3GL compilers with
  51. the ease of use and development speed of a 4GL environment.  This
  52. white paper will contrast the approach of the new technology used
  53. by Delphi with that of Microsoft's Visual Basic. 
  54.  
  55. Windows Visual Development
  56.  
  57. The earliest methodology for Windows applications programming was
  58. to code directly using calls to the Windows API.  The API
  59. provided a crude mechanism for creating such items as menus and
  60. windows, leaving the developer with an enormous coding task even
  61. when creating a rudimentary application.  These early programs
  62. were typically created with C compilers that were equally crude
  63. by today's standards.   As a result, the expectations for what
  64. could reasonably be achieved by professional developers was
  65. severely limited by schedule and performance constraints.  Early
  66. applications were also, for the most part, independent. In other
  67. words, they were generally not reliant on each other and did not
  68. share data or invoke other applications.  
  69.  
  70. Appreciating the underlying potential of the Windows environment,
  71. the development community demanded better tools, to enhance their
  72. productivity and facilitate the creation of more sophisticated
  73. applications.  As Windows evolved, inter-application
  74. communications using DDE and OLE was introduced, then more
  75. powerful application frameworks products such as Borland's OWL
  76. and Microsoft's MFC appeared, as well as third-party products
  77. such as zApp from Zinc and Island Systems' object-Menu. 
  78.  
  79. These libraries were used to encapsulate the most common
  80. functions of Windows applications, as well as to leave room for
  81. expansion and customization by developers. Thus, a programmer
  82. could quickly create a window with a certain border style, make
  83. it modal and add a "Close" button, then invoke it with a single
  84. call.  Further, the advent of C++ compilers for Windows allowed
  85. experienced developers to exploit the power of object-oriented
  86. technology.  Developers now had the means to create complex
  87. applications within acceptable schedules. 
  88.  
  89. Object-oriented languages allowed developers to create classes
  90. and override specific virtual functions, providing a direct path
  91. to building custom libraries.  This generation of tools still had
  92. two major shortcomings: 
  93.  
  94. 1.   Although productivity had been significantly increased,
  95.      schedules for complex applications development were still
  96.      quite lengthy.  For example, the common development scenario
  97.      would proceed as follows:  
  98.      a)   some sample screens would be created in a prototype
  99.           environment or a resource tool; 
  100.      b)   marketing would critique the screen design and
  101.           modifications would be made; 
  102.      c)   the "final" screens would be integrated with code to
  103.           complete the application; 
  104.      d)   any changes that were requested often became
  105.           complicated and painful, since the code and the screens
  106.           were so closely linked. 
  107.  
  108. 2.   The expertise required made Windows programming the sole
  109.      domain of the experienced developer.  In other words, the
  110.      extensive needs of the corporate community simply could not
  111.      be met due to the requirement for significant programmer
  112.      expertise. 
  113.  
  114. Thus evolved the next stage of Windows development, characterized
  115. by 4GL visual design environments such as Microsoft Visual Basic
  116. and high-end products such as Powersoft's PowerBuilder.  These
  117. environments provided a major step forward in user-friendly
  118. development, with high-level, reusable components called controls
  119. which introduced the concept of a "building block" approach to
  120. software development.  Most of the application development effort
  121. could now occur within a visual design tool where the programmer
  122. would piece together an interface from a suite of available
  123. libraries.  Customization of the components can be accomplished
  124. by modifying a corresponding collection of properties sheet.  Any
  125. "work" to be done within the application is triggered via events
  126. that affect the interface components (mouse clicks, keyboard
  127. entries and so on).  With these first-generation visual
  128. development tools, the specification of the actions to be taken
  129. on these events is defined using a Basic-like scripting language. 
  130.  
  131. As proven by their broad popularity, these tools went a long way
  132. toward solving some of the problems of corporate developers.
  133. However, there remained a serious deficit in their capabilities,
  134. due to their reliance on the visual design process for creating
  135. the application and also their underlying interpreted languages. 
  136.  
  137. As the demands of Windows applications buyers continued to grow,
  138. developers were stretching the limits of the existing
  139. technologies to create projects such as mission-critical
  140. client/server applications.  Team development and software
  141. quality assurance issues were becoming prominent.  Applications
  142. were being designed as a series of modules that would need to
  143. interact seamlessly, and capable of communicating with and
  144. invoking other applications. For example, a user may have a need
  145. to insert a graphic in the context of an application. The graphic
  146. would be found by accessing a database created by some other
  147. application potentially residing over a network on a remote
  148. system. All of this needed to be transparent to the application
  149. at hand, so that users need not be concerned with where the
  150. graphic came from or how it was created. 
  151.  
  152.  
  153. Specifically, the following issues thus became crucial to
  154. professional applications developers: 
  155.  
  156. *    Performance
  157. *    Rapid Application Development
  158. *    Component Reuse
  159. *    Database Scalability
  160.  
  161. The next logical step in this evolution is technology that
  162. combines the significantly enhanced productivity of modern RAD
  163. tools with the power and flexible architecture of proven 3GL
  164. compiled languages.  The remainder of this paper will contrast
  165. how Delphi and Visual Basic address these four key criteria for a
  166. robust Windows development system. 
  167.  
  168. It is assumed that readers of this paper are familiar with RAD
  169. design concepts, but a detailed knowledge of Visual Basic or
  170. Delphi is not necessary in order to understand this paper.  
  171.  
  172. Performance
  173.  
  174. Performance of deployed applications is a key issue in today's
  175. highly competitive software market.  Particularly for large,
  176. distributed client/server applications, any shortfalls in
  177. execution speed become far more apparent, due to higher overall
  178. system demands. 
  179.  
  180. Delphi is based upon Object Pascal (a significant extension of
  181. the popular Borland Pascal 7.0) whereas Visual Basic uses
  182. Microsoft Basic as its underlying language.  Delphi's performance
  183. is significantly better, simply because it generates compiled
  184. executable files, while Visual Basic produces semi-interpreted
  185. code. That is, Delphi is built around an optimizing native code
  186. compiler instead of the slower interpreted p-code used by
  187. products such as Visual Basic. This results in Delphi
  188. applications executing 10 to 20 times faster than interpreted
  189. code.  Delphi's intelligent linker also enables segment
  190. optimization, thereby reducing executable file size by as much as
  191. 30 percent, which enables faster loading and additional
  192. performance gains. 
  193.  
  194. Delphi can compile standalone executable files (.EXEs) as well as
  195. reusable Dynamic Linked Libraries (DLLs).  For the ultimate in
  196. execution speed, Delphi also allows professional programmers to
  197. go one step further by writing in-line assembler code, for direct
  198. control of the microprocessor. 
  199.  
  200. Other areas in which Delphi displays considerable performance
  201. gains over Visual Basic is in database connectivity. The database
  202. layer of Visual Basic is implemented via ODBC, as opposed to the
  203. more efficient Borland Database Engine used in Delphi (and other
  204. core Borland development tools). However, Delphi also supports
  205. links to data via ODBC drivers. The high-performance native SQL
  206. Links supplied with Delphi Client/Server also outperform
  207. comparable Visual Basic SQL connectivity options. 
  208.  
  209. Benchmarks
  210.  
  211. Delphi's superior performance over Visual Basic becomes
  212. immediately apparent when running a few simple benchmarks.
  213. Consider the following examples, where a database is filled with
  214. items of text representing lastname, firstname, phone and street
  215. information. The phone number field is filled with consecutive
  216. integers, then the database is re-read and filled with a global
  217. array of integers from the phone number field. Finally, the
  218. global array is sorted to become reverse-ordered using a
  219. comparatively slow bubble sort algorithm. 
  220.  
  221. Similar code can be written in both Delphi and Visual Basic, with
  222. the stages of the benchmarks summarized in the following code
  223. fragments: 
  224.  
  225.  
  226.  
  227. VB - Fill
  228. ---------
  229. Sub btnFill_Click ()
  230. Dim k As Integer
  231.  MaxArray = EdArraySize.Text
  232.  For k = 1 To MaxArray
  233.   Data1.Recordset.AddNew
  234.   Data1.Recordset("LastName") = "Smith " + Str(k)
  235.   Data1.Recordset("FirstName") = "Joe " + Str(k)
  236.   Data1.Recordset("Phone") = Str(k)
  237.   Data1.Recordset.Update
  238.  Next k
  239.  Data1.Recordset.MoveLast
  240. End Sub
  241.  
  242. VB - Read
  243. ---------
  244. Sub btnSearch_Click ()
  245. Dim k As Integer
  246. Dim n As Integer
  247. Dim s As String
  248.  Data1.Recordset.MoveFirst
  249.  For k = 1 To MaxArray
  250.    s = edPhone.Text
  251.    n = Val(s)
  252.    Call AppendArray(k, n)
  253.    Data1.Recordset.MoveNext
  254.  Next k
  255. End Sub
  256.  
  257. VB - Sort
  258. ---------
  259. Sub btnSort_Click ()
  260.  Dim j As Integer
  261.  Dim k As Integer
  262.  Dim tmp As Integer
  263.  For j = 1 To MaxArray - 1
  264.   For k = 1 To MaxArray - j
  265.    If GlobArray(k) < GlobArray(k + 1) Then
  266.      ' Swap GlobArray[k+] with GlobArray[k] ...
  267.      tmp = GlobArray(k + 1)
  268.      GlobArray(k + 1) = GlobArray(k)
  269.      GlobArray(k) = tmp
  270.     End If
  271.    Next k
  272.   Next j
  273. End Sub
  274.  
  275.  
  276. Delphi - Fill
  277. -------------
  278. procedure TForm1.Button4Click(Sender: TObject);
  279. var
  280.  k,err: integer;
  281.  s: string;
  282. begin
  283.  val(edDBsize.Text,maxArray,err);
  284.  for k:=1 to maxArray do
  285.   with Table1 do
  286.    begin
  287.     str(k,s);
  288.     Append;
  289.     FieldByName('Lastname').AsString := 'NewGuy'+s;
  290.     FieldByName('Firstname').AsString := 'Paul'+s;
  291.     FieldByName('Phone').AsString := s;
  292.     Post;
  293.    end
  294. end;
  295.  
  296. Delphi - Read
  297. -------------
  298. procedure TForm1.btnSearchTestClick(Sender: TObject);
  299. var
  300.  s: string;
  301.  n,err,k: integer;
  302. begin
  303.  val(edDBsize.Text,MaxArray,err);
  304.  Table1.First;
  305.  for k:=1 to MaxArray do
  306.   begin
  307.    s := DBedPhone.EditText;
  308.    val(s,n,err);
  309.    AppendArray(k,n);
  310.    Table1.Next;
  311.   end;
  312. end;
  313.  
  314. Delphi - Sort
  315. -------------
  316. procedure TForm1.btnSortArrayClick(Sender: TObject);
  317. var
  318.  j,k,tmp: integer;
  319. begin
  320.  for j:=1 to MaxArray-1 do
  321.   for k:=1 to MaxArray-j do
  322.    if GlobArray[k] < GlobArray[k+1] then
  323.     begin
  324.      { Swap GlobArray[k+] with GlobArray[k] ... }
  325.      tmp := GlobArray[k+1];
  326.      GlobArray[k+1] := GlobArray[k];
  327.      GlobArray[k]   := tmp;
  328.     end;
  329. end;
  330.  
  331. Benchmark Results
  332.  
  333. The following table shows the results for database tables ranging
  334. in size from 100 to 4000 records.  The test stages Fill, Read and
  335. Sort correspond the code sections described on the previous
  336. pages. 
  337. (All benchmark times are in seconds.)
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351. D  = Delphi
  352. FL = Fill
  353. RD = Read
  354. X  = x Sort
  355. ST = Sort
  356.  
  357. -----------------------------------------------------------------
  358. #     D     VB    D    VB    D    X    VB   D      X Total  VB
  359. items
  360.       FL    FL    RD   RD    ST        ST   Total           Total
  361.       --    --    --   --    --        --   -----           -----
  362. 100   2     2     30   1     0    0    0    2      1.5      3
  363.  
  364. 1000  16    70    6    23    1    22   22   23     5        115
  365.  
  366. 2000  33    141   12   46    4    21   84   49     5.5      271
  367.  
  368. 3000  50    227   17   69    8    23.6 189  76     6.4      485
  369.  
  370. 4000  67    297   23   77    15   19.6 294  106    6.3      668
  371. -----------------------------------------------------------------
  372.  
  373.  
  374. As can be seen from the results, the resulting Delphi-generated
  375. code outperformed the Visual Basic routines, especially in
  376. code-bound portions such as the Sort stage, by about 20 times
  377. faster.  Delphi's database access functionality was also shown to
  378. be about five times more efficient than that of the Visual Basic
  379. code. 
  380.  
  381.  
  382. Rapid Application Development (RAD)
  383.  
  384. The other side of the performance issue relates to the speed of
  385. application development, which is crucial for programmers intent
  386. on ensuring the fastest time to market for their products.  The
  387. RAD features of an environment are the key to establishing how
  388. easy it is for programmers to progress from initial design and
  389. prototyping through to final implementation and deployment. 
  390.  
  391. A modern RAD environment provides developers with several
  392. elements that significantly speed the development process over
  393. the traditional sequential coding approach.  These include:  
  394.  
  395. *    A visual design environment;
  396. *    High-level building block components (often called
  397.      "controls");
  398. *    Contextual access to code segments directly, via objects. 
  399.      In other words, homing in on the specific code relating to a
  400.      particular object.  
  401.  
  402. Under Windows, the structure of an application is frequently
  403. molded around its graphical user interface (GUI), with the
  404. behavior of the application triggered by various Windows
  405. messages or events.  The methodology for RAD flows according to
  406. the following outline:  
  407.  
  408. 1)   The developer creates an empty window or form to contain the
  409.      application's interface components; 
  410.  
  411. 2)   The developer selects a component from a pool of available
  412.      components, which are generally displayed as an array of
  413.      icons. Components are then placed and sized on the form;
  414.  
  415. 3)   Relevant properties are set or adjusted for each component,
  416.      according to the application's requirements; 
  417.  
  418. 4)   Code is written and "attached" to all relevant events for
  419.      each component; 
  420.  
  421. 5)   The application is run within the development environment; 
  422.  
  423. 6)   The developer can then continue to modify the form design or
  424.      underlying code until the final working application is
  425.      completed. 
  426.  
  427. Both Visual Basic and Delphi subscribe to this general
  428. methodology, making the products appear deceptively similar. 
  429. However,  there are several key enhancements that Delphi adds to
  430. this process, including: 
  431.  
  432. *    More built-in controls Enhanced icon layout, via a
  433.      fully-customizable, multi-page (tabbed) component palette;
  434.  
  435. *    Extensive gallery of extensible project templates and
  436.      experts; 
  437.  
  438. *    Enhanced object placement capabilities;
  439.  
  440. *    Enhanced modification of property lists;
  441.  
  442. *    Two-way, synchronized code window;
  443.  
  444. *    Shared event functions;
  445.  
  446. *    Integrated graphical debugging and object inspection 
  447.  
  448. Controls
  449.  
  450. Visual Basic custom controls are referred to as VBXs, and a
  451. limited selection is supplied with Visual Basic itself.
  452. Additional controls are sold by third-party manufacturers,
  453. although these not only cost additional money but also extend the
  454. overall learning curve, due to variations in product styles.  To
  455. utilize controls for a tabbed folder, notebook, database grid or
  456. 3D list box, for example, Visual Basic owners must obtain
  457. third-party VBXs. Some of the controls supplied with Visual Basic
  458. suffer from memory and other limitations, making it necessary to
  459. purchase third-party alternatives. 
  460.  
  461. Delphi's Visual Component Library (VCL) is a comprehensive suite
  462. of high- performance controls that support all standard Windows
  463. functionality, along with additional features such as tabbed
  464. folders, notebooks, database grids and 3D list boxes. Delphi also
  465. supports third-party VBXs, providing access to a wide range of
  466. third-party components. 
  467.  
  468. Control Icon Array
  469.  
  470. The Visual Basic control display is an array of icons with
  471. pictorial representations that are not always intuitive.  In
  472. other words, developers can be left searching for the Image
  473. Control, for example, amongst many other icons with a similar
  474. look.  Developers must then place a control into the form to be
  475. certain as to its identity. The Visual Basic control icon array
  476. can quickly become unwieldy as additional third-party custom
  477. controls are acquired.  Since these icons are organized as a
  478. configurable rectangle, developers working with a large set of
  479. VBX controls are forced to give up valuable screen space or
  480. sacrifice accessibility of some controls.         
  481.  
  482. Delphi solves these component layout problems with several
  483. enhancements. Firstly, Delphi's component palette is organized
  484. with several tabbed notebook pages, displaying icons in a
  485. single-row, scrollable toolbar format. This keeps the display
  486. uncluttered, yet fully accessible. More importantly, Delphi's
  487. customization options allow full configuration of the grouping,
  488. placement and display of components, so that  the environment can
  489. be fine-tuned to suit the working style of an individual or
  490. development team. To address the problem of obscure or
  491. similar-looking icons, Delphi offers "fly-by help" showing the
  492. purpose of the control associated with the icon as the cursor is
  493. dragged over it. 
  494.  
  495. Templates and Experts
  496.  
  497. Delphi includes pre-built templates that make it easy to develop
  498. standard applications or complex components such as MDI windows,
  499. database forms, multi-pages dialog and dual list boxes.  The
  500. architecture is fully extensible, allowing developers to easily
  501. register their own custom templates and experts into the gallery. 
  502.  
  503. Object Placement
  504.  
  505. Delphi facilitates visual design with features such as automatic
  506. object alignment, sizing and scaling, while Visual Basic supports
  507. placement only.  Delphi's automatic alignment also speeds up the
  508. creation of aesthetic forms. 
  509.  
  510. Property Lists
  511.  
  512. A subtle yet significant distinction between the two development
  513. tools can be seen in the means of accessing property lists. 
  514. Visual Basic users access a pull-down selection of options for a
  515. particular property via an entry bar at the top of the list, so
  516. that changing several property items, requires selection of the
  517. item, clicking on the entry bar to make the change, then clicking
  518. on the next item, and so forth.  Delphi provides pull-down lists
  519. that can be accessed directly alongside the property value,
  520. making for more efficient and intuitive modifications. 
  521.  
  522. Code Window
  523.  
  524. Delphi's code editing window synchronizes all visual design
  525. representations with the underlying source code.  In other words,
  526. as the application is constructed by dropping objects into a
  527. form, the corresponding bug-free code is generated
  528. simultaneously.  There are no limitations, since the code is
  529. always accessible, and developers can instantly switch between
  530. the code editor and the visual design tools, allowing them to
  531. select the most efficient mode for each part of the project. 
  532.  
  533. Debugging and Object Inspecting
  534.  
  535. Visual Basic provides program debugging capabilities such as
  536. variable watches and a call stack monitor. However, this
  537. functionality is limited in that it cannot break on a specific
  538. condition, and the call stack is modal, so it cannot be viewed
  539. during the entire debug session.    
  540.  
  541. Delphi provides a full-featured debugger with conditional
  542. breakpoints and a modeless call stack viewer. The debug window
  543. and viewers can be saved from session to session, allowing
  544. developers to create a comfortable custom environment. Delphi
  545. also includes a powerful object browser similar to that used
  546. within Borland C++, which provides a comprehensive display of
  547. code objects and classes - including the capability to trace
  548. object lineage (inheritance, children) and virtual procedures. 
  549.  
  550. Component Reuse
  551.  
  552. One of the most significant advances in applications development
  553. methodology is the concept of creating an application from
  554. high-level components.  By linking predefined building blocks,
  555. developers need only define the "glue" between objects that
  556. specifies the unique qualities of an application, with the
  557. potential for substantial productivity gains.  Although Delphi
  558. and Visual Basic both provide various ways to reuse and share
  559. components and code, Delphi again delivers a cleaner and simpler
  560. solution. 
  561.  
  562. The issue of reuse can be viewed in three areas:
  563.  
  564. *    shared event functions
  565.  
  566. *    reusable functions
  567.  
  568. *    reusable building blocks (components)
  569.  
  570. Shared Event Functions
  571.  
  572. A common problem encountered in Windows programs is how to share
  573. a function that is executed upon the occurrence of several
  574. Windows events. Although the implementation is similar in both
  575. Delphi and Visual Basic, the Delphi solution has some obvious
  576. advantages.  In Visual Basic, shared functions must be placed in
  577. the local code file or in a global .BAS file if the function is
  578. to be shared.  The problem with this is that the function is now
  579. global to the entire project.  In contrast, Delphi allows the
  580. function to be placed in the local file or in a DCU (Pascal unit
  581. file) which must be explicitly referenced only by the files that
  582. use it.  
  583.  
  584. Reusable Functions and Libraries
  585.  
  586. In Visual Basic, common functions or libraries are accomplished
  587. by use of a global .BAS file, which then makes the functions
  588. accessible to every file in the project. The disadvantage to this
  589. approach is that the shared functions must be global to every
  590. file.  Alternatively, Visual Basic can take advantage of
  591. functions organized in a DLL, but DLLs (like VBXs) must be
  592. created by another development tool external to Visual Basic,
  593. which requires a different level of expertise and an additional
  594. learning curve. All libraries for Delphi can be created from
  595. within the Delphi environment. Pascal code is organized as units,
  596. and shared functions are accessible through a Pascal unit by
  597. simply referencing the "library" unit  that contains the desired
  598. function.  Delphi can also use and create high-performance
  599. Windows DLLs.  Further, Delphi's underlying programming language
  600. allows developers to reuse and customize functionality within a
  601. class via subclassing (see further details of OOP methodology
  602. below). 
  603.  
  604. Components
  605.  
  606. VBXs can be developed for Visual Basic with functionality that is
  607. usable across different projects, but a significant disadvantage
  608. of VBXs is the complexity involved in creating them.  There is a
  609. detailed set of restrictions associated with creation of a VBX
  610. such that they cannot be created within Visual Basic itself.
  611. Instead, the most common method to create a VBX is to use a C/C++
  612. compiler to create a DLL and then put a VBX "wrapper" around it.
  613. The advantage of this is the speed of computation gained by using
  614. optimized C/C++ compiled code over the Visual Basic's interpreted
  615. technology. The disadvantage is that developers are forced to
  616. "switch gears" in order to work with the compiler, and the added
  617. complexity can lead to additional troubleshooting and debugging
  618. time. 
  619.  
  620. Delphi components are more easily created.   Unlike Visual
  621. Basic, where VBXs must be built using an external compiler,
  622. Delphi components are built within the Delphi development
  623. environment itself. This is an important distinction, because
  624. professional developers prefer to work with a consistent set of
  625. tools. Being able to use Delphi to create reusable components
  626. becomes a major productivity enhancement, enabling more rapid
  627. development with the added benefits of  reusability.
  628.  
  629. Additionally, since Delphi components are created with Delphi's
  630. optimizing native code compiler and linker, there is improved
  631. performance over traditional VBXs.  One other considerable
  632. advantage of Delphi components is that developers can subclass
  633. the functionality of a component to create their own custom
  634. versions. If a specific VBX is insufficient for a Visual Basic
  635. user, the only alternative is to build (or purchase) an
  636. alternative VBX. 
  637.  
  638. Programming Language
  639.  
  640. An obvious difference between Visual Basic and Delphi is the
  641. underlying programming language. The use of Object Pascal within
  642. Delphi has several important repercussions: 
  643.  
  644. *    Pascal is a more powerful and structured language than
  645.      Basic. 
  646.  
  647. *    Object Pascal is a true object-oriented programming
  648.      language, providing the benefits of inheritance,
  649.      encapsulation and polymorphism; 
  650.  
  651. *    Pascal is a compiled language, ensuring high-performance
  652.      executables; 
  653.  
  654. *    The organization of files as DCUs provides a cleaner
  655.      mechanism for creating libraries of reusable code (see
  656.      Shared Event Code);
  657.  
  658. *    Object Pascal utilizes the world's fastest commercial
  659.      compiler technology; 
  660.  
  661. *    Object Pascal support in-line assembler code for maximum
  662.      performance; 
  663.  
  664. One final point of differentiation is that in Visual Basic, all
  665. code files must be specifically associated with a form, except
  666. for a global .BAS file.   In other words, a function must be
  667. global to the entire project unless associated with a form.  In
  668. Delphi, however,  code files (and therefore classes and
  669. functions) can be disassociated with any form, allowing proper
  670. scoping of functions without any loss of functionality. 
  671.  
  672. OOP Design Methodology
  673.  
  674. The power and flexibility of an object-oriented design
  675. methodology is widely accepted as the best way to solve complex,
  676. real-world programming problems. Object-oriented design provides
  677. both a solid foundation and elegant architecture for an
  678. application.  Some of the benefits of OOP are: 
  679.  
  680. *    Shorter development cycles;
  681.  
  682. *    Code that is highly maintainable;
  683.  
  684. *    Code that is easily shared with other modules or other
  685.      projects;
  686.  
  687. *    Facilitation of team programming and version control;
  688.  
  689. *    By exploiting object inheritance and polymorphism, the
  690.      coding process can become much simpler and the code itself
  691.      significantly more coherent; 
  692.  
  693. *    Applications can incorporate several functions that are
  694.      mostly similar but have certain distinct "personality
  695.      traits". 
  696.  
  697. Object Pascal is a structured, object-oriented programming
  698. language, providing full support for class architectures,
  699. inheritance, virtual functions and polymorphism. Visual Basic is
  700. not an object-oriented language.  Note that although developers
  701. need not be familiar with object-oriented concepts to create
  702. programs using Delphi, professional programmers will appreciate
  703. the benefit of these capabilities.   
  704.  
  705. Database Scalability
  706.  
  707. A good RAD environment must address the pervasive issue of
  708. creating a database application, and Visual Basic and Delphi are
  709. no exceptions.  In Visual Basic, developers can place a database
  710. component onto a form which can then have a property set that
  711. allows it to bidirectionally communicate with an ODBC-compatible
  712. database. The database component can be used as a crude mechanism
  713. to navigate through the database using arrows representing first,
  714. next, previous and last records. SQL queries can also be defined
  715. in code, to form a query snapshot into the database for viewing
  716. or computation. Crystal Reports is shipped with Visual Basic,
  717. providing a report generating capability. Setup of the database
  718. structures, the associated forms, interaction between them and
  719. most of the navigation through the database must all be done
  720. explicitly via the visual design tools or within code.   
  721.  
  722. Delphi includes extensive database support including the Borland
  723. Database Engine (BDE) for Paradox and dBASE access, and
  724. middleware layers that support local and remote SQL data access. 
  725. The Borland database architecture provide developers with
  726. high-performance access to a variety of data sources including
  727. ODBC drivers.  Delphi includes data access components and
  728. data-aware user interface components to provide a comprehensive
  729. database solution. 
  730.  
  731. Delphi ships with several controls for data entry and display,
  732. including tables and grids. The grid control (TDBGrid Component)
  733. can be used to build a spreadsheet-style of application. A unique
  734. characteristic of the database grid control is that it can be
  735. linked to multiple database sources. 
  736.  
  737. Delphi also includes wizards and experts that facilitate rapid
  738. design and implementation of databases and the corresponding user
  739. interface. The DataSet designer facility included with Delphi
  740. allows developers to rapidly create table or query data for
  741. database components. It is a simple matter to specify which set
  742. of fields from the database must be incorporated into the table
  743. or query. 
  744.  
  745. When designing a database grid, an application often needs an
  746. editor to allow in-place modification of field data. Delphi's
  747. DBEdit provides a consolidated component to handle this task.
  748. Grid-aware, specialized versions of the control are available for
  749. labels, lists, combo boxes, images, memo (multi-line editors),
  750. check and radio buttons, lookup lists and lookup combo lists. 
  751.  
  752. Delphi also features built-in support for queries and reports.  A
  753. query control (TQuery Component) provides the ability to perform
  754. SQL queries in order to form the data set corresponding to the
  755. filtered elements of a database. If this data was extracted from
  756. dBASE or Paradox, you would also have the ability to modify,
  757. insert or delete records. By placing this component into a form
  758. that also contains the database component, developers can create
  759. a filtered, printable report based on some SQL or query into the
  760. data set. Delphi includes the award-winning ReportSmith report
  761. writer for PC and SQL databases.  ReportSmith provides an
  762. intuitive interface for report creation using live data at design
  763. time, and it supports queries, crosstabs, templates, calculations
  764. and unlimited report sizes. 
  765.  
  766. Moving Up to Delphi
  767.  
  768. Visual Basic developers who may be considering migrating their
  769. applications to Delphi, you may be concerned about the effort
  770. required to migrate existing Visual Basic applications in order
  771. to continue project development and maintenance within Delphi. 
  772. Project migration is actually a fairly straightforward process. A
  773. conversion utility is available from EarthTrek, Inc (617)
  774. 273-0308 that performs most of the translation including project
  775. files, form files and code translation.  The utility completes
  776. all of the possible automatic translation leaving some ambiguous
  777. language elements to be identified by a simple syntax check using
  778. the Delphi compiler.  Many projects can be translated with
  779. virtually no effort.  Others may require a few hours of post-work
  780. to complete. 
  781.  
  782. Conclusion
  783.  
  784. When examining the various RAD products in the marketplace, both
  785. Visual Basic and Delphi stand out as leading edge products. 
  786. However, Delphi has clearly emerged as a next generation tool
  787. with its higher performance, highly facilitated visual design
  788. capability, extensive support for reusable components and
  789. database readiness.  Delphi achieves its goals as a powerful
  790. application development system by combining a state-of-the-art
  791. visual design environment with the power, flexibility and
  792. reusability of a fully object-oriented language, the world's
  793. fastest compiler, and leading-edge database technology.  Further,
  794. through the integration of Object Pascal, Delphi empowers
  795. developers with a full-featured programming environment without
  796. sacrificing rapid visual development thus allowing construction
  797. of sophisticated client-server applications in record time. 
  798.  
  799.  
  800. DISCLAIMER: You have the right to use this technical information
  801. subject to the terms of the No-Nonsense License Statement that
  802. you received with the Borland product to which this information
  803. pertains.
  804.