auraphp / Aura.Cli_Project

The skeleton for a CLI project.
BSD 2-Clause "Simplified" License
14 stars 2 forks source link

add final keyword to core classes #10

Closed cordoval closed 10 years ago

cordoval commented 10 years ago

could we consider adding the final keyword to prevent people wrongly extending the core classes via inheritance? it will be in line with auraphp decoupling practice mindset

harikt commented 10 years ago

@cordoval I am against adding final class. I am recalling doctrine did once and later removed it from the core.

If people think they need to extend, let them do.

cordoval commented 10 years ago

it is to encourage best practice. Doctrine did it and it made it loose again because lack of maturity (back then of course)perhaps cc @ocramius can tell better. Some frameworks like laravel give those loose options, but i think is degrading to the education with good practices that repos/maintainers should give to their audience. We are not after the market are we? I like aura because it is precisely different :blush: :+1:

Ocramius commented 10 years ago

We removed final only to allow mocking: if you implement all the API only from interfaces, then final is perfectly ok

cordoval commented 10 years ago

i see, so we are on an ideal situation in auraphp project, because we can just plug if any missing interface and start finalizing the classes on core. :+1: @Ocramius you rock!

Ocramius commented 10 years ago

You cannot add final if not in a major release though: it's a massive bc break

cordoval commented 10 years ago

i think 2.0 or 2.1 are a good fit for doing that bc change, and i think the final (no pun intended) word is on @pmjones's court side

harikt commented 10 years ago

@cordoval the problem is 2.0.0 is already out :+1: . So ... :-) .

harikt commented 10 years ago

Oh i c. I am looking at the project level. Then is on beta. Sorry for the confusion.

cordoval commented 10 years ago

no, i am at the core level, my comment includes 2.1

pmjones commented 10 years ago

While I understand the "best practices" part, I am against using final on the Aura classes. I reserve the right to change my mind later. ;-)

cordoval commented 10 years ago

I am patient @pmjones :blush: one of these days