What is the difference between static and dynamic invocation?

Mediation in middleware

Asked by Kim Hutchinson on May 3rd, 2012 @ 5:15 p.m.
Sign in to answer this question

1 answer to this question

The most relevant answers filter to the top...

 

Let's take the example of an credit-check application accessing census data to verify that a particular person lives where they claim to live. Let's call credit-check application as A and let's call the census API as B.

If A has complete knowledge of what B expects in terms of inputs, then the invocation can be static i.e., if A is aware that all B needs is a tuple in the form of {first name, last name, date of birth}, then A can just send that information and B will return the address of the person in question. Now, if there are changes to the interface and B expects an additional parameter, A's invocation,as is, will not work. Static invocations are compile-time paradigms and hence will work as long as the interfaces do not change. Languages such as C, C++ support static invocations only.

On the other hand, if A knows B is likely to change, then A can use dynamic invocation to discover all the information it needs at run-time. Examples include Java and C# reflections.

 

 

Answered by Joshua Conner on May 9th, 2012 @ 4:07 p.m.