When to use which CAF service?
CAF projects can be built using the CAS perspective of the NWDS. A CAS project provides user with three types of services Application Services, Entity Services and External Services. Now, Basic idea for CAF projects is to build new applications utilizing the existing functionality in SAP or Non-SAP systems. Functionality from these systems can be exposed through BAPI or RFC as in SAP systems or web service as in other Non-SAP systems. This functionality can be brought in to a CAF project through external services. Even Enterprise services can be imported as an external service in a CAS Project. Then since you are creating your own custom application you will probably need to store some application specific data or object that makes sense in your application. Now here you feel the need of persistence. To cater this need CAF provides its Entity services. You can choose to persist your Business objects (each one mapped to one entity service) in local storage. CAS provides option to persist this data on a remote database if you do not wish to use local persistence. Now at this point you have imported all your external services and you have all your objects ready with you. But that’s not all you still feel need of some place to put business logic that would perform your application specific processing over you business objects and external services. You need the operations that would process your local objects after validation and modify them based on certain criteria over and above the basic system generated CRUD (Create, Read, Update, and Delete) methods of entity services. Did I tell you about them? Oh yes, that’s true CAS generates all CRUD methods for you. Also you would need operations which will access the external services and use them together with business objects and application specific logic. Here fits the application services that provide single interface to the user to access your composite application. External services in CAF project can be either wrapped in entity services or can directly be used through application services. This design decision is based on the scenario. When you are exposing business objects in SAP or Non-SAP systems through external services for CRUD kind of operations or even a subset or superset, then it makes sense to wrap these services in an entity service and map the corresponding methods. Else you should directly use application service to access the external services. At the end, I would just like to state for Java guys, that Entity services are some what analogous to EJB’s Entity Beans and application service is analogous to EJB’s Session Beans. All this is just with flavor of SAP.