Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Why is "to access components using the interface component selector" is not recommended?

pradeep3811
Explorer
0 Likes
943

According to the sap help, it says "It is possible to access components using the interface component selector, but it is not recommended." Can anyone help me understand why is this not recommended. Below is the snippet.

2 REPLIES 2
Read only

FredericGirod
Active Contributor
878

For a pure Object Oriented point of view:

In the first case the instance of your object are using an interface and stay in the "contract" manage by the interface

In the second case, your instance doesn't follow any interface, you have create an instance using directly the Class. You could access all the methods proposed by all the related interfaces .... it is the jungle!

In Oo concept, all class should have one or several interfaces, and instance creation must always use interface. (and you should not have public method / data available directly in the class)

Read only

Sandra_Rossi
Active Contributor
0 Likes
878

According to the SAP help... because it's uselessly complex