Forum > Beginners

Interface delegation [SOLVED]

(1/4) > >>

pascal111:
ما معنى الـ  Interface delegation أو ما هي فكرته أو فائدته فلقد ترجمتُ هذه الوثيقة https://www.freepascal.org/docs-html/current/ref/refse48.html#x101-1250007.5 ولم تصلني الفكرة بعد؟

google translate:

"What is the meaning of Interface delegation or what is its idea or its usefulness I have translated this document https://www.freepascal.org/docs-html/current/ref/refse48.html#x101-1250007.5 The idea did not reach me yet?"

jamie:
I see that no one answered you on this one...

I am not a interface expert but I can maybe shed some light on it..

looking at the reference url you pointed out, the Delegate is like a remote class that implements the interface + methods and the "implements" instructs the compiler what interfaces it has.

 Basically its just a property pointer to another class interface..

 in the end, you still need to create the actual method bodies for P1 and P2 and in this case it would be for the TDelegateClass




pascal111:

--- Quote from: jamie on May 29, 2021, 02:26:40 am ---I see that no one answered you on this one...

I am not a interface expert but I can maybe shed some light on it..

looking at the reference url you pointed out, the Delegate is like a remote class that implements the interface + methods and the "implements" instructs the compiler what interfaces it has.

 Basically its just a property pointer to another class interface..

 in the end, you still need to create the actual method bodies for P1 and P2 and in this case it would be for the TDelegateClass

--- End quote ---

أشكُركـ على مُحاولتكـ! تخيّل أنّني أُريد شرح الـ Interface delegation للمبرمجين المُبتدئين السعوديين وأُريدهم أنْ يفهموا الموضوع بالضبط كما هو كي يستطيعوا تطبيقه فيما يُريدون ولكنّني للأسف لستُ أفهم الموضوع بالضبط فكيف سأشرحه وكيف سيُنشئون برامجهم ،بالتالي سيُضطرون للإعتماد على مصادر مثلاً السوريين والتي لن تُعطيهم فهم الموضوع فيُضطروا للإعتماد على السوريين في إنشاء البرامج بالطريقة التي يُقررها السوريون ﻷنّ السوريون أخذوا المعلومات الصحيحة من المصادر الأمريكيّة ومنعوها عن السعوديين ليجعلوا السعوديين دائماً في حاجةٍ إليهم.

google translate:

"Thank you for "your" trying! Imagine that I want to explain the Interface delegation to the novice Saudi programmers and I want them to understand the topic exactly as it is so that they can apply it in what they want, but unfortunately I do not understand the exact topic, how will I explain it and how they will create their programs, thus they will have to rely on sources such as the Syrians, which will not give them an understanding of the subject, so the Syrians"Sadui people" will have to rely on them, in creating programs in the manner decided by the Syrians, because the Syrians took the correct information from American sources and prevented it from the Saudis in order to make the Saudis always in need of them."

jamie:
interfaces is the closes you will come to having multiple inheritance for classes, at least for the object pascal language as it stands now.

with interfaces you can chain a series of interfaces within a class definition that are all accessible at the same inheritance level.

Interfaces work very much the same way as does classes but are handled differently in the background.

one note with interfaces is that methods that are declared in the interface are like "Abstract" declared methods in a class, meaning you don't need to implement the actual body of the procedure and the compiler will allow you to get away with it.
 
  But in short the term Delegate in this case would be like having a TBitmap as a property and field within a class, just think of the Tbitmap as a interface elsewhere but its really a class , etc..

There are two different types supported too..


pascal111:

--- Quote from: jamie on May 29, 2021, 03:00:27 pm ---interfaces is the closes you will come to having multiple inheritance for classes, at least for the object pascal language as it stands now.

with interfaces you can chain a series of interfaces within a class definition that are all accessible at the same inheritance level.

Interfaces work very much the same way as does classes but are handled differently in the background.

one note with interfaces is that methods that are declared in the interface are like "Abstract" declared methods in a class, meaning you don't need to implement the actual body of the procedure and the compiler will allow you to get away with it.
 
  But in short the term Delegate in this case would be like having a TBitmap as a property and field within a class, just think of the Tbitmap as a interface elsewhere but its really a class , etc..

There are two different types supported too..

--- End quote ---

إلى الآن لم تقُل شيئاً سيّئا ولكن المعلومات الجيّدة التي تقولها لا تتناسب مع الإنطباع الذي يؤخذ عنكـ ،ﻷنّ الصورة التي تؤخذ عنكـ أقل قدراً من المعرفة التي تتكلّم بها مثل أرقام الموبايل الخاطئة.

google translate:

"So far "For now", you have not said anything bad, but the good information you say does not match the impression that is taken on you, because the picture that is taken of you is less than the knowledge that you speak, such as the wrong mobile numbers."

Navigation

[0] Message Index

[#] Next page

Go to full version