:: Topo :: doCoding :: Linguagens de Programação
Programming Concepts
Este documento procura manter referências importantes sobre os conceitos mais habituais em programação.
Referências
É importante perceber primeiro o que é Paradigma de Programação: Um paradigma de programação fornece (e determina) a visão que o programador possui sobre a estruturação e execução do programa. Assim como diferentes grupos em engenharia de software propõem diferentes metodologias, diferentes linguagens de programação propõem diferentes paradigmas de programação. Algumas linguagens foram desenvolvidas para suportar um paradigma específico (Smalltalk e Java suportam o paradigma de orientação a objetos enquanto Haskell e Scheme suportam o paradigma funcional), enquanto outras linguagens suportam múltiplos paradigmas (como o LISP, Perl, Python, C++ e Oz). Os paradigmas de programação são muitas vezes diferenciados pelas técnicas de programação que proíbem ou permitem. Por exemplo, a programação estruturada não permite o uso de goto. Esse é um dos motivos pelo qual novos paradigmas são considerados mais rígidos que estilos tradicionais. Apesar disso, evitar certos tipos de técnicas pode facilitar a prova de conceito de um sistema, podendo até mesmo facilitar o desenvolvimento de algoritmos.
Object-Oriented
- OOAD - Object-Oriented Analysis and Design is a software engineering approach that models a system as a group of interacting objects. Each object represents some entity of interest in the system being modeled, and is characterised by its class, its state (data elements), and its behavior. Various models can be created to show the static structure, dynamic behavior, and run-time deployment of these collaborating objects. There are a number of different notations for representing these models, such as the Unified Modeling Language (UML). Object-oriented analysis (OOA) applies object-modeling techniques to analyze the functional requirements for a system. Object-oriented design (OOD) elaborates the analysis models to produce implementation specifications. OOA focuses on what the system does, OOD on how the system does it.
- OOD - Object-Oriented Design is part of OO methodology and it forces programmers to think in terms of objects, rather than procedures, when they plan their code. An object contains encapsulated data and procedures grouped together to represent an entity. The 'object interface', how the object can be interacted, is also defined. An object-oriented program is described by the interaction of these objects. Object-oriented design is the discipline of defining the objects and their interactions to solve a problem that was identified and documented during object-oriented analysis.
- OOP - Object-Oriented Programming is a programming paradigm that uses “objects” and their interactions to design applications and computer programs. Programming techniques may include features such as:
- modularity;
- inheritance - inheritance is a way to form new classes (instances of which are called objects) using classes that have already been defined. The new classes, known as derived classes, take over (or inherit) attributes and behavior of the pre-existing classes, which are referred to as base classes (or ancestor classes). It is intended to help reuse existing code with little or no modification.
- encapsulation - the principle of information hiding is the hiding of design decisions in a computer program that are most likely to change, thus protecting other parts of the program from change if the design decision is changed. The protection involves providing a stable interface which shields the remainder of the program from the implementation (the details that are most likely to change).
- abstraction - abstraction is a mechanism and practice to reduce and factor out details so that one can focus on a few concepts at a time. In object-oriented programming theory, abstraction is the facility to define objects that represent abstract “actors” that can perform work, report on and change their state, and “communicate” with other objects in the system.
- polymorphism - polymorphism is a programming language feature that allows values of different data types to be handled using a uniform interface. The concept of parametric polymorphism applies to both data types and functions. A function that can evaluate to or be applied to values of different types is known as a polymorphic function. A data type that can appear to be of a generalized type (e.g., a list with elements of arbitrary type) is designated polymorphic data type like the generalized type from which such specializations are made. More precisely, polymorphism is the ability of objects belonging to different types to respond to method calls of the same name, each one according to an appropriate type-specific behavior. The programmer (and the program) does not have to know the exact type of the object in advance, so this behavior can be implemented at run time (this is called late binding or dynamic binding).
- OOM - Object-Oriented Modeling is a modeling paradigm mainly used in computer programming. Prior to the rise of OOM, the dominant paradigm was functional programming, which emphasised the use of discreet reusable code blocks that could stand on their own, take variables, perform a function on them, and return values. The Object-Oriented paradigm assists the programmer to address the complexity of a problem domain by considering the problem not as a set of functions that can be performed but primarily as a set of related, interacting Objects. The modeling task then is specifying, for a specific context, those Objects (or the Class the Objects belongs to), their respective set of Properties and Methods, shared by all Objects members of the Class.