For faster navigation, this Iframe is preloading the Wikiwand page for Plain Old CLR Object.

Plain Old CLR Object

POCO es un acrónimo de Plain Old CLR Object. Es un juego de palabras del POJO de la plataforma Java, y es utilizado por los desarrolladores de la plataforma .NET Framework.

Un POJO (Plain Old Java Object) es una sigla creada por Martin Fowler, Rebecca Parsons y Josh MacKenzie en septiembre de 2000 y utilizada por programadores Java para enfatizar el uso de "viejas" clases simples (planas) que no dependen de un framework en especial.

Similar al contexto de Java, el término POCO se utiliza para contrastar un objeto "estándar" de un objeto que está diseñado para ser utilizado con un complicado framework de objetos, tal como un ORM, o bien para diferenciarlo de un objeto COM+ (ver COM).

Estos términos siguen la línea de otras siglas similares, como POTS (Plain Old Telephone System) o PODS (Plain Old Data Structures) utilizada para describir a simples "struct" en el contexto de la programación C++.

Ejemplo

[editar]
// ¡Esta clase no es una clase POCO! 
public class Person : IDisposable
{
    private static readonly ILogger Logger = LoggerFactory.Create(typeof(Person));
    public Person() {}
    public Person(int id, string firstName, string lastName, DateTime birthDate)
    {
        Id = id;
        FirstName = firstName;
        LastName = lastName;
        BirthDate = birthDate;
    }
    
    [Category("Data")]
    public int Id { get; set; }
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public DateTime BirthDate { get; set; }

    public string GetName()
    {
        return $"{FirstName} {LastName}";
    }

    public override string ToString() 
        => $"Id:{Id}, FirstName:{FirstName}, LastName:{LastName}, BirthDate:{BirthDate}";
        
    public void Dispose() {/* Code...*/}
}

// Esta clase es una clase POCO.
public class Person
{
    public int Id { get; set; }
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public DateTime BirthDate { get; set; }
}
{{bottomLinkPreText}} {{bottomLinkText}}
Plain Old CLR Object
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?