Académique Documents
Professionnel Documents
Culture Documents
[edit]Biography
Born in Taichung, Taiwan Peter Chen received a B.S. in electrical engineering in 1968 at
the National Taiwan University, and a Ph.D. in computer science/applied mathematics at
the Harvard University in 1973. From 1974 to 1978 Chen as Assistant Professor at MIT
Sloan School of Management. From 1978 to 1984 he was Professor at the University of
California, Los Angeles (UCLA Management School). Since 1983 Chen has held the
position of M. J. Foster Distinguished Chair Professor of Computer Science at Louisiana
State University.[1]
Chen has received several awards in the fields of Information Technology.[2] He received
the Data Resource Management Technology Award from the Data Administration
Management Association in New York City in 1990. In 1998, he was inducted as a Fellow of
theAssociation for Computing Machinery. He won the Achievement Award in Information
Management in 2000 from DAMA International. He was an inductee into the Data
Management Hall of Fame in 2000. He received the Stevens Award in Software Method
Innovation in 2001. In 2003, Dr. Chen received the IEEE Harry Goode Award at the IEEE-
CS Board of Governors meeting in San Diego. Dr. Chen was presented with the ACM/AAAI
Allen Newell Award at the ACM Banquet in San Diego in June 2003. Dr. Chen is also the
recipient of the Pan Wen-Yuan Outstanding Research Award in 2004.[3]
[edit]Work
[edit]Entity-Relationship Modeling
The Entity-Relationship Model model serves as the foundation of many systems analysis
and design methodologies, computer-aided software engineering (CASE) tools,
and repository systems. The ER Model is the basis for IBM's Repository Manager/MVS
and DEC's CDD/Plus.
Dr. Peter Chen's original paper[4] is commonly cited as the definitive reference for Entity
Relationship Modelling. Chen did not in fact invent the concept; the basic ideas appear in
earlier papers especially by practitioners, such as that by A. P. G. Brown.[5] However, Chen
did more than anyone to formalize and popularize the model, and to introduce it to the
academic literature.
The ER Model was adopted as the meta model ANSI Standard in Information Resource
Directory System (IRDS), and the ER approach has been ranked at the top methodology for
database design and one of the top methodologies in systems development by several
surveys of Fortune 500 companies.[6]
The hypertext concept, which makes the World Wide Web extremely popular, is very similar
to the main concept in the ER model. Dr. Chen is currently investigating this linkage as an
invited expert of several XML working groups of the World Wide Web Consortium (W3C).
The ER model also serves as the foundation of some of the recent work on Object-
oriented analysis and design methodologies andSemantic Web. The UML modeling
language has its roots in the ER model.
[edit]
manipulators
Stream manipulators
Manipulators are functions specifically designed to be used in conjunction with the insertion (<<) and
extraction (>>) operators on stream objects, for example:
cout << boolalpha;
They are still regular functions and can also be called as any other function using a stream object as
argument, for example:
boolalpha (cout);
Manipulators are used to change formatting parameters on streams and to insert or extract certain
special characters.
Input manipulators
ws Extract whitespaces (manipulator function)
Output manipulators
endl Insert newline and flush (manipulator function)
ends Insert null character (manipulator function)
flush Flush stream buffer (manipulator function)
Parameterized manipulators
These functions take parameters when used as manipulators. They require the explicit inclusion of the
header file <iomanip>.
The #define directive is typically used to associate meaningful identifiers with constants,
keywords, and commonly used statements or expressions. Identifiers that represent
constants are sometimes called "symbolic constants" or "manifest constants." Identifiers
that represent statements or expressions are called "macros." In this preprocessor
documentation, only the term "macro" is used.
When the name of the macro is recognized in the program source text or in the arguments
of certain other preprocessor commands, it is treated as a call to that macro. The macro
name is replaced by a copy of the macro body. If the macro accepts arguments, the actual
arguments following the macro name are substituted for formal parameters in the macro
body. The process of replacing a macro call with the processed copy of the body is called
"expansion" of the macro call.
In practical terms, there are two types of macros. "Object-like" macros take no arguments,
whereas "function-like" macros can be defined to accept arguments so that they look and
act like function calls. Because macros do not generate actual function calls, you can
sometimes make programs run faster by replacing function calls with macros. (In C++,
inline functions are often a preferred method.) However, macros can create problems if you
do not define and use them with care. You may have to use parentheses in macro definitions
with arguments to preserve the proper precedence in an expression. Also, macros may not
correctly handle expressions with side effects. See the getrandom example in The #define
Directive for more information.
Once you have defined a macro, you cannot redefine it to a different value without first
removing the original definition. However, you can redefine the macro with exactly the same
definition. Thus, the same definition can appear more than once in a program.
The #undef directive removes the definition of a macro. Once you have removed the
definition, you can redefine the macro to a different value. The #define Directive and The
#undef Directive discuss the #define and #undefdirectives, respectively.
n C++, all data types, including those defined by the user, can be declared const, and const-correctness
dictates that all objects should be declared as such unless they need to be modified. Such proactive use
of const makes values "easier to understand, track, and reason about,"[1] and it thus increases the
readability and comprehensibility of code and makes working in teams and maintaining code simpler
because it communicates information about a value's intended use.
References follow similar rules. A declaration of a const reference is redundant since references can
never be made to refer to another object:
int i = 42;
int const & refToConst = i; // OK
int & const constRef = i; // Error the "const" is redundant
Even more complicated declarations can result when using multidimensional arrays and references (or
pointers) to pointers; however, some have argued[citation needed] that these are confusing and error-prone and
that they therefore should generally be avoided or replaced with higher-level structures.
In order to take advantage of the design-by-contract strategy for user-defined types (structs and classes),
which can have methods as well as member data, the programmer must tag instance methods
as const if they don't modify the object's data members. Applying the const qualifier to instance
methods thus is an essential feature for const-correctness, and is not available in many other object-
oriented languages such as Java and C# or in Microsoft's C++/CLI or Managed Extensions for C++.
While const methods can be called by const and non-const objects alike, non-const methods can
only be invoked by non-const objects. The const modifier on an instance method applies to the object
pointed to by the "this" pointer, which is an implicit argument passed to all instance methods. Thus
having const methods is a way to apply const-correctness to the implicit "this" pointer argument just like
other arguments.
In the above code, the implicit "this" pointer to Set() has the type "C *const"; whereas the "this"
pointer to Get() has type "const C *const", indicating that the method cannot modify its object
through the "this" pointer.
Often the programmer will supply both a const and a non-const method with the same name (but
possibly quite different uses) in a class to accommodate both types of callers. Consider:
class MyArray
{
int data[100];
public:
int & Get(int i) { return data[i]; }
int const & Get(int i) const { return data[i]; }
};
The const-ness of the calling object determines which version of MyArray::Get() will be invoked and
thus whether or not the caller is given a reference with which he can manipulate or only observe the
private data in the object. The two methods technically have different signatures because their "this"
pointers have different types, allowing the compiler to choose the right one. (Returning a constreference
to an int, instead of merely returning the int by value, may be overkill in the second method, but the
same technique can be used for arbitrary types, as in the Standard Template Library.)
[edit]Loopholes to const-correctness
There are several loopholes to pure const-correctness in C and C++. They exist primarily for compatibility
with existing code.
The first, which applies only to C++, is the use of const_cast, which allows the programmer to strip
the const qualifier, making any object modifiable. The necessity of stripping the qualifier arises when
using existing code and libraries that cannot be modified but which are not const-correct. For instance,
consider this code:
// Prototype for a function which we cannot change but which
// we know does not modify the pointee passed in.
void LibraryFunc(int *ptr, int size);
However, any attempt to modify an object that is itself declared const by means of const_cast results
in undefined behavior according to the ISO C++ Standard. In the example above, if ptr references a
global, local, or member variable declared as const, or an object allocated on the heap via new const
int, the code is only correct if LibraryFunc really does not modify the value pointed to by ptr.
Another loophole applies both to C and C++. Specifically, the languages dictate that member pointers and
references are "shallow" with respect to the const-ness of their owners — that is, a containing object that
is const has all const members except that member pointees (and referees) are still mutable. To
illustrate, consider this code:
struct S
{
int val;
int *ptr;
};
Although the object s passed to Foo() is constant, which makes all of its members constant, the pointee
accessible through s.ptr is still modifiable, though this may not be desirable from the standpoint
of const-correctness because s might solely own the pointee. For this reason, some[who?] have argued
that the default for member pointers and references should be "deep" const-ness, which could be
overridden by a mutable qualifier when the pointee is not owned by the container, but this strategy
would create compatibility issues with existing code. Thus, for historical reasons[citation needed], this loophole
remains open in C and C++.
The latter loophole can be closed by using a class to hide the pointer behind a const-correct interface,
but such classes either don't support the usual copy semantics from a const object (implying that the
containing class cannot be copied by the usual semantics either) or allow other loopholes by permitting
the stripping of const-ness through inadvertent or intentional copying.
Finally, several functions in the C standard library violate const-correctness, as they accept
a const pointer to a character string and return a non-const pointer to a part of the same
string. strtol and strchr are among these functions. Some implementations of the C++ standard
library, such as Microsoft's[2] try to close this loophole by providing two overloaded versions of some
functions: a "const" version and a "non-const" version.
[edit]Volatile-correctness
The other qualifier in C and C++, volatile, indicates that an object may be changed by something
external to the program at any time and so must be re-read from memory every time it is accessed. The
qualifier is most often found in code that manipulates hardwaredirectly (such as in embedded
systems and device drivers) and in multithreaded applications (though often used incorrectly in that
context; see external links at volatile variable). It can be used in exactly the same manner as const in
declarations of variables, pointers, references, and member functions, and in fact, volatile is
sometimes used to implement a similar design-by-contract strategy which Andrei
Alexandrescu calls volatile-correctness,[3] though this is far less common than const-correctness.
Thevolatile qualifier also can be stripped by const_cast, and it can be combined with
the const qualifier as in this sample:
final int i = 3;
i = 4; // Error! Cannot modify a "final" object
It must be decidable by the compilers where the variable with the final marker is initialized, and it must
be performed only once, or the class will not compile. Java's final and C++'s const keywords have the
same meaning when applied with primitive variables. Afinal reference in Java means the same as
the const pointer in C++ above.
Unlike C++ where one can declare a "pointer to a const type" above, there is no such mechanism in
Java.
const Foo *bar; // pointer to a const type; no equivalent in Java
There is no way to declare that code will not modify the object pointed to by a reference through that
reference in Java. Thus there are also no const methods. Const-correctness cannot be enforced in
Java, although by use of interfaces and defining a read-only interface to the class and passing this
around, one can ensure that objects can be passed around the system in a way that they cannot be
modified.
Methods in Java can be declared "final", but that has a completely unrelated meaning - it means that
the method cannot be overridden in subclasses.
Interestingly, the Java language specification regards const as a reserved keyword — i.e., one that
cannot be used as variable identifier — but assigns no semantics to it. It is thought that the reservation of
the keyword occurred to allow for an extension of the Java language to include C++-style const methods
and pointer to const type.[citation needed] An enhancement request ticket for implementing const correctness
exists in the Java Community Process, but was closed in 2005 on the basis that it was impossible to
implement in a backwards-compatible fashion.[5]
Unlike C++, C# does not permit methods and parameters to be marked as const. However one may also
pass around read-only subclasses, and the .NET Framework provides some support for converting
mutable collections to immutable ones which may be passed as read-only wrappers.