Attaching a light fixture without a box
There are instance where this is possible and legal, such as bathroom vanity bar type lights with an integral and complete back plate. Other than that a box is absolutely mandatory.

Here is a good example. Imagine these fixtures flush against the wall.