[Shellweb-main] =?GB2312?B?UmU6IFtTaGVsbHdlYi1tYWluXSBSZTogW1NoZWxsd2ViLW1haW5dIA==?= =?GB2312?B?Um
Status: Alpha
Brought to you by:
alexe_cn
|
From: fayland <fa...@gm...> - 2005-12-28 07:07:32
|
我觉得当成一个模块来对待比较好。就像我刚才讲的那样
lib/ShellWeb.pm
lib/ShellWeb/Layout/Pre.pm
lib/ShellWeb/Layout/Img.pm
lib/ShellWeb/Fecth/HTTPS.pm
lib/ShellWeb/Fecth/FTP.pm
.. etc.
这样还有个好处,测试 t/* 文件的时候运行
prove -l t/*
就能用 Test::Harness 来测试文件并且显示报告了。
我觉的现在最重要的不是代码,而是文件目录结构。一个程序的流程。
弄好了直接往里面填代码就可以了。
ale...@gm... wrote:
> 赞同OO写法。
> OO写法确实在后期十分的实用。
> 大家已经看到现在的代码了,:),抱歉,只是想快速的先写个设计原型出来。
> 对于项目的基本设计大家有些了解了吗?
> 在filelist.cn文件中我稍微阐述了一点。讨论一下?
>
> 在 05-12-28,fayland<fa...@gm...> 写道:
>
>> yes, 同感。
>> OO 将很容易将功能拆分。
>>
>> Anthony WU wrote:
>>
>>> 我比建使用 OO 的法
>>> 例如
>>> ShellWeb/socket.pm
>>> ShellWeb/socket/ssl.pm
>>> ShellWeb/html.pm
>>> ShellWeb/html/css.pm
>>> ShellWeb/layout.pm
>>> ShellWeb/layout/link.pm
>>> ShellWeb/layout/image.pm
>>>
>>> 使用
>>> ====
>>> my $imageout = new ShellWeb::layout::image ('
>>> http://aaa.aaa.com/aaa.jpeg') <http://aaa.aaa.com/aaa.jpeg%27%29>;
>>> ====
>>> package ShellWeb::layout::image
>>> sub new
>>> {
>>> my $get = new ShellWeb::socket (.....);
>>> }
>>>
>>>
>>> 的方法,做修改及外加、用比方便
>>>
>>>
>>> 2005/12/28, fayland <fa...@gm... <mailto:fa...@gm...>>:
>>>
>>> 我认为我们还是以模块的形式组织文件结构比较好。
>>> 我的建议是:
>>> lib/ShellWeb.pm
>>> lib/ShellWeb/xxx.pm
>>> 这样可以将其打包给 CPAN
>>> 而运行的话可以考虑 shellweb.pl 这么写:
>>>
>>> #!/usr/bin/perl
>>>
>>> use strict;
>>> use ShellWeb;
>>>
>>> ShellWeb->run(param => '1'); # 参数
>>>
>>> 1;
>>>
>>> 而目前这种 file_queue.pm 比较 ugly.
>>> 如果诸位认同我的意见的话,我可以用 module-starter 来建立这个结构。
>>>
>>> --
>>> Fayland Lam // http://www.fayland.org/
>>>
>>>
>>>
>>>
>>> -------------------------------------------------------
>>> This SF.net email is sponsored by: Splunk Inc. Do you grep through
>>> log files
>>> for problems? Stop! Download the new AJAX search engine that makes
>>> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
>>> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
>>> <http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click>
>>>
>>>
>>>
>> --
>> Fayland Lam // http://www.fayland.org/
>>
>>
>>
>>
>> -------------------------------------------------------
>> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
>> for problems? Stop! Download the new AJAX search engine that makes
>> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
>> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
>>
>>
>>
>
>
> --
> +--------------------------------------------+
> |By Alexe (http://www.alexe.cn)|
> +--------------------------------------------+
> NY薜'
> 蕈㈣!kC 濉蘩@^^j!2㈥澧辨,悍a{,H蛟4i(辟堍o'锃Yhr'庄:rX===
--
Fayland Lam // http://www.fayland.org/
|