Adding/Removing pzl-Component to the Pzl-Container: различия между версиями

Материал из wikiru.visual-prolog.com

м
м
Строка 2: Строка 2:


It is recommended to make the adding the plz-component to the pzl-Container using the Elementary PzlStudio. The manual performing this operation using the IDE may lead to the non-correspondence of some necessary links in the projects.
It is recommended to make the adding the plz-component to the pzl-Container using the Elementary PzlStudio. The manual performing this operation using the IDE may lead to the non-correspondence of some necessary links in the projects.
Any entity may be a pzl-container - an executable application or it may be a dll-container. To make the adding operation you choose the Visual Prolog project, which is a pzl-container. If it is the main application, then the pzlPort must be added to it before. If it is the DLL, then it must be actually the pzl-container based on DLL.
Further you choose a pzl-component package and you may choose any of ways to add the pzl-component to the pzl-container: as the original pzl-component or it will be added as the pzl-component delegate (proxy).


You may also make a conversion of the status of the pzl-components, which was included to the  pzl-container before. The status "original" may be converted to the status "proxy". The back operation is available also.
You may also make a conversion of the status of the pzl-components, which was included to the  pzl-container before. The status "original" may be converted to the status "proxy". The back operation is available also.
Строка 11: Строка 7:
After the operation performing is complete you may come back to the Visual Prolog IDE and work with the modified project.
After the operation performing is complete you may come back to the Visual Prolog IDE and work with the modified project.


=Invoking the Operation=
All operations with the pzl-component in teh pzl-container such as adding , removein and changing the status must be done using the same form. You may invoke the form via menu item ''Tools/Add/Component To Container'''. The project of the pzl-container must be saved in VIDE (Ctrl-S) before performing the operation. It is not necessary to close the project in the IDE if it is opened.


Операции над Pzl-Компонентами в Pzl-Контейнерах - добавление, удаление и изменение статуса не рекомендуется делать в IDE системы Visual Prolog. Выполнение таких операций вручную с использованием IDE может привести к рассогласованию необходимых связей.
[[Image:PzlStudio AddComponentDialog.png]]
 
Однако компиляция проектов, содержащих Pzl-Компоненты, должна производится в IDE, при этом следует выполнять рекомендации, приведенные ниже.
 
=Вызов операции=
Операции над Pzl-Компонентой в Pzl-Контейнере (добавление, удаление и изменение статуса производятся с помощью одной и той же формы, вызываемой через меню '''Tools/Add/Component To Container'''. Проект контейнера должен быть сохранен средствами IDE (Ctrl-S). Закрывать проект не обязательно.
 
[[Изображение:PzlStudio AddComponentDialog.png]]


Для подготовки к выполнению операции в форме должны быть выбраны Pzl-Контейнер ('''Container Project'''), которому соответствует файл проекта .prj6 и Pzl-Компонента ('''Component Package'''), которой соответствует Файл пакета компоненты .pack.
To prepare to the performing the operation you must set the Pzl-container ('''Container Project''') project (a file of the .prj6 type) and the pzl-component ('''Component Package''') package (a file of the .pack type).


Pzl-контейнером может быть как главное приложение, так и DLL-контейнер. Если контейнером является главное исполняемое приложение, то в него предварительно  должен быть добавлен PzlPort. Если это DLL - то это должен быть именно Pzl-контейнер на основе DLL, созданный с помощью интрумента [[Создание Pzl-Контейнера|Elemntary PzlStudio]].
Any entity may be a pzl-container - an executable application or it may be a dll-container. To make the adding operation you choose the Visual Prolog project, which is a pzl-container. If it is the main application, then the pzlPort must be added to it before. If it is the DLL, then it must be actually the pzl-container based on DLL and created using the by the [[Creation of the Pzl-container|Elemntary PzlStudio]].


Дальнейшие действия определяются тем, какая операция должна быть выполнена.
The further actions depend on the goal of the operation.


=Выполнение операции=
=Performing the Operation=
Выполнение операции осуществляется по нажатию одной из кнопок на панели:
The performing the operation is doing by the pressing one of buttons on the pane:
*'''Add As Original''' - добавить в качестве оригинала
*'''Add As Original'''
*'''Add As Proxy''' - Добавить в качестве представителя (Proxy)
*'''Add As Proxy'''
*'''Remove''' - удалить
*'''Remove'''
*'''Convert To Proxy''' - преобразовать в представителя (Proxy)
*'''Convert To Proxy'''


После выполнения операции в Oкне Cообщений (Messages) появляется отчет о выполнении операции.
The report regarding the result of the operation will be shown in the Message Window.


После выполнения операции следует перейти к IDE системы Visual Prolog, открыть проект (если он не открыт) и откомпилировать. Детали выполнения операций и рекоментации приведены ниже.
After the completion of the operation you should go to the IDE of the Visual Prolog system, open project (if it is not opened) and build it. Some details of the performing the operation are described below.


==Добавление==
==Adding==
Не имеет значения, является ли pzl-Контейнер пустым или в нем уже содержатся другие Pzl-Компоненты. Главное - добавляемая компонента до этого не должна содержаться в данном контейнере.
It dowsn’t matter whether the pzl-container is empty, or it has the pzl-components already. The main condition is that the component to be embedded must not be in the pzl-container already.


pzl-Компонента добавляется либо как оригинальная компонента, либо как представитель pzl-Компоненты (proxy).  
The pzl-component may be added as an original component or it may be added as a component delegate (proxy).


Если компонента добавляется как оригинальная компонента, то все другие классы могут ее использовать, создавая ее экземпляры и выполняя все, предусмотренные ее интерфейсами, действия. Для этого нажимается кнопка '''Add As Original''' (Добавить как оригинальную).
If you add the component as an original component, then all other classes may use it creating objects and performing all actions defined by the component’s interfaces. To add the pzl-component as the original one press the button '''Add As Original'''.


Если Вы добавляете в данный контейнер представителя Pzl-Компоненты, то это означает, что эта pzl-Компонента находится в каком-либо контейнере (Вы можете не знать, где именно), а все классы данного контейнера взаимодействуют с ней через ее представителя, находящегося в данном контейнере. В этом случае нажимается кнопка '''Add As Proxy''' (Добавить как представителя).
If you add the component delegate, then all classes of the given container communicate in the creation of the component object using the component delegate. To add the pzl-component as the component delegate press the button '''Add As Proxy'''.


Сообщение в Окне сообщений  подтвердит выполнение операции.
The Message Window will show the report regarding the result of the operation.


[[Изображение:PzlStudio ComponentAddedAsOriginalMSG.png]]
[[Image:PzlStudio ComponentAddedAsOriginalMSG.png]]


Откройте проект с помощью IDE (если он не открыт) и откомпилируйте его.
Open the project (if it is not opened) using the IDE and compile (build) it.


В процессе компиляции возможны следующие ситуации:
While the performing the operation the following situations may happen:
#При добавлении в качестве оригинала:
#If the original component added:
##'''Если добавленный Pzl-компонент  не использует другие Pzl-компоненты''',<br/>то все предолжения IDE по включению в проект других пакетов, используемых Pzl-Компонентом, '''можно принимать''' без опасений.
##'''If the new pzl-component added to the pzl-container doesn’t use other pzl-components'',<br/>then you should accept all proposals from the IDE to add new packages to the project.
##'''Если добавленный Pzl-компонент использует другие Pzl-компоненты, не включенные'''<br/> к моменту компиляции в проект Pzl-Контейнера, то '''необходимо отказаться''' от предложения IDE по включению такой компоненты в данный проект.<br/>'''Включение таких дополнительных Pzl-Компонент следует произвести только с помощью Elementary PzlStudio'''.
##'''If the new pzl-component added to the pzl-container uses some other pzl-components, which are not currently included to the pzl-container project, then you should refuse the adding such a new pzl-component to the project by the IDE.<br/>'''The inclusion of these pzl-components must be done using the Elementary PzlStudio only'''.
#При добавлении в качестве представителя проблем не должно быть. Этот случай подпадает под действие правила 1.1, приведенного выше.
#If you add the pzl-component delegate (proxy) there should not be any problems, because of it is the particular case of the rule 1.1 described above.


==Удаление==
==Removing==
Удаление pzl-Компоненты из Pzl-Контейнера рекомендуется осуществлять с помощью Elementary PzlStudio. Выполнение такой операции вручную с использованием IDE может привести к рассогласованию необходимых связей.
It is recommended to perform the removing the pzl-component from the pzl-container using the Elementary PzlStudio. The manual performing this operation using the IDE may lead to braking some links in the project.


После выполнения операции в Окне Сообщений появляется отчет о выполнении операции
After the completion of the operation you will see the report regarding the results of the operation in the Message Window.


[[Изображение:PzlStudio_ComponentRemovedSuccessfulyMSG.png‎]]
[[Image:PzlStudio_ComponentRemovedSuccessfulyMSG.png‎]]


Теперь следует вернуться к IDE, если проект контейнера был ранее открыт, или в IDE открыть модифицированный проект.
Now you must come back to the IDE and open the pzl-container project (if it was not opened before).


После удаления pzl-Компоненты следует произвести полную перекомпиляцию проекта с использованием '''Rebuild All'''.
It is recommended to make “Rebuild All” after the removing a pzl-component from the pzl-container.


Удаление pzl-Компоненты может привести к нарушению целостности проекта Pzl-Контейнера. Это справедливо, если какие-либо пакеты содержат обращения к удаленной Pzl-компоненте. Строго говоря, удаление Pzl-Компоненты в таких случаях является некорректной операцией. Правильнее было бы изменить статус pzl-Компоненты, преобразовав ее в представителя (Proxy).
The removing of the pzl-component may break some links in the project. It may happen if there are some invocations of the removed component from other classes of the given pzl-container. Strongly say you should not remove the pzl-component from the pzl-project. You should convert the status of the pzl-component to the Proxy status.


Преобразование не требуется, если одновременно с удалением данной Pzl-компоненты из данного Pzl-контейнера синхронно удаляютя и пакеты, обращающиеся к ней.
The conversion of the status will not be needed of you are making the synchronous removing of the pzl-components together will all classes (packages), which use it.


Если взаимного обращения обычных или являющихся компонентами пакетов, помещенных в данный контейнер, нет, то побочных явлений не должно возникать.
If there is no use of the removed component by the classes and packages of the given pzl-container project, then there should be no problems.


==Изменение Статуса pzl-Компоненты==
==Changing the Status of the Pzl-Component ==
Pzl-Компонента может иметь статус '''Ориганал''' или '''Представитель''' (Proxy).
The pzl-component may have the status “Original” or it may be “Proxy”.


При добавлении Pzl-Компоненты в Pzl-Контейнер статус компоненты определяется типом операции: добавление в качестве  Оригинала или в качестве Представителя.
While adding the pzl-component to the pzl-project the status of the pzl-component is defined by the type of the operation performed (‘’’Add As Original’’’ or ‘’’Add As Proxy’’’).


Пользуясь Elementary PzlStudio, Вы можете изменить статус pzl-Компоненты с оригинального на Proxy и обратно.
Using the Elementary PzlStudio, you may change the status of the pzl-component from the “original” to “proxy” and back.
===Конвертация в Proxy===
===Converting to Proxy ===
Изменение статуса с оригинального на Proxy производится простым нажатием на кнопку '''Convert To Proxy''' (Преобразовать в Proxy). В Окне сообщений появится отчет о выполнении операции.
Converting the status from the “original” to “proxy” may be done by pressing the button '''Convert To Proxy''' (Преобразовать в Proxy). You will see the report regarding the performing the operation.


[[Изображение:PzlStudio_ConvertOriginalToProxyMSG.png]]
[[Image:PzlStudio_ConvertOriginalToProxyMSG.png]]


Теперь надо перейти к IDE и откомпилировать проект.
Now you should go to the IDE and compile the project.


===Конвертация в Оригинал===
===Converting to the Original ===
Форма не имеет явной операции по преобразованию ствтуса Pzl-Компоненты с Proxy на Оригинал. Однако выполнение операции '''Add As Original''', несмотря на присутствие Pzl-компоненты в Pzl-контейнере, установит статус Pzl-Компоненты Оригинал. Отчет в Окне Сообщений покажет:
There is no special operation to convert the status of the pzl-component from the ‘proxy’ to the ‘original’. Performing the operation '''Add As Original''', despite on the existence of the pzl-component in the project will change the status of the pzl-component to the “original” status. There will be the report in the Message Window:


[[Изображение:PzlStudio_ConvertProxyToOriginalMSG.png]]
[[Image:PzlStudio_ConvertProxyToOriginalMSG.png]]


Теперь надо перейти к IDE и откомпилировать проект.
Now you should go to the IDE and build the project.


=References=
=References=
[[Category:VpPuZzleEn]]
[[Category:VpPuZzleEn]]

Версия 11:42, 6 февраля 2008

Автор: Виктор Юхтенко

It is recommended to make the adding the plz-component to the pzl-Container using the Elementary PzlStudio. The manual performing this operation using the IDE may lead to the non-correspondence of some necessary links in the projects.

You may also make a conversion of the status of the pzl-components, which was included to the pzl-container before. The status "original" may be converted to the status "proxy". The back operation is available also.

After the operation performing is complete you may come back to the Visual Prolog IDE and work with the modified project.

Invoking the Operation

All operations with the pzl-component in teh pzl-container such as adding , removein and changing the status must be done using the same form. You may invoke the form via menu item Tools/Add/Component To Container'. The project of the pzl-container must be saved in VIDE (Ctrl-S) before performing the operation. It is not necessary to close the project in the IDE if it is opened.

PzlStudio AddComponentDialog.png

To prepare to the performing the operation you must set the Pzl-container (Container Project) project (a file of the .prj6 type) and the pzl-component (Component Package) package (a file of the .pack type).

Any entity may be a pzl-container - an executable application or it may be a dll-container. To make the adding operation you choose the Visual Prolog project, which is a pzl-container. If it is the main application, then the pzlPort must be added to it before. If it is the DLL, then it must be actually the pzl-container based on DLL and created using the by the Elemntary PzlStudio.

The further actions depend on the goal of the operation.

Performing the Operation

The performing the operation is doing by the pressing one of buttons on the pane:

  • Add As Original
  • Add As Proxy
  • Remove
  • Convert To Proxy

The report regarding the result of the operation will be shown in the Message Window.

After the completion of the operation you should go to the IDE of the Visual Prolog system, open project (if it is not opened) and build it. Some details of the performing the operation are described below.

Adding

It dowsn’t matter whether the pzl-container is empty, or it has the pzl-components already. The main condition is that the component to be embedded must not be in the pzl-container already.

The pzl-component may be added as an original component or it may be added as a component delegate (proxy).

If you add the component as an original component, then all other classes may use it creating objects and performing all actions defined by the component’s interfaces. To add the pzl-component as the original one press the button Add As Original.

If you add the component delegate, then all classes of the given container communicate in the creation of the component object using the component delegate. To add the pzl-component as the component delegate press the button Add As Proxy.

The Message Window will show the report regarding the result of the operation.

PzlStudio ComponentAddedAsOriginalMSG.png

Open the project (if it is not opened) using the IDE and compile (build) it.

While the performing the operation the following situations may happen:

  1. If the original component added:
    1. 'If the new pzl-component added to the pzl-container doesn’t use other pzl-components,
      then you should accept all proposals from the IDE to add new packages to the project.
    2. If the new pzl-component added to the pzl-container uses some other pzl-components, which are not currently included to the pzl-container project, then you should refuse the adding such a new pzl-component to the project by the IDE.
      The inclusion of these pzl-components must be done using the Elementary PzlStudio only.
  2. If you add the pzl-component delegate (proxy) there should not be any problems, because of it is the particular case of the rule 1.1 described above.

Removing

It is recommended to perform the removing the pzl-component from the pzl-container using the Elementary PzlStudio. The manual performing this operation using the IDE may lead to braking some links in the project.

After the completion of the operation you will see the report regarding the results of the operation in the Message Window.

PzlStudio ComponentRemovedSuccessfulyMSG.png

Now you must come back to the IDE and open the pzl-container project (if it was not opened before).

It is recommended to make “Rebuild All” after the removing a pzl-component from the pzl-container.

The removing of the pzl-component may break some links in the project. It may happen if there are some invocations of the removed component from other classes of the given pzl-container. Strongly say you should not remove the pzl-component from the pzl-project. You should convert the status of the pzl-component to the Proxy status.

The conversion of the status will not be needed of you are making the synchronous removing of the pzl-components together will all classes (packages), which use it.

If there is no use of the removed component by the classes and packages of the given pzl-container project, then there should be no problems.

Changing the Status of the Pzl-Component

The pzl-component may have the status “Original” or it may be “Proxy”.

While adding the pzl-component to the pzl-project the status of the pzl-component is defined by the type of the operation performed (‘’’Add As Original’’’ or ‘’’Add As Proxy’’’).

Using the Elementary PzlStudio, you may change the status of the pzl-component from the “original” to “proxy” and back.

Converting to Proxy

Converting the status from the “original” to “proxy” may be done by pressing the button Convert To Proxy (Преобразовать в Proxy). You will see the report regarding the performing the operation.

PzlStudio ConvertOriginalToProxyMSG.png

Now you should go to the IDE and compile the project.

Converting to the Original

There is no special operation to convert the status of the pzl-component from the ‘proxy’ to the ‘original’. Performing the operation Add As Original, despite on the existence of the pzl-component in the project will change the status of the pzl-component to the “original” status. There will be the report in the Message Window:

PzlStudio ConvertProxyToOriginalMSG.png

Now you should go to the IDE and build the project.

References