Daily Learning Flashcards
what is a magic method
dunder methods in a class
what is __repr__
special/magic method that can be used to print the unambiguous sprint representation of a class)
what is __str__
special/magic method that can be used to return the string representation of a class
what is state?
a system is stateful if it remembers previous interactions with the system and stores them
In information technology and computer science, a system is described as stateful if it is designed to remember preceding events or user interactions;[1] the remembered information is called the state of the system.
what is a callable object?
an object that implements the __call__ method
what objects aren’t callable?
the instance of a class, unless it implements the __call__ special method
What are the main components of platform-tools
Command
Domain
Providers
What is command?
Commands are the UI level of platform-helper.
No business logic exists in commands
Each command has an associated domain
CLI arguments for a command are pulled in via click and passed to the domain along with any dependencies
what is a domain
domains are where the business logic for a given command lives
each Domain is a class
what is a provider
Common/reusable emements should be implemented in a provider
providers are groups of similar logic that are linked by the resource/tool/think they use rather than the result of what their action is
e.g., I have a METHOD that lists THING from the THING-SERVICE AWS using a boto3 client
This method is not specific to the DOMAIN so it should go into the THING-SERVICE provider
List the platform-helper commands
ommands:
application (Deprecated) [DEPRECATED] Application metrics.
codebase Codebase commands.
conduit Opens a shell for a given addon_name create a conduit…
config Perform actions on configuration files.
copilot
database Commands to copy data between databases.
environment Commands affecting environments.
generate Generate deployment pipeline configuration files and…
notify Send Slack notifications
pipeline Pipeline commands.
secrets
version Contains subcommands for getting version information about…