Fellow devs - if you have a "repository"-like object that only has a single implementation do you do this? If so - why?pic.twitter.com/GRogvFc7qu
I've got a need to make things - apps, websites or dad jokes. Sometimes they work. Currently building & growing @thankbox to $10k/month and beyond.
Możesz dodawać lokalizację do Twoich Tweetów, jak miasto czy konkretne miejsce, z sieci lub innych aplikacji. W każdej chwili możesz usunąć historię lokalizacji swoich Tweetów. Dowiedz się więcej
Umieść tego Tweeta na swojej stronie, kopiując poniższy kod. Dowiedz się więcej
Umieść ten film na swojej stronie, kopiując poniższy kod. Dowiedz się więcej
Umieszczając treści z Twittera na Twojej stronie internetowej lub w Twojej aplikacji, potwierdzasz, że akceptujesz naszą Umowę dla programistów i Zasady współpracy z programistami.
| Kraj | Kod | Dla klientów |
|---|---|---|
| Stany Zjednoczone | 40404 | (dowolny) |
| Kanada | 21212 | (dowolny) |
| Wielka Brytania | 86444 | Vodafone, Orange, 3, O2 |
| Brazylia | 40404 | Nextel, TIM |
| Haiti | 40404 | Digicel, Voila |
| Irlandia | 51210 | Vodafone, O2 |
| Indie | 53000 | Bharti Airtel, Videocon, Reliance |
| Indonezja | 89887 | AXIS, 3, Telkomsel, Indosat, XL Axiata |
| Włochy | 4880804 | Wind |
| 3424486444 | Vodafone | |
| » Zobacz krótkie kody SMS dla innych państw | ||
Na osi czas spędzisz najwięcej czasu, czytając wiadomości o sprawach, które Cię interesują.
Najedź kursorem na zdjęcie profilowe i kliknij przycisk Obserwowany, by przestać obserwować dowolne konto.
Gdy widzisz Tweeta, którego lubisz, dotknij ikony serca — jego autor dowie się, że jego wpis przypadł Ci do gustu.
Najszybszym sposobem na udostępnienie czyjegoś Tweeta jest podanie go dalej. Dotknij ikony, by to zrobić.
Powiedz, co myślisz o Tweecie, odpowiadając na niego. Znajdź temat dyskusji, który Cię interesuje, i dołącz do rozmowy.
Bądź zawsze na bieżąco i obserwuj publiczne dyskusje.
Obserwuj więcej kont, by widzieć więcej wiadomości na tematy, które Cię interesują.
Zobacz najnowsze rozmowy na dowolny temat.
Bądź na bieżąco z najciekawszymi historiami.
Fellow devs - if you have a "repository"-like object that only has a single implementation do you do this? If so - why?pic.twitter.com/GRogvFc7qu
In my opinion it's much better to avoid the needless interface and just do this instead. Before anyone mentions tests and mocking - good mocking frameworks can mock classes no problem - you don't need an interface, so what else is it?pic.twitter.com/oS1pA6ddlq
I think it's when people split layers into presentation, domain and data. The interface would go in a domain module while the implementation would go in a data module. Domain layer cannot depend on data layer, so it interacts with the interface in the business logic.
But....why. It just seems like creating class explosion for no reason other than to play tribute to a sense of clean code. Is just having the class without interface in your Data layer and using it directly wrong? What problem does it cause?
Yeah...clean...it works well for some projects... Because of that dependency arrow/onion architecture (business logic is the innermost layer and cannot not point/depend on an outer layer). If each layer is a different Grade module, this also avoids a circular dependency I guess?
Additionally helps in build time. When the data impl changes the ABI of the interface would not be changed. So the domain can avoid recompilation (compile avoidance) and all modules above it.
Is the build time saving (which I honestly don't think would be a lot if you're keeping your repos lean) really worth the extra indirection complexity?
May I know what do you mean by lean? We don't follow domain -> data, we call them bridge modules that only has interfaces and serves as contract for other modules/features. Implementation is injected by DI. Additionally I prefer fakes instead of mocks and interfaces help.
I understand this requirement for multi-module apps - they wouldn't work otherwise. By lean I mean that each of the repositories (or however they are called) is responsible for one thing so doesn't have a huge implementation.
Twitter jest przeciążony lub wystąpił chwilowy problem. Spróbuj ponownie lub sprawdź status Twittera, aby uzyskać więcej informacji.