views:

55

answers:

2

Programming by contracts is a modern (?) trend in .net.

But what about libraries/frameworks for code contracts in php?

What do you think about applicability of this paradigm for php?

Googling of "code contracts php" gave nothing to me.

UPD:

for those who didn't even try to google for unknown term ("coding by contracts") and voted for close: please, read this article http://en.wikipedia.org/wiki/Design_by_contract

A: 

I am guessing that WikiPedia mentions Component Oriented Software Methodologies. In such methodologies methods are referred as Public Interfaces or Contracts of the component.

A contract is a 'kind-of-agreement' between the provider of the service and the client. In a component environment where systems are composed by components by various creators/vendors the 'construction' of your contracts is of critical importance.

In such environments, think of your component as a black-box that MUST be able to efficiently co-exist and collaborate with other components that other people have created, thus forming a larger system or sub-system of a larger system, etc.

For more details i can suggest you google for the 'Component Software - Beyond Component Oriented Programming' book, for all things related to component oriented programming.

andreas
Well, what about php implementation of such kind of workaround/framework? I expect something similar to http://research.microsoft.com/en-us/projects/contracts/
zerkms
I am not aware of a php implementation and I would not expect php creators to implement such a thing.
andreas
Hehe, it can be a 3rd party library of course ;-)
zerkms
A: 

Well, seems like nothing exists in php for the programming by contracts.

zerkms