Object Oriented Technology
Object Oriented Technology
M.tech ( CSE )
Unit I
(1).What is OOP ?
OOP focuses on the objects that developers want to manipulate rather than the logic
required to manipulate them. This approach to programming is well-suited for
programs that are large, complex and actively updated or maintained. This includes
programs for manufacturing and design, as well as mobile applications; for example,
OOP can be used for manufacturing system simulation software.
The first step in OOP is to collect all of the objects a programmer wants to manipulate
and identify how they relate to each other -- an exercise known as data modeling.
Examples of an object can range from physical entities, such as a human being who is
described by properties like name and address, to small computer programs, such
as widgets.
Once an object is known, it is labeled with a class of objects that defines the kind of
data it contains and any logic sequences that can manipulate it. Each distinct logic
sequence is known as a method. Objects can communicate with well-defined
interfaces called messages.
Classes are user-defined data types that act as the blueprint for individual objects,
attributes and methods.
Objects are instances of a class created with specifically defined data. Objects can
correspond to real-world objects or an abstract entity. When class is defined
initially, the description is the only object that is defined.
Methods are functions that are defined inside a class that describe the behaviors of
an object. Each method contained in class definitions starts with a reference to an
instance object. Additionally, the subroutines contained in an object are called
instance methods. Programmers use methods for reusability or keeping
functionality encapsulated inside one object at a time.
Attributes are defined in the class template and represent the state of an object.
Objects will have data stored in the attributes field. Class attributes belong to the
class itself.
Abstraction. Objects only reveal internal mechanisms that are relevant for the use
of other objects, hiding any unnecessary implementation code. The derived class
can have its functionality extended. This concept can help developers more easily
make additional changes or additions over time.
Inheritance. Classes can reuse code from other classes. Relationships and
subclasses between objects can be assigned, enabling developers to reuse common
logic while still maintaining a unique hierarchy. This property of OOP forces a
more thorough data analysis, reduces development time and ensures a higher level
of accuracy.
Polymorphism. Objects are designed to share behaviors and they can take on
more than one form. The program will determine which meaning or usage is
necessary for each execution of that object from a parent class, reducing the need
to duplicate code. A child class is then created, which extends the functionality of
the parent class. Polymorphism allows different types of objects to pass through
the same interface.
Scala
JADE
Emerald
Java
Python
C++
PHP
JavaScript
the benefits of OOP
Benefits of OOP include:
Reusability. Code can be reused through inheritance, meaning a team does not
have to write the same code multiple times.
Productivity. Programmers can construct new programs quicker through the use
of multiple libraries and reusable code.
Developers who are working with OOP and microservices can address
common microservices issues by applying the principles of OOP.
(2)Class vs struct
Ans- Structs are light versions of classes. Structs are value types and can be used to
create objects that behave like built-in types.
Structs share many features with classes but with the following limitations as compared
to classes.
Structs are value types, allocated either on the stack or Classes are reference types, allocated on
1
inline in containing types. the heap and garbage-collected.
Allocations and de-allocations of value types are in Assignments of large reference types are
2 general cheaper than allocations and de-allocations of cheaper than assignments of large value
reference types. types.
In structs, each variable contains its own copy of the In classes, two variables can contain the
data (except in the case of the ref and out parameter reference of the same object and any
3
variables), and an operation on one variable does not operation on one variable can affect
affect another variable. another variable.
In this way, struct should be used only when you are sure that,
It logically represents a single value, like primitive types (int, double, etc.).
It is immutable.
It should not be boxed and un-boxed frequently.
e.g. Struct
1. struct Location
2. {
3. publicint x, y;
4. publicLocation(int x, int y)
5. {
6. this.x = x;
7. this.y = y;
8. }
9. }
10. Locationa = new Location(20, 20);
11. Locationb = a;
12. a.x = 100;
13. System.Console.WriteLine(b.x)
14. ;
The output will be 20. Value of "b" is a copy of "a", so "b" is unaffected by change of
"a.x". But in class, the output will be 100 because "a" and "b" will reference the same
object.
I believe this blog has clarified most of the doubts about struct. If you find further queries
about struct, please share with me so that everyone can have a clear understanding of
this topic.
Data abstraction is a principle of data modeling theory that emphasizes the clear
separation between the external interface of objects and internal data handling and
manipulation. In many programming languages, interfaces (or abstract classes) provide
abstraction, and their concrete implementations form the implementation.
This abstraction allows a much simpler API for the system models, mostly objects of
different classes while having a complex internal structure. This separation enables APIs
to remain essentially unchanged while the implementation of the API can improve over
time. The net result is that the ecosystem built around the APIs does not break with
every iterative refinement of the implementation.
For example, the map type is an interface that offers a lookup functionality. This interface
can be implemented by a binary search tree or by a list of two-element tuples. Either
implementation can offer the lookup method and act the same for any user of
the map data type.
(4)What is encapsulation
(5)Define Polymorphism ?
static or compile-time
dynamic
Static polymorphism
Java, like many other OOP languages, allows you to implement multiple
methods within the same class that use the same name. But, Java uses a
different set of parameters called method overloading and represents a
static form of polymorphism.
The parameter sets have to differ in at least one of the following three
criteria:
// ...
case FILTER_COFFEE:
return brewFilterCoffee();
default:
coffees.add(brewCoffee(selection));
return coffees;
// ...
When you call one of these methods, the provided set of parameters
identifies the method which has to be called.
In the following code snippet, we’ll call the method only with
a CoffeeSelection object. At compile time, the Java compiler binds this
method call to the brewCoffee(CoffeeSelection selection) method.
BasicCoffeeMachine coffeeMachine = createCoffeeMachine();
coffeeMachine.brewCoffee(CoffeeSelection.FILTER_COFFEE);
If we change this code and call the brewCoffee method with
a CoffeeSelection object and an int, the compiler binds the method call to
the other brewCoffee(CoffeeSelection selection, int number) method.
BasicCoffeeMachine coffeeMachine = createCoffeeMachine();
Dynamic polymorphism
This form of polymorphism doesn’t allow the compiler to determine the
executed method. The JVM needs to do that at runtime.
Within an inheritance hierarchy, a subclass can override a method of its
superclass, enabling the developer of the subclass to customize or
completely replace the behavior of that method.
Doing so also creates a form of polymorphism. Both methods
implemented by the super- and subclasses share the same name and
parameters. However, they provide different functionality.
Let’s take a look at another example from the CoffeeMachine project.
Method overriding in an inheritance hierarchy
The BasicCoffeeMachine class is the superclass of
the PremiumCoffeeMachine class.
Both classes provide an implementation of
the brewCoffee(CoffeeSelection selection) method.
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
super();
this.beans = beans;
coffees.add(brewCoffee(selection));
}
return coffees;
switch (selection) {
case FILTER_COFFEE:
return brewFilterCoffee();
default:
GroundCoffee groundCoffee =
this.grinder.grind(this.beans.get(CoffeeSelection.FILTER_COFFEE), config.getQuantityCoffee());
if (existingBeans != null) {
if (existingBeans.getName().equals(newBeans.getName())) {
existingBeans.setQuantity(existingBeans.getQuantity() +
newBeans.getQuantity());
} else {
} else {
this.beans.put(selection, newBeans);
import java.util.Map;
super(beans);
GroundCoffee groundCoffee =
this.grinder.grind(this.beans.get(CoffeeSelection.ESPRESSO), config.getQuantityCoffee());
// brew an espresso
return this.brewingUnit.brew(
if (selection == CoffeeSelection.ESPRESSO)
return brewEspresso();
else
return super.brewCoffee(selection);
If you read our post about the OOP concept inheritance, you already
know the two implementations of the brewCoffee method.
The BasicCoffeeMachine only supports
the CoffeeSelection.FILTER_COFFEE. The brewCoffee method of
the PremiumCoffeeMachine class adds support
for CoffeeSelection.ESPRESSO.
If the action gets called with any other CoffeeSelection, it uses the
keyword super to delegate the call to the superclass.
Late binding
Sometimes, you want to use an inheritance hierarchy in your project. To
do this, you must answer the question, which method will the JVM call?
The answer manifests during runtime because it depends on the object
on which the method gets called. The type of the reference, which you
can see in your code, is irrelevant. You need to distinguish three general
scenarios:
beans.put(CoffeeSelection.FILTER_COFFEE,
new CoffeeBean("My favorite filter coffee bean", 1000));
beans.put(CoffeeSelection.FILTER_COFFEE,
beans.put(CoffeeSelection.ESPRESSO,
beans.put(CoffeeSelection.FILTER_COFFEE,
Summary
Polymorphism is one of the core concepts in OOP languages and
describes the concept wherein you can use different classes with the
same interface. Each of these classes can provide its own
implementation of the interface.
Java supports two kinds of polymorphism. You can overload a method
with different sets of parameters. This is called static polymorphism
because the compiler statically binds the method call to a specific
method.
Within an inheritance hierarchy, a subclass can override a method of its
superclass. If you instantiate the subclass, the JVM will always call the
overridden method, even if you cast the subclass to its superclass. That
is called dynamic polymorphism.
UNIT II
1.Methodological issues ?
Ans- Bone research is a dynamic area of scientific investigation that usually
encompasses multidisciplines. Virtually all basic cellular research, clinical research
and epidemiologic research rely on statistical concepts and methodology for
inference. This paper discusses common issues and suggested solutions concerning
the application of statistical thinking in bone research, particularly in clinical and
epidemiological investigations. The issues are sample size estimation, biases and
confounders, analysis of longitudinal data, categorization of continuous data, selection
of significant variables, over-fitting, P-values, false positive finding, confidence
interval, and Bayesian inference. It is hoped that by adopting the suggested measures
the scientific quality of bone research can improve.
Keywords
Statistical methods
P-value
Confidence interval
Bayesian inference
Collider bias
1. Introduction
Bone research commonly involves multifaceted studies. These studies may range
from basic cellular experiments, clinical trials to epidemiological investigations. Most
of these studies come down to 3 broad aims: assessing difference (ie, effect),
association, and prediction. Do cells with one version of a gene express more of an
enzyme than cells with another version? Does a new drug reduce the risk of fracture
compared with placebo? Among hundreds of risk factors in a cohort study, which
factors are associated with fracture? Can a new prediction model based on Caucasian
populations be used for fracture risk assessment in Asian populations? The answer to
these questions invariably involves statistical thinking.
Indeed, every stage of a research project – from study design, data collection, data
analysis, to data reporting – involves statistical consideration. Statistical models and
null hypothesis significance testing are powerful methods to discover laws and trends
underlying observational data, and to help make accurate inference. Test of hypothesis
can also help researchers to make decision of accepting or rejecting a null hypothesis,
contributing to the scientific progress. Thus, reviewers and readers alike expect
researchers to apply appropriate statistical models to obtain useful information from
the data for creating new knowledge.
However, misuse of statistical methods has been common in biomedical research [1],
and the problem is still persistent [2,3]. In the 1960s, a review of 149 studies from
popular medical journals revealed that less than 30% of studies were
methodologically ‘acceptable’ [4]. About 2 decades later, a review of 196 clinical
trials on rheumatoid arthritis found that 76% of the conclusions or abstracts contained
‘doubtful or invalid statements’ [5]. In a recent systematic review of published studies
in orthopedic journals, 17% of studies where conclusions were not consistent with
results presented, and 39% of studies where a different analytical method should have
been applied [6]. While the majority of statistical errors were minor, about 17% errors
could compromise the study conclusion [6]. Apart from errors, there are deep
concerns about the abuse of statistical methods that lead to misinterpretation of data
and retraction of published studies. The bone research community has recently come
to terms with a high profile retraction of papers by a bone researcher [7]. The misuse
of statistical methods and misinterpretation of statistical analysis partly contribute to
the problem of irreproducibility of research findings [8,9].
The recognition of the lack of reproducibility in biomedical research [[10], [11], [12]]
has led to several discussions on how to improve the quality of bone research
publications [[13], [14], [15]]. As an editor and expert reviewer for several bone and
medical journals over the past 25 years, I have identified major areas that need
improvement, namely, reporting of study design, data analysis, and interpretation of
P-values. In this article, I focus on the most common issues that appear repeatedly in
the bone research literature, and then suggest possible solutions. My aim is to help
bone research colleagues in providing relevant ideas and methods that are required to
improve the reproducibility and accurate inference of their work.
The founder of modern statistics, Karl Pearson, once said that "the utility of all
science consists alone in its method, not its material" [16]. Although the same method
can be used in different studies, it is the details of methodological activities that define
the quality of the work. The description of details and activities of study design can be
found in several guidelines such as CONSORT [17] for clinical trials, STROBE [18]
for observational studies, and ARRIVE [19] for animal studies.
One important point of these guidelines is the description of sample size estimation.
As a norm, studies with inadequate sample size have low sensitivity (eg, power) to
uncover a true association. It is not widely appreciated that underpowered studies
often produce statistically significant and exaggerated findings, but the findings have
low probability of reproducibility [20].
Therefore, a clear explanation of sample size estimation and rationale, including
primary outcome, expected effect size, type I and type II error, greatly help readers to
assess the reliability of study findings [21]. Unfortunately, many bone science authors
do not report how they arrived at the sample size. Moreover, most laboratory studies
are based on a small number of animals, but there is no quantitative justification of the
sample size [22]. As a result, it is very difficult to interpret a study’s observed effect
size in the absence of a hypothesized effect size that underlined the estimation of
sample size.
In prospective cohort studies, individuals are repeatedly measured over time, enable
the examination of individual evolution of outcome. The analysis of data from this
type of study design is challenging, because (i) measurements within an individual are
correlated, (ii) the duration between visits is different between individuals, and (iii)
there are missing data. Some authors applied the analysis of variance to analyze such
a longitudinal dataset, but this method cannot handle the difference in follow-up
duration and missing data. If the within-subject correlation is not properly accounted
for, it can lead to false positive findings and wrong confidence intervals [28].
Researchers are suggested to consider more modern methods such as generalized
estimating equations [29] and the linear mixed effects model [30]. A major strength of
these modern methods is that they can handle missing data while still accounting for
variability within and between individuals.
Another common problem associated with longitudinal data analysis is the
determination of rate of change for an individual. For studies that measure bone
mineral density (BMD) before (denoted by x0) and after (x1) intervention, most
researchers would calculate the percentage change as the difference between 2
measurements over the baseline measurement, ie, (x1−x0)/x0×100, and then use the
percentage change as a dependent variable for further analyses. Although this measure
seems straightforward, it is not symmetric [31] and can result in misleading results
[32]. A better and symmetric quantification of change should use the mean of 2
measurements as the denominator, ie, (x1−x0)/mean(x0,x1)×100. For testing hypothesis
concerning difference between treatments in before-after studies that involves a
continuous outcome variable, the analysis of covariance is considered a standard
method [33].
It is not uncommon to read bone research papers where the authors categorize
continuous variables such as bone mineral density (BMD) into 2 distinct groups (eg,
"osteporosis" and "non-osteoporosis"), or 3 groups (eg, osteoporosis, osteopenia, and
normal), and then use the categorized variable as an exposure or an outcome for
further analyses. While the World Health Organization’s recommended BMD
classification [34] is appropriate for clinical/diagnostic purposes, it is a bad practice
for scientific purpose.
It has been repeatedly shown that such a categorization is unnecessary and can distort
an association [35]. Apart from the risk of misclassification, the obvious problem with
categorization of continuous variables is the loss of information. In the case of
dichotomization, for example, all individuals above or below the cut-point is treated
equaly, yet their prognosis could be vastly different. Therefore, the loss of information
is increased (ie, more severe) when the number of categories is reduced.
Categorization also reduces the efficiency of adjustment for confounders. In linear
models, a categorized risk factor removes only 67% of the confounder compared to
when the continuous type of the variable is used [36].
For scientific purposes, it is recommended that investigators do not categorize
continuous variables in an analysis of association. Some continuous variables may
exhibit a non-normal distribution, and in this case, it is instructive to consider more
appropriate analyses such as spline regression or non-parametric smoother, and not to
categorize continuous data.
In many studies, the aim is to identify a set of predictor variables that are
independently associated with a continuous outcome (in multiple linear regression) or
a binary outcome (in multiple logistic regression). In the presence of hundreds or
thousands of variables of interest, the number of possible sets of variables (or models)
can be very large. For instance, a study with 30 variables can generate at least
2∧30 = 1,073,741,824 possible models, and determining which models are associated
with an outcome is quite a challenge.
Many researchers have traditionally used stepwise regression to select the ‘best
model’. While stepwise regression is a popular method for selecting a relevant set of
variables, it has serious deficiencies [37]. It is not widely appreciated that stepwise
regression does not necessarily come up with the best model if there are redundant
predictors. Consequently, variables that are truly associated with the outcome may not
be identified by stepwise regression, because they do not reach statistical significance,
while non-associated variables may be identified to be significant [38]. As a result, the
model identified by stepwise regression is poorly reproducible.
For selection of relevant predictors, investigators are strongly suggested to consider
more robust methods such as Bayesian model averaging [39,40] or LASSO [41]
which has been shown to perform better than the stepwise regression. Still, the models
identified by these methods are only suggestive in nature. Statistical algorithms do not
have substantive knowledge about a clinical or biological problem that we researchers
have. Therefore, the best models must be guided by substantive knowledge, not just
by statistical method-driven model selection.
1.6. Over-fitting
Multivariable statistical model always runs the risk of being over-fitted, in the sense
that the model is unnecessarily complex. When over-fitting happens, the model is not
valid because it tries to explain the random part of the model rather than the
association between variables. As a result, an over-fitting model may fit the data very
well for a dataset at hand, but it fits poorly for a new and independent dataset.
Over-fitting often happens when the number of parameters in the model is greater
than the number of events. There is a rule of thumb that each predictor in a
multivariable model requires at least 10 events [42], but recent research has shown
that this rule of thumb is simplistic. Theoretical studies show that the number of
events in a multivariable prediction model is determined by (i) the incidence of
disease, (ii) the number of risk factors, (iii) the proportion of variance explained, and
(iv) shrinkage factor [43].
Modern methods such as LASSO [41] or ridge regression [44] can help reduce over-
fitting. In particular, LASSO is a method that shrinks the model coefficients toward 0
by imposing a constraint on the sum of the parameter estimates. This imposition can
help eliminate non-important predictors in the model, and hence reduce the over-
fitting.
1.7. P-values
Much of scientific inference boils down to the interpretation of P-value. Since its
inception in the 1920s, P-value has been ubiquitous in the scientific literature, such
that it is sometimes considered a "passport for publication". Readers of biomedical
research literature may have noticed that the interpretation of P-value in most papers
was largely dichotomized into "significant" vs "non-significant", with P = 0.05 being
the commonest threshold for declaring a discovery. In some not-so-extreme cases,
researchers reach a conclusion of effect based on a finding with P = 0.04, but readily
dismiss a result with P = 0.06 as a null effect. However, it is not widely appreciated
that that P-values vary greatly between samples [45], such that a deletion or addition
of a single observation can change the statistical significance of a finding. Therefore,
the simple classification of finding into "significant" and "non-significant" based on
the threshold of 0.05 is not encouraged. The conclusion of an effect should be based
on full evidence, not limited to the levels of statistical significance alone.
P-value is a result of null hypothesis significant testing (NHST). However, few
practicing scientists realize that NHST is the hybridization of 2 approaches: test of
significance and test of hypothesis. This hybridization has generated a lot of confusion
and misinterpretation of P-values. It is thus instructive to have a brief review of the
thinking underlying the NHST approach.
1.8. Multiple testing, large sample size, and false discovery rate
In recent years, national registries have provided researchers with opportunities to test
hundreds or thousands of hypotheses, with many more tests being unreported. As a
norm, the more one searches, the more one discovers unexpected and false findings. It
can be shown that the probability of false positive findings is an exponential function
of the number of hypothesis tests. For instance, at the alpha level of 5%, a study
testing for association between 50 risk factors and an outcome, there is a 92%
probability that the study will find at least one ‘significant’ association, even if there
is no association between any of the risk factors and the outcome. In genomic
research, the P-value threshold of 5 × 10−8 has become a standard for common-variant
genome wide association studies, but there is no such threshold for registry-based
research. Researchers using registry based data are suggested to take measures (such
as Bonferroni’s procedure or Tukey’s test) to adjust P values from multiple testing so
that the nominal P-value is less than 0.05, and to report the false discovery rate [52].
Studies with very large sample size pose serious challenges in the inference of
association. For a given effect size, P-value is a reflection of sample size, in the sense
that studies with very large sample size almost always reject the null hypothesis. In
the 1950s, Lindley showed that a statistically significant finding from a study with
very large sample size may represent strong evidence for the null effect, and this is
later known as "Lindley’s Paradox" [53]. For example, an observed proportion of
49.9% is consistent with the null hypothesis of 50.0% (P = 0.95) when the sample size
is 1000 individuals; however, when the sample size is 1,000,000, P = 0.045 which is
against the null hypothesis at the a level of 0.05. In other words, studies with very
large sample size are very likely to find small P-values, but their evidence against the
null hypothesis is very weak.
The implication is that the level of 5% may not be applicable to large sample size
studies. Researchers need to adjust the observed P-value in large sample size studies.
Good proposed a simple adjustment called Q or standardized P-value [54]: Q=Pn/100 ,
where P is the actual P-value, n is the sample size. Thus, when n = 100, the
standardized P-value Q is the same as the observed P-value. Good suggested
that Q > 1 can be interpreted as support for the null hypothesis. Thus
for n = 1,000,000 and P = 0.045, Q = 4.5, which is an evidence for the null hypothesis.
Another solution is to set an ‘optimal’ α level based on a hypothesized effect size and
cost of errors [55].
Many researchers mistaken the P-value as a false discovery rate. According to this
view, a finding with P = 0.05 is equivalent to a false discovery rate of 5%. However,
such an interpretation is also wrong. It can actually be shown that in the agnostic
scenario a finding of P = 0.05 is equivalent to a false discovery rate of at least 30%
[56]. It can also be shown that a P-value of 0.001 corresponds to a false discovery rate
of 1.8% [57]. Thus, there is a call that the routine P-value should be lowered to 0.005
[58] or 0.001 [9] to minimize false discovery rate. The implication of these
consideration is that researchers should not regard any result with P > 0.005 as an
evidence of discovery.
2. Conclusions
Statistical errors can arise in every phase of a study, from experimental design, data
analysis to interpretation (Table 1). Data are products of experiment, and data quality
is a consequence of experimental design. Good experimental design, whether it is
animal study or clinical trial, is essential for generating high quality data. For a well-
designed study with high quality data, simple statistical methods suffice in most cases,
and the chance of statistical errors is low. Data can be adjusted, but study design
cannot be reversed. Therefore, it is very important that issues concerning study design
(eg, sample size, control, matching, blocking, randomization, measurements) should
be considered at the beginning of a research project to minimize subsequent errors.
Table 1. List of common issues and suggested solutions.
Issue Suggested solution
Over-fitting: number of predictors is greater Consider LASSO and ridge regression analysis
than the number of events
Issue Suggested solution
Analysis of variance for longitudinal data Consider linear mixed effects model as an alternative to
repeated measures analysis of variance.
P-value in very large sample size study Consider Good’s adjustment [54].
Although the focus of this article is on bone research, the errors identified here are
also discussed in other areas of research [[69], [70], [71]]. Most of these errors come
down to the practice of null hypothesis significance testing and P-value, which is the
subject of intense debate among methodologists and practicing scientists [72]. It is
recognized that the P-value overstates the evidence for an association, and that its
arbitrary threshold of 0.05 is a major source of falsely interpreted true positive results.
About 25% of all findings with P < 0.05, if viewed in a scientifically agnostic light,
can be regarded as either meaningless [73] or as nothing more than chance findings
[74]. There have been calls to ban P-value in scientific inference [75,76]. However, it
is likely that the P-value is here to stay. Although P-value does not convey the truth, it
is a useful measure that helps distinguish between noise and signal in the world of
uncertainty. What is needed is the interpretation of P-value should be contextualized
within a study and biological plausibility. It is hoped that this review helps improve
statistical literacy along all phases of research.
UNIT IV
A database is a data storage. A software system that is used to manage databases is called a
database management system (DBMS). There are many types of database management
systems such as hierarchical, network, relational, object-oriented, graph, and document. Learn
more here, Types of Database Management Systems.
In this article, we will discuss what object-oriented databases are and why they are useful.
Object-Oriented Database
The idea of object databases was originated in 1985 and today has become common for
various common OOP languages, such as C++, Java, C#, Smalltalk, and LISP. Common
examples are Smalltalk is used in GemStone, LISP is used in Gbase, and COP is used in
Vbase.
Object databases are commonly used in applications that require high performance,
calculations, and faster results. Some of the common applications that use object databases are
real-time systems, architectural & engineering for 3D modeling, telecommunications, and
scientific products, molecular science, and astronomy.
ODBMS provide persistent storage to objects. Imagine creating objects in your program and
saving them as it is in a database and reading back from the database.
In a typical relational database, the program data is stored in rows and columns. To store and
read that data and convert it into program objects in memory requires reading data, loading data
into objects, and storing it in memory. Imagine creating a class in your program and saving it as
it is in a database, reading back and start using it again.
Object databases bring permanent persistent to objects. Objects can be stored in persistent
storage forever.
In typical RDBMS, there is a layer of object-relational mapping that maps database schemas
with objects in code. Reading and mapping an object database data to the objects is direct
without any API or OR tool. Hence faster data access and better performance.
Some object database can be used in multiple languages. For example, Gemstone database
supports C++, Smalltalk and Java programming languages.
Here is a list of some of the popular object databases and their features.
Cache
Caché is also a full-featured relational database. All the data within a Caché database is
available as true relational tables and can be queried and modified using standard SQL via
ODBC, JDBC, or object methods. Caché is one of the fastest, most reliable, and most scalable
relational databases.
The ability to model data as objects (each with an automatically created and
synchronized native relational representation) while eliminating both the impedance
mismatch between databases and object-oriented application environments as well as
reducing the complexity of relational modeling,
A simpler, object-based concurrency model
User-defined data types
The ability to take advantage of methods and inheritance, including polymorphism, within
the database engine
Object-extensions for SQL to handle object identity and relationships
The ability to intermix SQL and object-based access within a single application, using
each for what they are best suited
Control over the physical layout and clustering used to store data in order to ensure the
maximum performance for applications
ConceptBase
ConceptBase.cc is developed by the ConceptBase Team at University of Skövde (HIS) and the
University of Aachen (RWTH). ConceptBase.cc is available for Linux, Windows, and Mac OS-X.
There is also a pre-configured virtual appliance that contains the executable system plus its
sources plus the tools to compile them. The system is distributed under a FreeBSD-style
license.
Db4o
b4o is the world's leading open-source object database for Java and .NET. Leverage fast native
object persistence, ACID transactions, query-by-example, S.O.D.A object query API, automatic
class schema evolution, small size.
ObjectDatabase++
Objectivity/DB
Objectivity/DB runs on 32 or 64-bit processors running Linux, Mac OS X, UNIX (Oracle Solaris)
or Windows.
All platform and language combinations are interoperable. For example, objects stored by a
program using C++ on Linux can be read by a C# program on Windows and a Java program on
Mac OS X.
Objectivity/DB generally runs on POSIX filesystems, but there are plugins that can be modified
for other storage infrastructure.
ObjectStore is an enterprise object-oriented database management system for C++ and Java.
ObjectStore eliminates need to flatten complex data for consumption in your application logic
reducing the overhead of using a translation layer that converts complex objects into flat
objects, dramatically improving performance and often entirely eliminating the need to manage
a relational database system
ObjectStore is OO storage that directly integrates with Java or C++ applications and treats
memory and persistent storage as one – improving the performance of application logic while
fully maintaining ACID compliance against the transactional and distributed load.
Versant Object-Oriented Database is an object database that supports native object persistence
and used to build complex and high-performance data management systems.
Key Benefits
WakandaDB
WakandaDB is an object database and provides a native REST API to access interconnected
DataClasses defined in Server-Side JavaScript. WakandaDB is the server within Wakanda
which includes a dedicated, but not mandatory, Ajax Framework, and a dedicated IDE.
Object-relational Databases
PostgreSQL is the most popular pure ORDBMS. Some popular databases including Microsoft
SQL Server, Oracle, and IBM DB2 also support objects and can be considered as ORDBMS.
In turn, objects are brought together in classes. Or, to put it more accurately: an object is a concrete
unit in an abstract class. This generates a hierarchy of classes and subclasses. Within such a
construct, subclasses assume the properties of higher-level classes and expand on these with their
own attributes. At the same time, objects in one class can also be connected with other classes. This
breaks up the strict hierarchy and makes sure that the objects are interlinked. Simple objects can be
combined with complex objects.
To address the various objects, the corresponding database management system automatically
assigns a one-off identification to each unit. In this way, objects can be easily retrieved again after
they have been saved.
Let’s look at an example. Assume we are saving the concrete object of a bicycle as an object-
oriented unit with all of its properties and methods. It is red, you can ride it, it has a saddle, and so
on. This object is then simultaneously part of the class ‘Bicycles’. Inside the same class, for
example, we might also find a blue and a green bicycle. The class ‘Bicycles’ is in turn a subcategory
of ‘Vehicles’, which also contains ‘Cars’. At the same time, however, the object also has a
connection to the class ‘Leisure activities’. If we retrieve our object via its unique ID, all of its related
attributes and methods are directly available.
Relational vs. object-oriented databases
For a long time, relational databases have been the standard in web and software development. In
this model, information is stored in interconnected tables. Here, too, the links between complex
pieces of information with different components can be stored and retrieved. With an object
database, though, all of the unit’s components are available immediately. That also means that the
data sets can be much more complex. With a relational database we tend to try to accommodate
simple information. The more complex the data set becomes, the more extensive the connections,
obstructing the database.
The choice of database type heavily depends on the individual application. When working
with object-oriented programming languages, like Java for example, an object database is
advantageous. The objects of the source code can simply be incorporated into the database. If we
turn to a relational database, which is fairly common, complex objects are more difficult to integrate
into the table construct.
One disadvantage of OODBs is poor adoption among the community. Although the model has
been established since the 1980s, up to now, very few database management systems have taken
to object databases. The community that works with the model is correspondingly small. Most
developers, therefore, prefer to turn to the more widely spread, well-documented and highly
developed relational databases.
Although complexity of OODBs is one of its advantages, it can present a few disadvantages in
certain situations. The complexity of the objects means that complex queries and operations can be
undertaken much more quickly than in relational models. However, if the operations are simple, the
complex structure still has to be used resulting in a loss of speed.
Advantages Disadvantages
Complex data sets can be saved and retrieved Object databases are not widely adopted.
quickly and easily.
Object IDs are assigned automatically. In some situations, the high complexity can cause
performance problems.
oriented programming) that are distributed across different address spaces, either in
different processes on the same computer, or even in multiple computers connected via a network,
but which work together by sharing data and invoking methods. This often involves location
transparency, where remote objects appear the same as local objects. The main method
of distributed object communication is with remote method invocation, generally by message-
passing: one object sends a message to another object in a remote machine or process to perform
some task. The results are sent back to the calling object.
Distributed objects were popular in the late 1990s and early 2000s, but have since fallen out of
favor.[1]
The term may also generally refer to one of the extensions of the basic object concept used in the
context of distributed computing, such as replicated objects or live distributed objects.
Replicated objects are groups of software components (replicas) that run a distributed multi-
party protocol to achieve a high degree of consistency between their internal states, and that
respond to requests in a coordinated manner. Referring to the group of replicas jointly as
an object reflects the fact that interacting with any of them exposes the same externally visible
state and behavior.
Live distributed objects (or simply live objects)[2] generalize the replicated object concept to
groups of replicas that might internally use any distributed protocol, perhaps resulting in only a
weak consistency between their local states. Live distributed objects can also be defined as
running instances of distributed multi-party protocols, viewed from the object-oriented
perspective as entities that have distinct identity, and that can encapsulate distributed state and
behavior.
1. Life cycle : Creation, migration and deletion of distributed objects is different from local
objects
2. Reference : Remote references to distributed objects are more complex than simple pointers
to memory addresses
3. Request Latency : A distributed object request is orders of magnitude slower than local
method invocation
4. Object Activation : Distributed objects may not always be available to serve an object request
at any point in time
5. Parallelism : Distributed objects may be executed in parallel.
6. Communication : There are different communication primitives available for distributed
objects requests
7. Failure : Distributed objects have far more points of failure than typical local objects.
8. Security : Distribution makes them vulnerable to attack.
Examples[edit]
The RPC facilities of the cross platform se
serialization protocol, Cap'n Proto amount to a distributed
object protocol. Distributed object method calls can be executed (chained, in a single network
request, if needs be) through
ugh interface references/
references/capabilities.[5]
Distributed objects are implemented
mented in Objective-C using the Cocoa API with the NSConnection
class and supporting objects.
Distributed objects are used in Java RMI
RMI.
CORBA lets one build distributed mixed object systems.
DCOM is a framework for distributed objects on the Microsoft platform.
DDObjects is a framework for distributed
tributed objects using Borland Delphi.
Jt is a framework for distributed components using a messaging paradigm.
JavaSpaces is a Sun specification for a distributed, shared memory (spa
(space based)
Pyro is a framework for distributed objects using the Python programming language.
language
Distributed Ruby (DRb) is a framework for distributed objects using the Ruby programming
language.
is the period when the programming code (such as C#, Java, C, Python)
Python is converted
to the machine code (i.e. binary code)
code). Runtime is the period of time when a
program is running and generally occurs after compile timetime.
We use high-level
level programming languages such as Java to write a program. The
instructions or source code written using high
high-level
level language is required to get
ge
converted to machine code for a computer to understand. During compile time,
the source code is translated to a byte code like from .java to .class. During compile
time the compiler check for the syntax, semantic, and type of the code.
3.2. Errors
During compile time errors occur because of syntax and semantic. The syntax
error occurs because of the wrong syntax of the written code. Semantic errors occur in
reference to variable, function, type declarations and type checking.
4. Runtime
A program’s life cycle is a runtime when the program is in execution. Following are the
different types of runtime errors:
5. Differences
The following table shows a comparison between compile time and runtime.
6. Conclusion
In this article, we discussed an overview of the compile-time and runtime. First, we
discussed the stages of translation of source code to machine code for java and C#.
We then talked about the differences between compiler time and runtime. To
conclude, knowing about the translation stages, is beneficial in understanding the
source of errors for a computer program.
When the client or server application issues a request on an object via an object reference,
the Oracle Tuxedo server application instantiates the object specified by the object
reference, if the object is not already active in memory. (Note that a request always maps
to a specific operation invocation on an object.)
Instantiating an object typically involves the server application initializing the object’s state,
which may include having the object’s state read from durable storage, such as a database.
The object contains all the data necessary to do the following:
•Execute the object’s operations.
•Store the object’s state in durable storage when the object is no longer needed.
Therefore, the designers of Java RMI have chosen to restrict blocking on remote
objects only to the proxies (Wollrath et al., 1996). This means that threads in the same
process will be prevented from concurrently accessing the same remote object, but
threads in different processes will not. Obviously, these synchronization semantics are
tricky: at the syntactic level (ie, when reading source code) we may see a nice, clean design.
Only when the distributed application is actually executed, unanticipated behavior may be
observed that should have been dealt with at design time. [..
Due to the differing failure modes of local and remote objects, distributed wait and
notification requires a more sophisticated protocol between the entities involved (so that,
for example, a client crash does not cause a remote object to be locked forever), and as
such, cannot be easily fitted into the local threading model in Java. Hence, a client can use
notify and wait methods on a remote reference, but that client must be aware that such
actions will not involve the actual remote object, only the local proxy (stub) for the remote
object.