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?
问题:
回答1:
This is a very broad question. Let me try to break this down and answer it in stages...
Why are frameworks created?
The reasons, or more precisely, objectives are many. Some of the key things are:
- Cut down development time
- Simplify work allocation to team members on the project.
- Simplify testing and integration of the project.
- Simplify debugging
- Standardise development habits and techniques across the team/project
Who builds them?
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.
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.
Your own framework...
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
Pascal: Lazarus
C++: Code Blocks
Hope this helps :)