![]() ![]() So technically (see lazy loading) all runtime dependencies are also compile-time dependencies, but not vice-versa, as shown in the previous section. On the other hand, those dependencies that are required for the execution of your code are known as Runtime dependencies. The Wise Developer: ‘Compile time Dependencies are required by the compiler for producing byte code. Mohan: ‘Is there a difference between runtime and compile-time dependencies? I thought both are the same.’ Question: Compile-time vs Runtime Dependency In other words, If your abstractions are like a pie, then ISP helps you in defining the correct slices, and LSP ensures that the promises made by those slices are honored by subtypes. ISP focuses on defining cohesive base types so that there is no such case where module A depends on module B at compile-time, but not at run time. ![]() But there is one key difference, LSP focuses on honoring the promises of the base type so that abstract class users should never have to know about which subclass is being used to serve their requests. The Wise Developer: ‘Good Catch Mohan! both LSP and ISP are complementary ideas. Mohan: ‘We have already discussed Liskov Substitution Principle (LSP), how is it different from ISP ?’ This unfortunate coupling can be avoided by depending on logically cohesive interfaces instead of fat interfaces.ĪMA: Ask me Anything with The Wise Developer Solution using Interface Segregation Principle C Martin coined Interface Segregation Principle (ISP) which states,Ĭlients Should Not be Forced to depend on Interfaces that they do not use. If a client depends on modules that it does not use, it can lead to complex dependencies in code. This means that any failure in the hardware module can impact LEDRemote or AudioRemote classes, even if there is no run time dependency between them. But this change will cause a recompilation of all the Remote classes, due to the introduction of a new compile-time dependency.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |