Skip to main content
Software Engineering

Return to Answer

replaced http://programmers.stackexchange.com/ with https://softwareengineering.stackexchange.com/
Source Link

How about doing both? Have a "low level" (so to speak) API that exposes functions of the system and have another "layer" that exposes services that a client might want to do. This layer would use the necessary low level API's required but those are still exposed if the client wants them.

UPDATE: To also include some of the great points and comments made by others.

  1. Consider if the client is ever going to need to call one of the smaller API methods e.g. Is it feasible to call createUserProfile without also calling createUser? If not then don't expose that method. Thanks NoobsArePeople2 NoobsArePeople2

  2. A simple but excellent point. Key point with exposing something in an API - you can't ever unexpose it. Expose the minimum necessary to function and then expand rather than exposing everything and... well, then its naked and making changes can be embarrassing and awkward. Thanks MichaelT MichaelT

How about doing both? Have a "low level" (so to speak) API that exposes functions of the system and have another "layer" that exposes services that a client might want to do. This layer would use the necessary low level API's required but those are still exposed if the client wants them.

UPDATE: To also include some of the great points and comments made by others.

  1. Consider if the client is ever going to need to call one of the smaller API methods e.g. Is it feasible to call createUserProfile without also calling createUser? If not then don't expose that method. Thanks NoobsArePeople2

  2. A simple but excellent point. Key point with exposing something in an API - you can't ever unexpose it. Expose the minimum necessary to function and then expand rather than exposing everything and... well, then its naked and making changes can be embarrassing and awkward. Thanks MichaelT

How about doing both? Have a "low level" (so to speak) API that exposes functions of the system and have another "layer" that exposes services that a client might want to do. This layer would use the necessary low level API's required but those are still exposed if the client wants them.

UPDATE: To also include some of the great points and comments made by others.

  1. Consider if the client is ever going to need to call one of the smaller API methods e.g. Is it feasible to call createUserProfile without also calling createUser? If not then don't expose that method. Thanks NoobsArePeople2

  2. A simple but excellent point. Key point with exposing something in an API - you can't ever unexpose it. Expose the minimum necessary to function and then expand rather than exposing everything and... well, then its naked and making changes can be embarrassing and awkward. Thanks MichaelT

Added comments by others
Source Link
dreza
  • 3.5k
  • 4
  • 34
  • 39

How about doing both? Have a "low level" (so to speak) API that exposes functions of the system and have another "layer" that exposes services that a client might want to do. This layer would use the necessary low level API's required but those are still exposed if the client wants them.

UPDATE: To also include some of the great points and comments made by others.

  1. Consider if the client is ever going to need to call one of the smaller API methods e.g. Is it feasible to call createUserProfile without also calling createUser? If not then don't expose that method. Thanks NoobsArePeople2

  2. A simple but excellent point. Key point with exposing something in an API - you can't ever unexpose it. Expose the minimum necessary to function and then expand rather than exposing everything and... well, then its naked and making changes can be embarrassing and awkward. Thanks MichaelT

How about doing both? Have a "low level" (so to speak) API that exposes functions of the system and have another "layer" that exposes services that a client might want to do. This layer would use the necessary low level API's required but those are still exposed if the client wants them.

How about doing both? Have a "low level" (so to speak) API that exposes functions of the system and have another "layer" that exposes services that a client might want to do. This layer would use the necessary low level API's required but those are still exposed if the client wants them.

UPDATE: To also include some of the great points and comments made by others.

  1. Consider if the client is ever going to need to call one of the smaller API methods e.g. Is it feasible to call createUserProfile without also calling createUser? If not then don't expose that method. Thanks NoobsArePeople2

  2. A simple but excellent point. Key point with exposing something in an API - you can't ever unexpose it. Expose the minimum necessary to function and then expand rather than exposing everything and... well, then its naked and making changes can be embarrassing and awkward. Thanks MichaelT

Source Link
dreza
  • 3.5k
  • 4
  • 34
  • 39

How about doing both? Have a "low level" (so to speak) API that exposes functions of the system and have another "layer" that exposes services that a client might want to do. This layer would use the necessary low level API's required but those are still exposed if the client wants them.

AltStyle によって変換されたページ (->オリジナル) /