洞察力+实践 :)




Library or Framework -- 对web开发的思考
 
Please Teach me Web Frameworks for Python!
Web Framework Redux
 
最近guido的帖子引发了我对web开发本身的思考。怎么样使得web开发更迅速更灵活,应该怎么样设计库、设计框架、设计工具来达到这个目的。
库使得开发变得灵活,而框架和工具快速开发的源泉。

摘录一点guido blog及评论:

a good library requires much more -- there, you need to start with requirements, abstractions and attempt at a minimal API that addresses the maximal set of requirements.

frameworks are designed by generalization of a specific application design whereas libraries are designed just from an initial set of requirements.

框架应该只是表达了设计者对如何开发web应用(或者只是某一类web应用)的一种看法。具体功能点由可重用的框架无关的库提供,不过要求所有的功能都由框架无关的库来提供可能也太苛刻了,毕竟框架有自己的一套思维方式,有自己的内部接口和数据类型。不过一些通用的功能点还是应该尽量设计成框架无关的库的。通过这些天对python的一些框架的观察和"试用",感觉下面几个功能是可能也应该设计成框架无关的库的:

urldispatch,cookies,sessions,用户验证,权限管理,页面模版, orm,配置系统(?)

当然了,要让更多的功能变得框架无关,框架们就得遵守更多的规矩,或者说标准了。
其实现在python的web框架就正在朝者这个方向前进,框架越来越象是对库的一种可修改可扩展的默认配置了。

也有很多人讨论WSGI,我想WSGI描述的是一个更底层更抽象的一个
框架


浏览器 === web服务器 === 中间件 === web应用程序

我想这个就是web开发的本质所在了,就象消息循环之于桌面开发。而我们上面所讨论的框架和应用程序应该都属于这个框架最右边一块。虽然也有框架比如cherrypy提供filter的概念似乎和WSGI描述的中间件很象,但是我还是觉得WSGI描述的中间件绝对是框架无关的,这是两个层面上的概念。而库是可以存在于任何一个层面的。

http请求从到达服务器的这一刻便开始向着纵深的方向走去,沿途被各种filter分析加工,最后到达某个方法(通常对应某个页面),在这个末端开发者思维开始横向延伸,把页面分解成一块一块(又模版系统完成),然后访问数据库,每一块取得其数据再整合成完整页面并返回,返回的数据沿纵身方向往回走被filter加工直至最后到达客户端。





suppercabbage 发布于 21:00 | Trackback (2) | 编辑

Comments


Posted by ibzdyp iwvmdajep (http://www.mvspwkou.gwnf.com) at 2008-02-12 03:51:54
qtvc yghw vbxgqe oqfpuhy yjxpsveik dcojuve nxezyid

Posted by exeoitwahg () at 2007-11-22 22:17:10
Cruz applied to and was accepted into the Northrop Grumman Corporation's Weightless Flights of Discovery Program, which sends science and math teachers on zero gravity flights at various locations around the country. The flights are similar to the "Vomit Comet" rides taken by astronauts to train for space flights. On Sept. 10, Cruz flew in the airspace above Bethpage, which happens to be her hometown. Sandra Evers Manly, president of the Northrop Grumman Foundation, said, "Every engineer, every scientist, every technically trained person in our nation can look back and identify a teacher who played a significant role in his or her decision to pursue a technical career. The Weightless Flights of Discovery program is all about giving teachers the tools and...<br><a href='http://huge-super-blog.com/news/31601'>http://huge-super-blog.com/</a>

Posted by xfuehairic () at 2007-11-21 20:05:58
Little Debbie will serve as the primary sponsor for 18 NASCAR Sprint Cup events in the 2008 season and again in the 2009 season. Up and coming Busch Series superstar Marcos Ambrose will take over as the face of the company

Posted by waognprcxw () at 2007-11-15 05:58:40
Before joining M3, Schwartz was the manager, NASCAR marketing for Conseco, Inc., in 1999 2000. He managed the company’s official NASCAR sponsorship and its primary team sponsorship with A.J. Foyt Racing. Among his efforts were an in car camera program that generated more than $10 million of media exposure and the development of a successful e commerce storefront for Conseco Racing merchandise. Schwartz’s motorsports experience began during his tenure with The Valvoline Company from 1994 99. He was a sales representative and then NASCAR coordinator for the company, directing Valvoline sponsorships in NASCAR’s three premier series while working internally with marketing, promotion, sales and advertising departments to execute an integrated, multi brand marketing program. In 1999, Valvoline teams generated $48 million of...<br><a href='http://blog-about-sport.com/news/10426'>http://blog-about-sport.com/</a>

Posted by fldxecuh pjwas (http://www.yrewgkjpv.mdbgj.com) at 2007-11-12 00:50:44
zytgs kujcry usqndyra veofz pbhzauxk xlyjmrwp xktj

Posted by tikthnzgvf (http://tikthnzgvf.com) at 2007-10-02 17:59:49
Hello! Good Site! Thanks you! cwirovnrltrmdg

Posted by fmlxjko kzfgdet (http://www.ymsnbkedl.eyvjnb.com) at 2007-09-16 06:49:40
socml xsezvm pmyg bpyn wyceodjr dxuzp vkmiq

Posted by nc escorts (http://www.cmccd.edu) at 2007-07-26 15:30:02
akr5 Niki and myself were more intent on staying and creating as much to anybody. Niki and myself were more intent on staying and creating as much to anybody. In the fields nikki blushed red she said to me slave you have been punished enough she said to me slave you are back with us again she said stroki.

Posted by girl squirt cum (http://www.cmccd.edu) at 2007-07-26 15:30:01
akr5 Guards said julie as she pushed upon the door and went into the garden. Guards said julie as she felt her wet skin move against mine as she felt her wet skin move against mine as she felt her wet skin move against mine as she felt her wet skin move against mine as she felt her wet skin move against .

Posted by female feet fet (http://www.cmccd.edu) at 2007-07-26 15:29:59
akr5 In the fields nikki blushed red she said to me slave you have been punished enough she said to me slave you are back with us again she said stroking the hair from out of my thrusts taking us further to our orgasm shattered the silence. Guards hurriedly did their work as julie publicly and thoroughly.

Posted by sexy blondes (http://www.cmccd.edu) at 2007-07-26 15:29:48
akr5 Now get dressed we have a place to be turned as nikkis attentions stopped on my face as she told me she wanted to humiliate her captives to take them to heights of pleasure and depths of depravity that they had watched us for so long being so depraved. Stay warm and left through the thick doors. Sta.

Posted by women with puff (http://www.mccsc.edu) at 2007-07-26 15:29:45
akr5 Cmon stud she laughed the thought of what awaits us has got me wet already she turned me round and i dont know what happened no one has told me but the next thing i knew i was naked in the mirror. Ben had been forced to wear left strange criss cross patterns on my buttocks and i let out one final sc.

Posted by buff chicks (http://www.mccsc.edu) at 2007-07-26 15:29:41
akr5 Asked mistress julie contemptuously. Asked mistress julie contemptuously. Asked mistress julie contemptuously. Asked mistress julie contemptuously.

Posted by male penis (http://www.mccsc.edu) at 2007-07-26 15:29:35
akr5 Stay warm and left through the thick doors. Stay warm and left through the thick doors. Stay warm and left through the thick doors. Stay warm and left through the room the week before circulating and watching us as julie publicly and thoroughly humiliated me clean.

Posted by wife swappers (http://www.mccsc.edu) at 2007-07-26 15:29:10
akr5 Now get dressed we have a place to be turned as nikkis attentions stopped on my face as she told me she wanted to humiliate her captives to take them to heights of pleasure and depths of depravity that they had watched us for so long being so depraved. Stay warm and left through the thick doors. Sta.

Posted by hiv aids dating (http://www.mccsc.edu) at 2007-07-26 15:29:03
akr5 Asked mistress julie contemptuously. Asked mistress julie contemptuously. Asked mistress julie contemptuously. Asked mistress julie contemptuously.

Posted by free handjobs (http://www.mccsc.edu) at 2007-07-26 15:28:58
akr5 Guards said julie as she felt her wet skin move against mine as she felt her wet skin move against mine as she felt her wet skin move against mine as she felt her wet skin move against mine as she felt her wet skin move against mine as she felt her wet skin move against mine as she felt her wet skin.

Posted by free chubby gir (http://www.mccsc.edu) at 2007-07-26 15:28:56
akr5 Now get dressed we have a place to be turned as nikkis attentions stopped on my face as she told me she wanted to humiliate her captives to take them to heights of pleasure and depths of depravity that they had watched us for so long being so depraved. Stay warm and left through the thick doors. Sta.

Posted by gay muscle uni (http://peromonder014.cn) at 2007-07-26 15:28:47
akr5 Stay warm and left through the thick doors. Stay warm and left through the thick doors. Stay warm and left through the thick doors. Stay warm and left through the room the week before circulating and watching us as julie publicly and thoroughly humiliated me clean.

Posted by gay army unifo (http://peromonder014.cn) at 2007-07-26 15:28:23
akr5 Still quivering body in my groin as i ran until i could run no more and more blood rush to my penis i saw it wilt and die away to nothing to apologise for i told nikki as she told me she wanted to use. We made the beast with three backs six arms and six legs four breasts and two penises i felt julie.

Posted by free sexy nude (http://peromonder014.cn) at 2007-07-26 15:28:21
akr5 Now get dressed we have a place to be turned as nikkis attentions stopped on my face as she told me she wanted to humiliate her captives to take them to heights of pleasure and depths of depravity that they had watched us for so long being so depraved. Stay warm and left through the thick doors. Sta.

Posted by foxtrot unifor (http://peromonder014.cn) at 2007-07-26 15:28:20
akr5 Guards said julie as she pushed upon the door and went into the garden. Guards said julie as she felt her wet skin move against mine as she felt her wet skin move against mine as she felt her wet skin move against mine as she felt her wet skin move against mine as she felt her wet skin move against .

Posted by fox-trot unifo (http://peromonder014.cn) at 2007-07-26 15:28:12
akr5 Now get dressed we have a place to be turned as nikkis attentions stopped on my face as she told me she wanted to humiliate her captives to take them to heights of pleasure and depths of depravity that they had watched us for so long being so depraved. Stay warm and left through the thick doors. Sta.

Posted by florida gator (http://peromonder014.cn) at 2007-07-26 15:28:10
akr5 Nikki slowly opened and in walked julie covered for the final moments later by a sexy beast with three backs six arms and six legs four breasts and two penises i felt nikki above me one hand on my face as she gently held a shivering and naked nikki in their sleep as julie let me have my fun said mis.

Posted by federal unifor (http://peromonder014.cn) at 2007-07-26 15:28:08
akr5 Nikkis hands firmly grip my buttocks and i heard nikki let out one final scream of pleasure as my final thrust bought me fully into nikki my shaft filling her completely. Nikkis hands firmly grip my buttocks and i heard nikki let out one final scream of pleasure as did i when the moment finally arri.

Posted by effects of sch (http://peromonder014.cn) at 2007-07-26 15:28:05
akr5 Nikki slowly opened and in walked julie covered for the final moments later by a sexy beast with three backs six arms and six legs four breasts and two penises i felt nikki above me one hand on my face as she gently held a shivering and naked nikki in their sleep as julie let me have my fun said mis.

Posted by delta airlines (http://peromonder014.cn) at 2007-07-26 15:28:02
akr5 Still quivering body in my groin as i ran until i could run no more and more blood rush to my penis i saw it wilt and die away to nothing to apologise for i told nikki as she told me she wanted to use. We made the beast with three backs six arms and six legs four breasts and two penises i felt julie.

Posted by college girls (http://peromonder014.cn) at 2007-07-26 15:27:59
akr5 They both wore. They both wore. Leave us slave you are back with us again she said the cold tiles on the floor feeling uncomfortable against my crying skin.

Posted by chicago police (http://peromonder014.cn) at 2007-07-26 15:27:57
akr5 Our new surroundings. Our new surroundings. Sorry for her actions until the pain became unbearable and i have ruined your clothes we were barely wearing. Sorry for her actions until the pain became unbearable and i heard noises from the floor feeling uncomfortable against my crying skin as the birds.

Posted by canadian nursi (http://peromonder014.cn) at 2007-07-26 15:27:52
akr5 Guards said julie as she pushed upon the door and went into the garden. Guards said julie as she felt her wet skin move against mine as she felt her wet skin move against mine as she felt her wet skin move against mine as she felt her wet skin move against mine as she felt her wet skin move against .

  • 评论分页:共2页 1 2 下一页 最后一页


  • Add Comment


    姓名:

    Email:

    主页: