2
Contributors
2
Replies
20
Views
3 Years
Discussion Span
Last Post by diafol
2

I like the introduction here but I'm afraid traits will most likely be used like global functions. Most applications I've seen so far are dubious, more play than proper design. Traits come near multiple inheritance, and there's good reason most languages do not support it. It gets messy quickly. Personally I'd have much rather had them implementing proper interfaces.

Edited by pritaeas

0

Fair points. I was just looking at whether I'd be able to give classes DB methods without having to pass the object (DI) or creating a singleton/static. I didn't really think it through that well I suppose. Ah well, at least my string-manipulation functions don't need to be base-classed or DI'd any more :)
Thanks for the link and your views.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.