The FIG. 1 contains the schematics, which are used to manufacture low quality lamps. For lamp worked at least same time , the current through the LED's set 50% of nominal. The current is not stabilized and the voltage spikes will increase the current above the norm, damaging the lamp. In the event of termination at least one of LEDs the lamp will not shine. In case the short circuit of one LEDs, the current of others increases and they all fail faster.
In the case of use ICs, electrical parameters is better, but the reliability is low due to the IC and the transistor operates in the heavy-duty and damaged by voltage spikes and the a small driver board heat from LED . The price is higher because in addition to IC and transistor used ultrafast diode, special inductor with gap for LED and suppression inductor after the rectifier.
We shows a decent schematic, a bit more complex, but reliable. In comparison to the cost of 12-15 LEDs the cost of additional parts in production is not significantly greater, while providing greater reliability. High reliability because with increasing voltage the transistor is closed and voltage spikes even up to 500 volts are not harmed. The current of the LEDs is stabilized and the main voltage fluctuation do not change the current in LEDs. In the event of termination or closure of even 10 LEDs, the current of LEDs will remain unchanged, leading only to a decrease in brightness. Since the circuit is not isolated from the mains, it is necessary to connect them through residual current circuit breaker.
In case of using this scheme LEDs Optosupply OSW443Z4E1P, one should bear in mind that in spite of the proclaimed maximum current of 30 mA http://www.optosupply.com/UploadFile/PDF/osw443z4e1p.pdf they really only work for a long time at a current of 10 mA, while at 20 and even 15 mA in time cease to work, and some of them give an irritating blink while working. Apparently manufacturers made a mistake and want to stand out over competitors but suffer from it all - is undermined faith in the LEDs. In addition, they are sent LEDs in bulk and in a soft pack, cracks appear on this fragile glass case, poorly conducting heat from that time LED deteriorate.
This schematic allows you to convert unregulated lamp to adjustable influenced by ambient lighting. This is possible because if the number of LEDs is near to the LED drive voltage limit, then increasing the voltage on the transistor reduces the current through LEDs. Resistor is selected according to when the ambient light current decreases. Drawback scheme that photoresistors and transistors have spread in the parameters, so it's good to use a programmable microcontroller, for example Atmel ATtiny 13, the scheme will be later. Scheme on the one OA and the transistor will be sent to everyone for free.