编程范式,设计模式和应用架构之间的区别? [英] Difference between Programming Paradigm, Design Pattern and Application Architecture?

查看:725
本文介绍了编程范式,设计模式和应用架构之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我来自非编程背景,经常遇到编程范式,设计模式和应用程序架构这些术语。虽然我觉得我对这些术语的含义有一个模糊的认识,但是如果有人能澄清每一个问题,它们与另一个有什么不同,以及这些概念如何适用于目标C,我将不胜感激。

I'm from a non-programming background and have often come across the terms like Programming Paradigm, Design Pattern and Application Architecture. Although I think I have a vague understanding of what these terms mean, I'd appreciate if someone could clarify what each is, how it is different from the other and how these concepts apply to Objective C.

推荐答案

编程范例:像功能编程程序编程面向对象编程。编程范例和使用它们的语言告诉代码如何写入。例如,在面向对象编程中,代码被划分为类(有时是语言特性,有时不是(例如javascript)),并且通常支持继承和某种类型的多态。程序员创建类,然后创建类(即对象)的实例来执行程序的操作。在功能语言中,计算机上的状态变化非常受语言本身的控制。函数是第一类对象,虽然不是所有的语言都是函数的第一类对象是函数式编程语言(这个话题是一个很好的辩论)。使用功能语言编写的代码涉及大量嵌套函数,程序的几乎每一步都是新函数调用。对于程序编程,C程序和bash脚本是很好的例子,你只需说做第1步,做第2步等等,而不用创建类和

Programming Paradigm: Something like "Functional Programming", "Procedural Programming", and "Object Oriented Programming". The programming paradigm and the languages that use them inform how the code gets written. For example, in Object Oriented programming the code is divided up into classes (sometimes a language feature, sometimes not (e.g. javascript)), and typically supports inheritance and some type of polymorphism. The programmer creates the classes, and then instances of the classes (i.e. the objects) to carry out the operation of the program. In functional languages, the state changes on the computer are very heavily controlled by the language itself. Functions are first class objects, although not all languages where functions are first class objects are functional programming language (this topic is one of good debate). Code written with a functional languages involves lots of nested functions, almost every step of the program is new function invocation. For procedural programming, C programs and bash scripting are good examples, you just say do step 1, do step 2, etc, without creating classes and whatnot.

设计模式:设计模式是可以用任何语言实现的有用的抽象。这是做事情的模式。像你想要实现的一系列步骤一样,你可以使用'复合'和'命令'模式,使你的实现更通用。将模式作为一个通用的方法来解决常见编码任务的模板。

Design Pattern: A design pattern is a useful abstraction that can be implemented in any language. It is a "pattern" for doing things. Like if you have a bunch of steps you want to implement, you might use the 'composite' and 'command' patterns so make your implementation more generic. Think of a pattern as an established template for solving a common coding task in a generic way.

应用程序体系结构:考虑如何构建系统来做事情。因此,对于Web应用程序,架构可能涉及负载均衡器后面的x个网关,它们异步地馈送队列。消息由在z计算机上运行的y进程拾取,其中包含1个主数据库和一个备用从站。应用程序体系结构涉及选择平台,语言,使用的框架。这与软件体系结构不同,这更重要的是如何在软件堆栈中实际实现该程序。

Application Architecture: Takes into consideration how you build a system to do stuff. So, for a web application, the architecture might involve x number of gateways behind a load balancer, that asynchronously feed queues. Messages are picked up by y processes running on z machines, with 1 primary db and a backup slave. Application architecture involves choosing the platform, languages, frameworks used. This is different than software architecture, which speaks more to how to actually implement the program given the software stack.

这篇关于编程范式,设计模式和应用架构之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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