This article discusses the positioning of website programmers as web standards become more popular and how to work with designers to develop website projects that comply with web standards.
This article is suitable for programmers whose division of labor is not very clear under the traditional TABLE layout.
1: Learn web standards to make your work easier.
Web standards are the general trend, so as a website programmer. You have to be brainwashed and learn web standards. To re-recognize html tags and to understand how to make the program output the code required by the page.
Dim oHtml
set rs=server.createobject("adodb.recordset")
Sql = "select top 10 id,Title From tbl_News order by id desc"
rs.open sql,conn,1,1
oHtml="<ul>"
do while not rs.eof
oHtml=oHtml & "<li><a href=""shownews.asp?id=" & rs("id") & """ title=""" & rs("title") & """>" & rs("title") & "</a></li>"
rs.movenext
loop
oHtml=oHtml & "</ul>"
rs.close
set rs=nothing
response.write(oHtml)
If it is a traditional TABLE layout, programmers will have to write a lot more HTML code. They need to write TABLE, judge when to output TR to break the line, and add an IMG in front of each news item to output a small icon. , use a program to control the length of the output title. All work requires the page code to be written before programmers can write this program.
For programmers, you should regard web standards as a kind of gospel. You should read them like a Bible to understand what the page code actually requires. Once you understand it, you will find out. You are much more relaxed than before. Because web standards focus on the separation of performance and content, the program is only responsible for content data. From now on, you no longer need to think about how to use program code to control alternate row color changing, how to output a row in several columns, etc. What you need to do is to output the most direct content to the page, without any decoration.
Of course, if you are developing in .net, you can be more thorough. You can completely focus on building objects, class libraries, data access, etc., and just provide methods to the presentation layer. The example below is from a project I worked on before and should be of some reference value.
2: Website programmers, don’t let HTML tags block your vision.
If you feel that you really hate cumbersome HTML tags, and your learning direction is not in the presentation layer of the website, then say goodbye to HTML tags completely.
I used to work in a traditional desktop software development company, and none of the programmers knew HTML. When the website project was tight, I had to ask them to help. We will take a few examples that come with Visual Studio .Net 2003 and analyze them carefully. According to the object-oriented structured layered development model, we can also cooperate very well. Take the development of news module as an example:
Step one: The website programmer can design the database based on demand analysis, and you can be responsible for building tables and writing stored procedures. Programmers are very familiar with this kind of thing.
Step 2: Define the object. Objectify website information, such as:
Public Class News
Protected _id As Integer
Protected _typeId As Integer
Protected _title As String
Protected _author As String
Protected _original As String
Protected _updateTime As DateTime
Protected _content As String
Protected _clickCount As Integer
Public Property Id() As Integer
Get
Return _id
End Get
Set(ByVal Value As Integer)
_id = Value
End Set
End Property
Public Property TypeId() As Integer
Get
Return_typeId
End Get
Set(ByVal Value As Integer)
_typeId = Value
End Set
End Property
Public Property Title() As String
End Property
Public Property Author() As String
End Property
Public Property original() As String
End Property
Public Property UpdateTime() As DateTime
End Property
Public Property Content() As String
End Property
Public Property ClickCount() As Integer
End Property
End Class
Just like this, try to objectify all the tables in the website. Then define the record set related to the object. The above definition is a single news object, and then define a news record set.
Public Class News
...
End Class
Step 3: Define a set of public data access methods.
Define some public methods for manipulating the database and executing stored procedures.
Step 4: Write the object-based method layer. like:
Public Function ReadNews(ByVal ID As Integer) As News
End Function
What the function returns is a news object. Depending on the functional needs, some related functions are generally defined, such as:
'Read the news list
Public Function ReadNewss(ByVal newsType As eNewsType, ByVal nCount As Integer) As News
End Function
'Add a news
Public Function InsertNews(ByVal n As News) As Integer
End Function
'Update a news
Public Function UpdateNews(ByVal n As News) As Integer
End Function
delete a news
Public Function DeleteNews(ByVal ID As Integer) As Integer
End Function
In this way, website development can be divided into object layer, data access layer, method layer and presentation layer. The programmer only needs to provide the methods required by the presentation layer. In this way, when the presentation layer needs to display the news list, the page designer only needs to use the Repeater control in .net, as shown in the following code:
<asp:Repeater ID="topNewsList" runat="server" >
<HeaderTemplate>
<ul>
</HeaderTemplate>
<ItemTemplate>
<li><a href="shownews.asp?id=<%#Container.DataItem("id")%>"><%#Container.DataItem("title")%></a></li>
</ItemTemplate>
<FooterTemplate>
</ul>
</FooterTemplate>
</asp:Repeater>
In the program code of the presentation layer, we only need to add:
topNewsList.DataSource = New facade.newsFacade().ReadNewss(eNewsType, newsCount)
In this case, programmers can basically be completely separated from HTML. And in this case, members of the entire project team can work in parallel. It can significantly improve the development efficiency of the entire project. Moreover, the rise of the web 2.0 model has put forward higher requirements for back-end database development. For websites such as Douban and 365Kit, the background database mining work is very complicated. So today, when the division of labor is clear, in addition to HTML code, there are many other more important tasks waiting for website programmers to do.
3: User-centered design is inseparable from front-end development engineers.
If you feel a little reluctant to leave the familiar HTML code, it doesn't matter. Simply push yourself to the forefront of web technology. Be a front-end development engineer closely related to product design.