background preloader

Gravee - The Social Search and Recommendation Engine

Social Media Search Tool | WhosTalkin? [delphi-br] DataModule customizado não herda componentes Estou criando dois data modules no Delphi 2007: TDMConexao e TDMBasico. O TDMConexao possui somente um componente TSQLConnection, com código no evento OnCreate pra conectar com a base de dados usando o nome de um arquivo que será informado numa propriedade Published do mesmo (TDMConexao). O TDMBasico contém somente um TClientDataSet. Este data module não tem propriedades Published. Pesquisando na web, encontrei códigos de como registrar as classes para que os data modules derivados exibissem as propriedades Published no Objetc Inspector. Sendo assim, criei um pacote e adicionei as units dos dois data modules (TDMConexao e TDMBasico), além de criar uma nova unit responsável por registrar as classes. unit FormPropReg; interface procedure Register; implementation uses DesignIntf, DMForm, DMConexao, DMBasico; procedure Register; begin // DataModules RegisterCustomModule(TDMConexao, TDataModuleCustomModule); RegisterCustomModule(TDMBasico, TDataModuleCustomModule); end; end.

Designing with data modules by Mark Cashman Data modules are a specialized type of form descended from TDataModule. Normally, you place components that descend from TDataSet and TDataSource on a data module (TTable and TQuery, for example), but data modules can contain any non-visual component. Data modules represent one of the most underutilized aspects of the VCL. This is not surprising when you consider that only a few lines are dedicated to them in the C++Builder Developer’s Guide. In my first year of working with C++Builder, I completely ignored data modules, piling datasets and data sources on my forms as needed. Basic data modules A basic data module is a container for datasource components such as TTable and TQuery, and for their associated TDataSources. The basic data module, though, has a more important purpose. Once you make the transition to the basic data module, you need to follow certain rules to gain the greatest benefits from the approach. Using basic data modules to partition data Figure A Figure B

Related: