.CEN Framework
Nope that isn't the real name either. It has come to my attention that their is no framework in place at the company that I work for, which is odd since a site with over 200 areas to it should have some sort of framework. So this is what I proposed for our registration and will propose for the site in general. Not sure how it will be excepted, but I already have people adopting the concepts that make up the Framework.
It goes like this. When dealing with the presentation layer (What the guest sees) there are four key components. I will deal with how Flash and other plug ins later.
* Mark up
* Style
* Scripting
* Logic (Not always the case since not all sites or pages have a back end)
Mark up and style will often be refereed to as the presentation.
Mark up
At this point you should be using XHTML Strict. This is a very structured mark up language and when done properly adheres to a very strict architecture. Now when you declare the doc-type and your page is not up to code, most of the time it might work, but you will most likely get plagued with unknown breaks in your page on the Gecko browsers. Mark up should only be used for structure, never style. Get rid of all your font, center, bold, and italic tags. Now when dealing with bold and italic you might see an increase of code, however to ensure that your site can be read by a screen reader use STRONG, italics, hey W3C.org says it is deprecated, so remove them. Trust me on this one. Strong is the only exception, we need that to put emphasis on words. But I digress. Structure, that is all mark up should be used for. Tables should only be used for tabular data. You can use div and style to simulate the affect that tables give with a lot less spacer gifs and confusing layout. Remember you want your pages to be easy to update and not to be rebuilt every time someone wants to make a change to it. Again, trust me.
Every element on your page should have a class or at least an id associated with it. These are two key attributes to your elements. Plus it will make getting rid of document.write's much easier. Yes, we see to stop using document.writes, but that is another entry. Remember the goals of this framework. To make your site flexible and easy to modify. Also this will allow your site to be parsed through an XML parser in the event that you want to syndicate your pages. Your page without style should be plain, void of any style, except of course for strong. Screen readers don't care how the page looks, it just wants access to your content.
Style
If you don't know what CSS (Cascading Style Sheets) are perhaps it is time for you to find a new line of work. If you know what they are but don't know how to use them then get a book, read some sites and learn it. You are useless to us if you don't.
Style (CSS) is what you use to make your site look pretty. This is how you should add font color, type, size, background, positioning, layout. You can use CSS to give you the same affect that many people use tables for. ESPN is a good example of a site that has abandoned tables except for when, you guessed it, they use tabular data. For most of us, use the float option in CSS. You will be amazed on the power of style. Putting all that crap in the body tag, nope use the body {} class. Now the fun part is to add IDs (remember we use id's on everything but head, body, html) to your CSS include. [style] what does this do? This allows you to use JavaScript to change your CSS. Yes, you can change the whole look and feel of your site by altering the CSS. Hmm, how can we use this? When you want to make a page for printing. You can turn off your chrome, your ad's (unless you want them printed too) center the page, change the font size, you name it. Also if you want to start supporting handheld devices or console browsing, adjustments need to be made. Do it this way. And again, trust me on this one.
Scripting
First you need to develop an API for your site. Now you can't standardize all of the JavaScript, some is tailored for that site only. That shouldn't stop you from centralizing one area and one standard for scripts. All functions appear in the head of the document. Now developers will tell you it makes it easier for them to remove that chunk of code in which it is associated with. Hmm. Nope, take you an extra 30 seconds to remove it from the head. Not going to fly. Plus in my vision, people would alphabetize there functions. Just makes it easier to find stuff. Remember, the goal of this is to build a healthy site that can grow and evolve over time. Can't do that if you are painting yourself in the corner by bringing bad practices and ideas to your page. Separate the script from the structure. Now the API concept is that you have set of standard functions that can span over many sites. One file, one format, one interface that will allow for the functionality will grow.
An example would be our detection. You draw in the script. Call CreateInterface() you can put an optional argument in there to override the default landing page. And you have DetectFlash(). simple. Well what if the person doesn't want to redirect the page, they just want to see if you have flash or not. Simple, tell the function that if the first argument is true return a boolean and don't redirect. foo=DetectFlash(true) What if you want to detect for 7 not 6. The default is 6, by having a default, when the site upgrades it will cover a majority of the pages. foo=DetectFlash(true,"7"). I will go into the flashwriter some other time. For now you get the idea. I can modify and even rewrite the script from the ground up and as long as I have a function called CreateInterface with the argument and DetectFlash with the arguments then I can do what ever I want with the script. A standard implementation with a standard API golden. You will also want to invest in an API to handle style adjustments until all browsers get on the same page.
Logic
This is your server side functionality. JSP PHP ASP all work on the back end. We will get more in depth later on how to properly use serverside technology. This is where the most development is. Which is odd sense they put some much time in pushing that off to the client. The server side code should be extracted from your structure. They should be made into components and your finished product should be a group of modular pieces that fit nicely together.
Going to San Francisco tomorrow so I will cover more later.
It goes like this. When dealing with the presentation layer (What the guest sees) there are four key components. I will deal with how Flash and other plug ins later.
* Mark up
* Style
* Scripting
* Logic (Not always the case since not all sites or pages have a back end)
Mark up and style will often be refereed to as the presentation.
Mark up
At this point you should be using XHTML Strict. This is a very structured mark up language and when done properly adheres to a very strict architecture. Now when you declare the doc-type and your page is not up to code, most of the time it might work, but you will most likely get plagued with unknown breaks in your page on the Gecko browsers. Mark up should only be used for structure, never style. Get rid of all your font, center, bold, and italic tags. Now when dealing with bold and italic you might see an increase of code, however to ensure that your site can be read by a screen reader use STRONG, italics, hey W3C.org says it is deprecated, so remove them. Trust me on this one. Strong is the only exception, we need that to put emphasis on words. But I digress. Structure, that is all mark up should be used for. Tables should only be used for tabular data. You can use div and style to simulate the affect that tables give with a lot less spacer gifs and confusing layout. Remember you want your pages to be easy to update and not to be rebuilt every time someone wants to make a change to it. Again, trust me.
Every element on your page should have a class or at least an id associated with it. These are two key attributes to your elements. Plus it will make getting rid of document.write's much easier. Yes, we see to stop using document.writes, but that is another entry. Remember the goals of this framework. To make your site flexible and easy to modify. Also this will allow your site to be parsed through an XML parser in the event that you want to syndicate your pages. Your page without style should be plain, void of any style, except of course for strong. Screen readers don't care how the page looks, it just wants access to your content.
Style
If you don't know what CSS (Cascading Style Sheets) are perhaps it is time for you to find a new line of work. If you know what they are but don't know how to use them then get a book, read some sites and learn it. You are useless to us if you don't.
Style (CSS) is what you use to make your site look pretty. This is how you should add font color, type, size, background, positioning, layout. You can use CSS to give you the same affect that many people use tables for. ESPN is a good example of a site that has abandoned tables except for when, you guessed it, they use tabular data. For most of us, use the float option in CSS. You will be amazed on the power of style. Putting all that crap in the body tag, nope use the body {} class. Now the fun part is to add IDs (remember we use id's on everything but head, body, html) to your CSS include. [style] what does this do? This allows you to use JavaScript to change your CSS. Yes, you can change the whole look and feel of your site by altering the CSS. Hmm, how can we use this? When you want to make a page for printing. You can turn off your chrome, your ad's (unless you want them printed too) center the page, change the font size, you name it. Also if you want to start supporting handheld devices or console browsing, adjustments need to be made. Do it this way. And again, trust me on this one.
Scripting
First you need to develop an API for your site. Now you can't standardize all of the JavaScript, some is tailored for that site only. That shouldn't stop you from centralizing one area and one standard for scripts. All functions appear in the head of the document. Now developers will tell you it makes it easier for them to remove that chunk of code in which it is associated with. Hmm. Nope, take you an extra 30 seconds to remove it from the head. Not going to fly. Plus in my vision, people would alphabetize there functions. Just makes it easier to find stuff. Remember, the goal of this is to build a healthy site that can grow and evolve over time. Can't do that if you are painting yourself in the corner by bringing bad practices and ideas to your page. Separate the script from the structure. Now the API concept is that you have set of standard functions that can span over many sites. One file, one format, one interface that will allow for the functionality will grow.
An example would be our detection. You draw in the script. Call CreateInterface() you can put an optional argument in there to override the default landing page. And you have DetectFlash(). simple. Well what if the person doesn't want to redirect the page, they just want to see if you have flash or not. Simple, tell the function that if the first argument is true return a boolean and don't redirect. foo=DetectFlash(true) What if you want to detect for 7 not 6. The default is 6, by having a default, when the site upgrades it will cover a majority of the pages. foo=DetectFlash(true,"7"). I will go into the flashwriter some other time. For now you get the idea. I can modify and even rewrite the script from the ground up and as long as I have a function called CreateInterface with the argument and DetectFlash with the arguments then I can do what ever I want with the script. A standard implementation with a standard API golden. You will also want to invest in an API to handle style adjustments until all browsers get on the same page.
Logic
This is your server side functionality. JSP PHP ASP all work on the back end. We will get more in depth later on how to properly use serverside technology. This is where the most development is. Which is odd sense they put some much time in pushing that off to the client. The server side code should be extracted from your structure. They should be made into components and your finished product should be a group of modular pieces that fit nicely together.
Going to San Francisco tomorrow so I will cover more later.

