Delphi-Kylix
  Home arrow Delphi-Kylix arrow Page 3 - Plug-ins Explained
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Moblin 
JMSL Numerical Library 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DELPHI-KYLIX

Plug-ins Explained
By: Leidago
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 4
    2006-11-13

    Table of Contents:
  • Plug-ins Explained
  • Building your own packages
  • Linking your package
  • An example

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Plug-ins Explained - Linking your package


    (Page 3 of 4 )

    After you've created your package, the next step is to link it to your main application. You can link your run-time packages in two ways, statically or dynamically. When using static linking, you simply add the names of the Pascal files to the "uses" clause of your application. Don't worry about the same units being listed in your package. By adding these units you ensure that the VCL is used when you eventually run the application. When you run your application with statically linked packages, it ensures that the run-time packages are present.

    If the run-time packages are not present, an error will be generated and program execution will be stopped. Now, keep in mind that our overall aim is to use packages as an plug-in, so this situation will not do. Static linking also won't work for use because you will need to re-link the package to the application when you change the package's contents or replace it with another package. This pretty much takes away the independence of the core application when used with packages. This basically means that every time you change something in the package, you will need to recompile the core application to which it needs to be linked. It is for this reason that static linking is not suitable for our purposes at all. So let's take a look at dynamic linking.

    If you've ever used DLL files in your applications, you should not have any problems working with dynamic packages, because they work pretty much in the same way. Dynamic packages are basically a "special" type of DLL that works only with Delphi applications. So, why are dynamic packages suitable to use for creating plug-ins? 

    • You can update the package without crashing the core application.
    • All the relevant VCL functionality is stored in the package, which allows for a smaller executable.
    • You load the package when the main application starts without crashing it, because you can add code to check whether or not the package is available.
    • You can load and unload the package(s) as and when you need them as opposed to a statically linked package that has to be linked no matter what.

    It is the flexibility to load and unload a package that is of particular interest to us, because that is how we are going to manage our plug-ins.

    More Delphi-Kylix Articles
    More By Leidago


       · This article explains how to built a plug-in using Delphi packages.
     

    DELPHI-KYLIX ARTICLES

    - Finishing the Client for an Internet Access ...
    - The Client for an Internet Access Control Ap...
    - User Management for an Internet Access Contr...
    - Important Procedures for an Internet Access ...
    - Server Code for an Internet Access Control A...
    - Constructing the Interface for an Internet A...
    - Building a Server Application for an Interne...
    - Building an Internet Access Control Applicat...
    - Client Dataset: Working with Data Packets an...
    - Using the Client Dataset in an N-Tiered Appl...
    - Using the Client Dataset in Two-Tiered Clien...
    - Using the Client Dataset in File-Based Archi...
    - Demystifying the Client Dataset
    - Working with INI Files in Delphi
    - Creating Data Link (UDL) Files in Delphi






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
    Stay green...Green IT