Skip to content

Instantly share code, notes, and snippets.

@tuler
Last active August 21, 2023 22:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuler/587195cfd9f01fd117a1457236860702 to your computer and use it in GitHub Desktop.
Save tuler/587195cfd9f01fd117a1457236860702 to your computer and use it in GitHub Desktop.
Factories and interfaces
interface IShape {}
class Shape implements IShape {}
// Option A
interface IShapeFactory {
create(): Shape;
}
// Option B
interface IShapeFactory {
create(): IShape;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment