These are different Form content types defined by W3C. If you want to send simple text/ ASCII data, then x-www-form-urlencoded will work. This is the default. But if you have to send non-ASCII text or large binary data, the form-data is for that. link
Service is a very loaded term in computer programming that has all sorts of different meanings and connotations depending on the context you are using it in.
A Service in Domain Driven Design is simply a stateless object that performs an action.
For example, an AuthenticationService would have the sole responsibility for authenticating users into your application.
An important characteristic of a Service is that it should not have state. So the AuthenticationService should be used to perform an action such as authenticate() but it should not hold any references to stateful data such as the current authenticated users. link
I think it’s better to say that dependency injection relies on composition, but is a method for achieving Inversion of Control
This better highlights what’s special about it - that the object doesn’t control the construction of its parts. For example if you had a BlogPost object that has a reference to a DataBase object, in composition it would be perfectly OK to construct that DataBase instance yourself, in your BlogPost constructor - but this is a no-no in dependency injection; you’re supposed to get the DataBase instance from the outside (as a parameter or something).
Why is this important? In general this helps you decouple your code, but in particular it is useful for e.g. unit tests - to continue the above example, the unit test could pass in a mock database object, so that without changing a single line of code all database calls can now be intercepted and redirected to memory or something (and test data can be supplied, again without ever touching a network connection, which could make your test fail for reasons that have nothing to do with your code, like somebody tripping over the cable). link
there is 3 different concept in programming:
- association
- aggregation
- composition this link may help better to understand.
is-a ==> inheritance has-a ==> association
association has two types: - aggregation - composition
aggregation: weak association composition: strong association
Learning PHP: link