'2008/10'에 해당되는 글 51건

  1. 2008.10.23 Hibernate (Java) by 알 수 없는 사용자
  2. 2008.10.23 Object-relational impedance mismatch by 알 수 없는 사용자
  3. 2008.10.23 Persistence (computer science) by 알 수 없는 사용자
  4. 2008.10.23 Object-relational mapping by 알 수 없는 사용자
  5. 2008.10.22 JavaScript and Object Oriented Programming (OOP) by 알 수 없는 사용자
  6. 2008.10.21 Flyweight pattern by 알 수 없는 사용자
  7. 2008.10.21 Proxy pattern by 알 수 없는 사용자 2
  8. 2008.10.20 Mock object by 알 수 없는 사용자
  9. 2008.10.20 Java Message Service by 알 수 없는 사용자
  10. 2008.10.20 Advanced Message Queuing Protocol by 알 수 없는 사용자

Hibernate (Java)

Computer/Terms 2008. 10. 23. 13:38

Hibernate is an object-relational mapping (ORM) library for the Java language, providing a framework for mapping an object-oriented domain model to a traditional relational database. Hibernate solves Object-Relational impedance mismatch problems by replacing direct persistence-related database accesses with high-level object handling functions. The Hibernate 2.1 framework won a Jolt Award in 2005. [1]

Hibernate is free as open source software that is distributed under the GNU Lesser General Public License.

Reference:
http://en.wikipedia.org/wiki/Hibernate_(Java)

Posted by 알 수 없는 사용자
,

The object-relational impedance mismatch is a set of conceptual and technical difficulties which are often encountered when a relational database management system is being used by a program written in an object-oriented programming language or style; particularly when objects and/or class definitions are mapped in a straightforward way to database tables and/or relational schemata. This practice has been recommended and documented by some object-oriented literature as a way to use databases in object-oriented programs.

The term Object-relational impedance mismatch is derived (etymologically) from the electrical engineering term impedance mismatch.

Reference:
http://en.wikipedia.org/wiki/Object-Relational_impedance_mismatch

Posted by 알 수 없는 사용자
,

In computer science, persistence refers to the characteristic of data that outlives the execution of the program that created it. Without this capability, data only exists in RAM, and will be lost when the memory loses power, such as on computer shutdown.

Computer programming
In programming, persistence refers specifically to the ability to retain data structures between program executions, such as, for example, an image editing program saving complex selections or a word processor saving undo history.

This is achieved in practice by storing the data in non-volatile storage such as a file system or a relational database or an object database. Design patterns solving this problem are container based persistence, component based persistence and the Data Access Object model. When first introduced, the idea was that persistence should be an intrinsic property of the data, in contrast with the traditional approach where data is read and written to disk using imperative verbs in a programming language. This emphasis has largely disappeared, resulting in the use of persist as a transitive verb: On completion, the program persists the data. Examples of persistence are using Java serialization to store Java objects on disk or using Java EE to store Enterprise Java Beans in a relational database.

Persistence Services
Persistence services is when the workflow runtime engine semantics dictate that persistence should occur, the workflow runtime engine will call methods supplied by a persistence service to save state information about the workflow instance. Likewise when workflow runtime engine needs to restore a previously persisted workflow instance, it will call methods supplied by the persistence service to load this state information.

Reference:
http://en.wikipedia.org/wiki/Persistence_(computer_science)

Posted by 알 수 없는 사용자
,

Object-relational mapping (aka ORM, O/RM, and O/R mapping) is a programming technique for converting data between incompatible type systems in relational databases and object-oriented programming languages. This creates, in effect, a "virtual object database" which 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.

Reference:
http://en.wikipedia.org/wiki/Object-relational_mapping
Posted by 알 수 없는 사용자
,

JavaScript is an excellent language to write object oriented web applications. It can support OOP because it supports inheritance through prototyping as well as properties and methods. Many developers cast off JS as a suitable OOP language because they are so used to the class style of C# and Java. Many people don't realize that JavaScript supports inheritance. When you write object-oriented code it instantly gives you power; you can write code that can be re-used and that is encapsulated.

Reference:
http://www.javascriptkit.com/javatutors/oopjs.shtml
Posted by 알 수 없는 사용자
,

Flyweight pattern

Computer/Terms 2008. 10. 21. 11:29

Flyweight is a software design pattern. A Flyweight is an object that minimizes memory occupation by sharing as much data as possible with other similar objects; it is a way to use objects in large numbers when a simple representation would use an unacceptable amount of memory. Often some parts of the object state can be shared and it's common to put them in external data structures and pass them to the flyweight objects temporarily when they are used.

A classic example usage of the flyweight pattern are the data structures for graphical representation of characters in a word processor. It would be nice to have, for each character in a document, a glyph object containing its font outline, font metrics, and other formatting data, but it would amount to hundreds or thousands of bytes for each character. Instead, for every character there might be a reference to a flyweight glyph object shared by every instance of the same character in the document; only the position of each character (in the document and/or the page) would need to be stored externally.

Reference:
http://en.wikipedia.org/wiki/Flyweight_Pattern

Posted by 알 수 없는 사용자
,

Proxy pattern

Computer/Terms 2008. 10. 21. 10:53

In computer programming, the proxy pattern is a software design pattern.

A proxy, in its most general form, is a class functioning as an interface to another thing. The other thing could be anything: a network connection, a large object in memory, a file, or some other resource that is expensive or impossible to duplicate.

A well-known example of the proxy pattern is a reference counting pointer object.

In situations where multiple copies of a complex object must exist the proxy pattern can be adapted to incorporate the Flyweight Pattern in order to reduce the application's memory footprint. Typically one instance of the complex object is created, and multiple proxy objects are created, all of which contain a reference to the single original complex object. Any operations performed on the proxies are forwarded to the original object. Once all instances of the proxy are out of scope, the complex object's memory may be deallocated.

Reference:
http://en.wikipedia.org/wiki/Proxy_pattern

Posted by 알 수 없는 사용자
,

Mock object

Computer/Terms 2008. 10. 20. 14:00

In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A computer programmer typically creates a mock object to test the behavior of some other object, in much the same way that a car designer uses a crash test dummy to test the behavior of a car during an accident.

Reasons for use
In a unit test, mock objects can simulate the behavior of complex, real (non-mock) objects and are therefore useful when a real object is impractical or impossible to incorporate into a unit test. If an object has any of the following characteristics, it may be useful to use a mock object in its place:

- supplies non-deterministic results (e.g. the current time or the current temperature);
- has states that are difficult to create or reproduce (e.g. a network error);
- is slow (e.g. a complete database, which would have to be initialized before the test);
- does not yet exist or may change behavior;
- would have to include information and methods exclusively for testing purposes (and not for its actual task).

For example, an alarm clock program which causes a bell to ring at a certain time might get the current time from the outside world. To test this, the test must wait until the alarm time to know whether it has rung the bell correctly. If a mock object is used in place of the real object, it can be programmed to provide the bell-ringing time (whether it is actually that time or not) so that the alarm clock program can be tested in isolation.

Technical details
Mock objects have the same interface as the real objects they mimic, allowing a client object to remain unaware of whether it is using a real object or a mock object. Many available mock object frameworks allow the programmer to specify which, and in what order, methods will be invoked on a mock object and what parameters will be passed to them, as well as what values will be returned. Thus, the behavior of a complex object such as a network socket can be mimicked by a mock object, allowing the programmer to discover whether the object being tested responds appropriately to the wide variety of states such objects may be in.

Mocks and fakes
Some authors draw a distinction between fake and mock objects. Fakes are the simpler of the two, simply implementing the same interface as the object that they represent and returning pre-arranged responses. Mock objects in this sense do a little more: their method implementations contain assertions of their own. This means that a true mock, in this sense, will examine the context of each call?perhaps checking the order in which its methods are called, perhaps performing tests on the data passed into the method calls as arguments.

Setting expectations
Consider an example where an authorization sub-system has been mocked. The mock object implements an isUserAllowed(task : Task) : boolean method to match that in the real authorization class. Many advantages follow if it also exposes an isAllowed : boolean property, which is not present in the real class. This allows test code easily to set the expectation that a user will, or will not, be granted permission in the next call and therefore readily to test the behaviour of the rest of the system in either case.

Similarly, a mock-only setting could ensure that subsequent calls to the sub-system will cause it to throw an exception, or hang without responding, or return null etc. Thus it is possible to develop and test client behaviours for all realistic fault conditions in back-end sub-systems as well as for their expected responses. Without such a simple and flexible mock system, testing each of these situations may be too labourious for them to be given proper consideration.

Writing log strings
A mock database object's save(person : Person) method may not contain much if any implementation code. It might or might not check the existence and perhaps the validity of the Person object passed in for saving (see fake vs. mock discussion above), but beyond that there might be no other implementation.

This would be to miss an opportunity. The mock method could add an entry to a public log string. The entry need be no more than "Person saved", or it may include some details from the person object instance, such as a name or ID. If the test code also checks the final contents of the log string after various series of operations involving the mock database then it is possible to verify that in each case exactly the expected number of database saves have been performed. This can find otherwise invisible performance-sapping bugs, for example, where a developer, nervous of losing data, has coded repeated calls to save() where just one would have sufficed.

Use in test-driven development
Programmers working with the test-driven development (TDD) method make use of mock objects when writing software. Mock objects meet the interface requirements of, and stand in for, more complex real ones; thus they allow programmers to write and unit-test functionality in one area without actually calling complex underlying or collaborating classes. Using mock objects allows developers to focus their tests on the behavior of the system under test (SUT) without worrying about its dependencies. For example, testing a complex algorithm based on multiple objects being in particular states can be clearly expressed using mock objects in place of real objects.

Apart from complexity issues and the benefits gained from this separation of concerns, there are practical speed issues involved. Developing a realistic piece of software using TDD may easily involve several hundred unit tests. If many of these induce communication with databases, web services and other out-of-process or networked systems, then the suite of unit tests will quickly become too slow to be run regularly. This in turn leads to bad habits and a reluctance by the developer to maintain the basic tenets of TDD.

When mock objects are replaced by real ones then the end-to-end functionality will need further testing. These will be integration tests rather than unit tests.

Reference:
http://en.wikipedia.org/wiki/Mock_object

Posted by 알 수 없는 사용자
,

Java Message Service

Computer/Terms 2008. 10. 20. 11:01

The Java Message Service (JMS) API is a Java Message Oriented Middleware (MOM) API for sending messages between two or more clients. JMS is a part of the Java Platform, Enterprise Edition, and is defined by a specification developed under the Java Community Process as JSR 914.

Reference:
http://en.wikipedia.org/wiki/Java_Message_Service
Posted by 알 수 없는 사용자
,

The Advanced Message Queuing Protocol (AMQP) is an open standard application layer protocol for Message Oriented Middleware. The defining features of AMQP are message orientation, queuing, routing (including point-to-point and publish-and-subscribe), reliability and security (O'Hara).

AMQP mandates the behaviour of the messaging provider and client to the extent that implementations from different vendors are truly interoperable, in the same way as SMTP, HTTP, FTP, etc. have created interoperable systems. Previous attempts to standardise middleware have happened at the API level (e.g. JMS) and this did not create interoperability (Vinoski).

Reference:
http://en.wikipedia.org/wiki/AMQP

Posted by 알 수 없는 사용자
,