ATmega328 programming in the final circuit

Hi,
i have a little doubt. Is it possible to program the ATmega328 microcontroller (or a generic ATmel micro) with the ISP connector (MISO, MOSI, etc..) in a final circuit board togheter with the other electronics components, or i had to remove the micro from the board and program it separately?

Thanks

This is called ICP In Circuit Programming, and you can do it so long as your programmer can waggle those pins. This is usually possible if those pins are used as outputs and only connected to other inputs.

If the pins are used as inputs, that is connected to an output of another device then you have to make sure that the other device's output can be over ridden, tri stated or in some other way disabled. One way is to have a removable link.

Thanks very much.