Tag Archives: Coding

Random Obscure Analogy: DTOs are like mRNA

Well, if you understood the title then you probably already know what I’m going to say.

In programming, a DTO (Data Transfer Object) is a code class that just contains data (so not really an object by the OOP definition, but we’ll let that slide). DTOs are used to pass data in an architecturally agnostic manner between different parts of a system.  For example, a DTO may be used to pass data loaded by the data access layer up the stack to the business logic layer. The two different layers may have completely different architectural structures, but they both understand the simple structure of the DTO.

In cell biology, mRNA is a nucleic acid sequence (like DNA only simpler) that carries data from the DNA inside a cell’s nucleus, out of the nucleus membrane and into the cytoplasm (the rest of the cell that is not the nucleus and contains various ‘bits’ for cell function). In the cytoplasm they are ‘read’ by ribosomes that translate the data into protein molecules.

The analogy holds because the structure of the data in the DNA in the cell nucleus is ‘configured’ for handling the splitting of the cell in two and is not compatible with the construction of the proteins (apart from anything else it’s too large to fit through the nucleus membrane), so an intermediary form is used to ferry the data between the two systems.

My general opinion is that if a mechanism is produced by evolution, it is going to be optimal enough to use in my code.

For our on-line mentoring and consultancy services, visit us on-line.

Advertisements
Tagged , , , ,