Quello che faccio di solito nelle mie applicazioni è che creo tutti i miei servizi / dao / repo / client usando i metodi di fabbrica class Service: def init(self, db): self._db = db @classmethod def from_env(cls): return cls(db=PostgresDatabase.from_env()) E quando creo un'app, lo faccio service = Service.from_env() ciò che …
We use cookies and other tracking technologies to improve your browsing experience on our website,
to show you personalized content and targeted ads, to analyze our website traffic,
and to understand where our visitors are coming from.
By continuing, you consent to our use of cookies and other tracking technologies and
affirm you're at least 16 years old or have consent from a parent or guardian.