Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Injectable and Embeddable?

I have heard about both terms Injectable and Embeddable many times, but I am not getting actual meaning of it.

Please help me to understand both clearly.

like image 243
NewDirection Avatar asked Oct 20 '22 10:10

NewDirection


2 Answers

Injectable means that something can be created and added to the main script while the script is running.

Embeddable means something can be added to a script or code before running it i.e before compilation or running of the script.

For better understanding lets take a website with a textbox as a context. Now, In the textbox, suppose its very basic one. So, I can add a javascript into the textbox and when I will submit, it will run my JS script. This way, I am injecting my own script into the main page.

Now, suppose, I add an Iframe of another website to the HTML file of my website. In this way, when the website will be viewed, it contains the iframe. In this way, the Iframe is embedded to the website.

like image 195
amulya349 Avatar answered Oct 22 '22 23:10

amulya349


Injectable means that the object can be created and injected at run time. This is a hint to the compiler that this object will be managed outside the scope of the compilation and can be used at runtime to determine if the object was intended to be injected.

Embeddable means that the object can be serialized and stored in a column instead of as a separate table when the containing object is persisted. That also implies the lifetime of the embedded object is the same as the lifetime of the containing object.

like image 20
Zagrev Avatar answered Oct 22 '22 22:10

Zagrev