Note: These are
extracted notes
Modern software
development has been more automated by tools or concepts. This enables
developer to pay attention to complexity that needs only human brains to
handle. ORM is one of them. It automates database transactions, queries and
thus reduces coding substantially. Several generic queries are generated
implicitly by ORM tools and complex queries and their code also to the great
extent are easily developed. ORM reduces development time and efforts.
Object-relational
mapping (ORM) is a technology that uses a metadata descriptor.
It connects application
to a relational database. The similarity
between database and object in OOPS is both have data structure that remains
same for all instances (rows). So class written any Object oriented language
can be mapped to any table in relational database. Object code is written in
object-oriented programming (OOP) languages such as Java or C#. ORM converts
data between type systems that are unable to coexist within relational databases
and OOP languages.
Object-relational
mapping (ORM, O/RM, and O/R mapping) in computer software is a programming
technique for converting data between incompatible type systems in
object-oriented programming languages. This creates, in effect, a "virtual
object database" that can be used from within the programming language.
There are both free and commercial packages available that perform
object-relational mapping, although some programmers opt to create their own
ORM tools.
ORM resolves the object code and relational database
mismatch with three approaches: bottom up, top-down and meet in the middle.
Each approach has its share of benefits and drawbacks. When selecting the best
software solution, developers must fully understand the environment and design
requirements.
In addition to the data access technique, ORM's benefits also include:
In addition to the data access technique, ORM's benefits also include:
- Simplified
development because it automates object-to-table and table-to-object
conversion, resulting in lower development and maintenance costs
- Less
code compared to embedded SQL and handwritten stored procedures
- Transparent
object caching in the application tier, improving system performance
- An
optimized solution making an application faster and easier to maintain
- ORM’s emergence in multiple application development has created disagreement among experts. Key concerns are that ORM does not perform well and that stored procedures might be a better solution. In addition, ORM dependence may result in poorly-designed databases in certain circumstances.
Object Relational Mapping: Frameworks and Advantages
ORM (Object Relational Mapping) wraps your tables or stored
procedures in classes in your programming language, so that instead of writing
SQL statements to interact with your database, you use methods and properties
of objects.
There are a lot of frameworks available for implementing ORM
(Object Relational Mapping) in different programming languages.
Based on abstraction, ORM (Object Relational Mapping)
manages the mapping details between a set of objects and underlying relational
databases, XML repositories or other data sources and sinks, while
simultaneously hiding the often changing details of related interfaces from
developers and the code they create.
ORM (Object Relational Mapping) hides and encapsulates
change in the data source itself, so that when data sources or their APIs
change, only ORM needs to change to keep up—not the applications that use ORM
to insulate themselves from this kind of effort. This capacity lets developers
take advantage of new classes as they become available and also makes it easy
to extend ORM-based applications. In many cases, ORM changes can incorporate
new technology and capability without requiring changes to the code for related
applications.