Home > Back-end >  Delphi design pattern
Delphi design pattern

Time:09-24

Recently do company project, modular program, we will be responsible for the realization of the function of the various modules, is written as a DLL and then for the main program,
Inside the DLL I do use a function Biz2Packer. BeginPack; I can't find his place, the code is as follows:
 
//call beginpack package
Biz2Packer. BeginPack;

//Biz2Packer. BeginPack; The statement of the code
TBizPacker=class (TObject)
Public
Procedure BeginPack; Virtual; The abstract;
.//other properties and methods omit
end;



Here, I just can't find a BeginPack the implementation of the place, according to the truth, TBizPacker this abstract class methods should be implemented in subclasses TBizPacker, but when I can't find in the project have a subclass from TBizPacker class inheritance,
Because this is done in the middle of the DLL project, the main program code that I couldn't see, so I have several guess,
1, BeginPack implementation is done in the middle of the main program, (please inform this kind of writing is legal, if the legitimate, how to use,,,)
2, BeginPack is the method in other DLL or BPL, but I didn't see any static or dynamic in the code call DLL, if is the method in BPL, o great god told that this specified writing,

CodePudding user response:

No use BeginPack; The place?

CodePudding user response:

@ DelphiGuy yeah. In fact, the first sentence is invoked,

CodePudding user response:

Still didn't finish writing
To stay on the abstract stage TBizPacker now?
Depends on its practical use to know do you want to write a subclass implementation

The same TBizPacker definition should not appear in the multiple segmentation of case
Unless have first agreed between different child case TBizPacker definition file can not be change
Or so the dependence of each other too much

CodePudding user response:

Since there are calls, that there must be a subclass of implementation, or class helper, hold down the CTRL key in the IDE, the mouse pointer to this method will appear links, point check implementation where,

CodePudding user response:

The
reference 3 floor dkjfsoman response:
still haven't finished the
To stay on the abstract stage TBizPacker now?
Depends on its practical use to know do you want to write a subclass implementation

The same TBizPacker definition should not appear in the multiple segmentation of case
Unless have first agreed between different child case TBizPacker definition file can not be change
Or that the dependence of each other too much

Have been implemented, can't find in the whole project implementation,

CodePudding user response:

reference 4 floor DelphiGuy response:
given the call, it must have a subclass implementation, or class helper, hold down the CTRL key in the IDE, the mouse pointer to the method would be a link, where point check implementation,

I press CTRL + left, where calls BeginPack jump straight to the procedure BeginPack; Virtual; The abstract;
Did not find any TBizPacker subclass implements BeginPack method,
Could it be implemented in the main program code, I this DLL will not see?

CodePudding user response:

DLL can normal compilation, added to the main program can run normally, the problem is now could not find the code, realize BeginPack,,

CodePudding user response:

That you open the debug information, the project to build, and then the call BeginPack place next breakpoints, running, tracking check,

CodePudding user response:

Feeling is an interface, the realization of encapsulated inside another DLL

CodePudding user response:

Is likely to be Dcu or Bpl
  • Related