Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RealWorld examples #12

Open
alfonsograziano opened this issue Jul 15, 2022 · 8 comments
Open

RealWorld examples #12

alfonsograziano opened this issue Jul 15, 2022 · 8 comments

Comments

@alfonsograziano
Copy link
Contributor

Hello, I would like to work on RealWorld examples for this repository (this is my first contribution to a project). Before to start I would really appreciate an ok from the maintainers and, if needed, advices. I will create the PR with examples in the next days :)

@neochief
Copy link
Contributor

Hi!

Sure, you're more than welcome! However, before you write any code, I would appreciate it if you could send a simple outline for each pattern and describe in a few words what would be the scenario for the example. I'd like to avoid the standard "imagine that you have a pizza and pizza toppings" examples and instead have the actual Real World TypeScript stuff. Thanks a lot!

@alfonsograziano
Copy link
Contributor Author

alfonsograziano commented Jul 20, 2022

Great idea!

I think it is better to work in "chunks" so I'll explain my idea for some patterns and I will wait for you review in order to write the working code :)

@alfonsograziano
Copy link
Contributor Author

Facade => The facade class expose a method "processUserData" (for Analytics) and uses 3 objects (Extractor, Transformer, Loader). The extractor get the data (from disk, remote api call, db etc), the transformer execute operations on the data and the Loader load the data. In my real example I will read a .log file with user signup and create in output a CSV file with the number of users registered per day (for example: 23/05/2022, 12).

@alfonsograziano
Copy link
Contributor Author

Strategy => A simple file upload processor. You have different strategies (like LocalUpload, S3, GCloudStorage). The client code will upload the file using a context

@alfonsograziano
Copy link
Contributor Author

Decorator => Add telemetry to API call. The decorator decorates the controller and log the request info and response time

@alfonsograziano
Copy link
Contributor Author

Factory => Create different types of player based on the provided user token

@neochief
Copy link
Contributor

Looks great so far!

@neochief
Copy link
Contributor

neochief commented Aug 2, 2022

Hi, Alfonso! This is just a follow-up, please let me know if you need anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants