Skip to content

Instantly share code, notes, and snippets.

@isaacssemugenyi
Last active December 3, 2023 06:43
Show Gist options
  • Save isaacssemugenyi/85f4f1e4593b6dcefa53840297c8252e to your computer and use it in GitHub Desktop.
Save isaacssemugenyi/85f4f1e4593b6dcefa53840297c8252e to your computer and use it in GitHub Desktop.

A Readme file representing how a facade pattern can be used

import some-thirdparty-library.*;

class Upload {

  String uploadMyFile(String apiKey, MultipartFile file){

    // We meed to first authenticate
    Auth authenticatedUser = validateUser(apiKey);

    // Check for if user is authenticated now
    ProcessedFile processedFile = processFile(file);

    //We get a processed file
    UploadedObject uploadedFile = uploadFile(proccessedFile);

    // Check for successful upload and if successfull, get the metadata
    // Assume the upload was successful
    FileMetadata fileMetadata = getFileMetadata(uploadedFile.getMetadata());

    return fileMetadata.getMessage();
   }
 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment