5

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.

David Passmore
  • 6,089
  • 4
  • 46
  • 70
NewDirection
  • 116
  • 10
  • 6
    Some context will help get the definition as both words can be used in a variety of ways. Maybe a sentence you have seen them used in. –  Jun 05 '15 at 09:56

2 Answers2

2

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.

amulya349
  • 1,210
  • 2
  • 17
  • 26
1

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.

Zagrev
  • 2,000
  • 11
  • 8