[ Pobierz całość w formacie PDF ]
.There aretwo kinds of packages: runtime packages and design-time packages.Runtimepackages provide functionality to a program while that program is running.Design-time packages extend the functionality of the IDE.For more information on packages, see Chapter 16, Working with packages andcomponents.When to use packages and DLLsFor most applications, packages provide greater flexibility and are easier to createthan DLLs.However, there are several situations where DLLs would be better suitedto your projects than packages:" Your code module will be called from non-Delphi applications." You are extending the functionality of a Web server." You are creating a code module to be used by third-party developers." Your project is an OLE container.However, if your application includes VisualCLX, you must use packages instead ofDLLs.Only packages can manage the startup and shut down of the Qt sharedlibraries.Bui l di ng appl i c at i ons , c omponent s , and l i br ar i es 8-11Wr i t i n g d a t a b a s e a p p l i c a t i o n sYou cannot pass Delphi runtime type information (RTTI) across DLLs or from a DLLto an executable.If you pass an object from one DLL to another DLL or an executable,you will not be able to use the is or as operators with the passed object.This isbecause the is and as operators need to compare RTTI.If you need to pass objectsfrom a library, use packages instead, as these can share RTTI.Similarly, you shoulduse packages instead of DLLs in Web Services because they are rely on Delphi RTTI.Writing database applicationsYou can create advanced database applications using tools to connect to SQL serversand databases such as Oracle, Sybase, InterBase, MySQL, MS-SQL, Informix,PostgreSQL, and DB2 while providing transparent data sharing betweenapplications.The Component palette includes many components for accessing databases andrepresenting the information they contain.The database components are groupedaccording to the data access mechanism and function.Table 8.2 Database pages on the Component palettePalette page ContentsBDE Components that use the Borland Database Engine (BDE), a large API forinteracting with databases.The BDE supports the broadest range of functionsand comes with the most supporting utilities including Database Desktop,Database Explorer, SQL Monitor, and BDE Administrator.See Chapter 26, Using the Borland Database Engine for details.ADO Components that use ActiveX Data Objects (ADO), developed by Microsoft, toaccess database information.Many ADO drivers are available for connecting todifferent database servers.ADO-based components let you integrate yourapplication into an ADO-based environment.See Chapter 27, Working withADO components for details.dbExpress Cross-platform components that use dbExpress to access database information.dbExpress drivers provide fast access to databases but need to be used withTClientDataSet and TDataSetProvider to perform updates.See Chapter 28, Usingunidirectional datasets for details.InterBase Components that access InterBase databases directly, without going through aseparate engine layer.For more information about using the InterBasecomponents, see the online Help.Data Access Components that can be used with any data access mechanism such asTClientDataSet and TDataSetProvider.See Chapter 29, Using client datasets forinformation about client datasets.See Chapter 30, Using providercomponents for information about providers.Data Controls Data-aware controls that can access information from a data source.SeeChapter 20, Using data controls for details.8-12 Devel oper s Gui deCr e a t i n g We b s e r v e r a p p l i c a t i o n sWhen designing a database application, you must decide which data accessmechanism to use.Each data access mechanism differs in its range of functionalsupport, the ease of deployment, and the availability of drivers to support differentdatabase servers.See Part II, Developing database applications, for details on how to create bothdatabase client applications and application servers.See Deploying databaseapplications on page 18-6 for deployment information.Note Not all editions of Delphi include database support [ Pobierz całość w formacie PDF ]
zanotowane.pl doc.pisz.pl pdf.pisz.pl odbijak.htw.pl
.There aretwo kinds of packages: runtime packages and design-time packages.Runtimepackages provide functionality to a program while that program is running.Design-time packages extend the functionality of the IDE.For more information on packages, see Chapter 16, Working with packages andcomponents.When to use packages and DLLsFor most applications, packages provide greater flexibility and are easier to createthan DLLs.However, there are several situations where DLLs would be better suitedto your projects than packages:" Your code module will be called from non-Delphi applications." You are extending the functionality of a Web server." You are creating a code module to be used by third-party developers." Your project is an OLE container.However, if your application includes VisualCLX, you must use packages instead ofDLLs.Only packages can manage the startup and shut down of the Qt sharedlibraries.Bui l di ng appl i c at i ons , c omponent s , and l i br ar i es 8-11Wr i t i n g d a t a b a s e a p p l i c a t i o n sYou cannot pass Delphi runtime type information (RTTI) across DLLs or from a DLLto an executable.If you pass an object from one DLL to another DLL or an executable,you will not be able to use the is or as operators with the passed object.This isbecause the is and as operators need to compare RTTI.If you need to pass objectsfrom a library, use packages instead, as these can share RTTI.Similarly, you shoulduse packages instead of DLLs in Web Services because they are rely on Delphi RTTI.Writing database applicationsYou can create advanced database applications using tools to connect to SQL serversand databases such as Oracle, Sybase, InterBase, MySQL, MS-SQL, Informix,PostgreSQL, and DB2 while providing transparent data sharing betweenapplications.The Component palette includes many components for accessing databases andrepresenting the information they contain.The database components are groupedaccording to the data access mechanism and function.Table 8.2 Database pages on the Component palettePalette page ContentsBDE Components that use the Borland Database Engine (BDE), a large API forinteracting with databases.The BDE supports the broadest range of functionsand comes with the most supporting utilities including Database Desktop,Database Explorer, SQL Monitor, and BDE Administrator.See Chapter 26, Using the Borland Database Engine for details.ADO Components that use ActiveX Data Objects (ADO), developed by Microsoft, toaccess database information.Many ADO drivers are available for connecting todifferent database servers.ADO-based components let you integrate yourapplication into an ADO-based environment.See Chapter 27, Working withADO components for details.dbExpress Cross-platform components that use dbExpress to access database information.dbExpress drivers provide fast access to databases but need to be used withTClientDataSet and TDataSetProvider to perform updates.See Chapter 28, Usingunidirectional datasets for details.InterBase Components that access InterBase databases directly, without going through aseparate engine layer.For more information about using the InterBasecomponents, see the online Help.Data Access Components that can be used with any data access mechanism such asTClientDataSet and TDataSetProvider.See Chapter 29, Using client datasets forinformation about client datasets.See Chapter 30, Using providercomponents for information about providers.Data Controls Data-aware controls that can access information from a data source.SeeChapter 20, Using data controls for details.8-12 Devel oper s Gui deCr e a t i n g We b s e r v e r a p p l i c a t i o n sWhen designing a database application, you must decide which data accessmechanism to use.Each data access mechanism differs in its range of functionalsupport, the ease of deployment, and the availability of drivers to support differentdatabase servers.See Part II, Developing database applications, for details on how to create bothdatabase client applications and application servers.See Deploying databaseapplications on page 18-6 for deployment information.Note Not all editions of Delphi include database support [ Pobierz całość w formacie PDF ]