Hi Pufferman, welcome to the forum! There's a wealth of information here at your fingertips and a great bunch of people to get to know.
You can do it either way. When you take the CHL class the instructor will have everything you need to send to DPS. If you apply online you must use the forms DPS sends you, as you'll already be in their system, and have a PIN assigned to you.
When you apply online you are actually applying for the forms packet to be sent to you....the same forms the instructor will hand out in class. The only difference is that you will have already filled out the form with your name,address, residence & work history, etc.