如何创建框架? [英] How frameworks are created?

查看:79
本文介绍了如何创建框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了许多框架,用于软件开发,测试,分布式系统等.但是这些框架是如何创建的呢?专家是否分析框架的性能,可用性和易用性?因此,如果我找到了一种轻松实现复杂任务的方法,可以将其称为框架吗?

I have come across a lots of frameworks, for software development, testing, distributed systems, etc. But how are these frameworks created? Do the experts analyze the performance, usability and easiness of the framework? So if I find some way of doing a complex task in an easy manner, can it be called as a framework?

推荐答案

这是一个非常广泛的问题.让我尝试分解并逐步回答...

This is a very broad question. Let me try to break this down and answer it in stages...

为什么要创建框架?

原因,或更确切地说,目标很多.一些关键的事情是:

The reasons, or more precisely, objectives are many. Some of the key things are:

  1. 缩短开发时间
  2. 简化对项目团队成员的工作分配.
  3. 简化项目的测试和集成.
  4. 简化调试
  5. 标准化整个团队/项目的开发习惯和技术

谁制造它们?

同样,答案很广泛.我构建它们,您构建它们,我们许多人都这样做.但是,并非所有人都将我们的框架公开.有些人决定使其成为一个开源项目.为什么?也许要为此获得资金并继续使其更好.或者只是为了赚钱.

Again, the answer is broad. I build them, you build them, many of us do. But not all of us make our frameworks public. Some decide to make it an open source project. Why? Perhaps to get funding for it and continue to make it better. Or just for the cash in it.

已经说过,并不是每个人都应该建立一个框架.例如,在决定使php成为框架"之前,我已经使用PHP进行了7年以上的编码,并且从事过多个项目.然后,我意识到某些事情是以某种方式定期完成的,因此我决定将它们置于某些功能中.然后进入模板区域,最后我意识到那里有更好的模板(例如:CodeIgniter).

Having said that, not everyone should build a framework. For example, before I decided to make my php 'framework', I had over 7 years of coding with PHP and I had worked on several projects. Then I realised that certain things were regularly done in a certain way and I decided to put them into some functions. Then it moved on to the templating areas and finally I realised that there were better ones out there (eg: CodeIgniter).

如果我们每个人都建立自己的框架,那么我们在招募新员工方面可能会遇到困难.我们需要花更多的时间培训员工,而不是在项目上花更多的时间.这就是为什么我(个人)更喜欢标准的东西.

If each of us were to build our own frameworks, we may have difficulty with new recruits. We'd have to spend more time training staff than using them on projects. This is why I (personally) prefer going for something standard.

我们在所有项目中都使用它们吗?

Do we use them on all projects?

当然不是.有时任务非常琐碎.一个人可以只写几页代码并完成它.因此,如果它不能证明需要一个框架,那就不要使用它.

Certainly not. Sometimes the tasks are very trivial. A single person may just write a few pages of code and finish it. So if it does not justify the need for a framework, don't use one.

您自己的框架...

是的,如果您像我一开始提到的那样构建一种简单的方式来构建项目,则可以将其称为框架.但是它必须在广泛的项目中都可以使用.否则,它们只是功能的集合.

Yes, if you build an easy way of building projects like I've mentioned in the beginning, you could call it a framework. But it's got to be useable over a wide class of projects. Otherwise they'd just be a collection of functions.

一旦有了这些,您就可以决定将其用于您的项目,甚至将其公开.

And once you have this in place, you may decide to use it for your projects and even make them public.

我使用的一些常见框架...

Some common frameworks I use...

PHP:CodeIgniter

PHP: CodeIgniter

帕斯卡:拉撒路

C ++:代码块

希望这会有所帮助:)

这篇关于如何创建框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆