{"id":3657,"date":"2026-11-03T12:19:32","date_gmt":"2026-11-03T04:19:32","guid":{"rendered":"http:\/\/www.son-nagano.com\/blog\/?p=3657"},"modified":"2026-11-03T12:19:32","modified_gmt":"2026-11-03T04:19:32","slug":"how-to-make-a-poco-extensible-4e2b-4e79d9","status":"publish","type":"post","link":"http:\/\/www.son-nagano.com\/blog\/2026\/11\/03\/how-to-make-a-poco-extensible-4e2b-4e79d9\/","title":{"rendered":"How to make a POCO extensible?"},"content":{"rendered":"<p>If you\u2019re a supplier of Plain Old CLR Objects (POCOs), you already know how critical these lightweight, unassuming classes are to modern software development. They form the backbone of data transfer layers, domain models, and API responses across .NET ecosystems, valued for their simplicity, testability, and lack of heavy dependencies. But here\u2019s the thing: many POCOs shipped by suppliers like me stop short of solving a common pain point for developers\u2014rigidity. When a developer needs to extend a POCO to add context-specific logic, integrate with legacy systems, or support new features, a brittle, hard-coded POCO can become a roadblock, forcing them to rewrite core code or work around messy workarounds. <a href=\"https:\/\/www.joylifevape.com\/disposable-vapes\/poco\/\">POCO<\/a><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.joylifevape.com\/uploads\/47976\/small\/razz-bar-600003542b.jpg\"><\/p>\n<p>As someone who\u2019s been manufacturing POCOs for enterprise and startup clients alike for over eight years, I\u2019ve seen firsthand how a one-size-fits-all approach can derail projects. A client in fintech once came to me after their initial POCO supplier delivered <code>Transaction<\/code> classes locked down with private setters and sealed methods\u2014when their team needed to add a blockchain verification property for cross-border payments, they couldn\u2019t extend the POCO without breaking their dependency injection setup. Another client in healthcare struggled with <code>Patient<\/code> POCOs that lacked virtual methods for updating care plan notes, forcing their devs to write custom wrapper classes that added 30% more code and slowed down their HIPAA compliance audits.<\/p>\n<p>That\u2019s why I\u2019ve built my business around crafting extensible POCOs\u2014classes designed from the start to adapt to a developer\u2019s unique needs without sacrificing the simplicity that makes POCOs so popular. It\u2019s not just about adding a few public methods here or there; it\u2019s about embedding flexibility into the POCO\u2019s DNA through intentional, developer-centric design. Over the years, I\u2019ve refined this approach into a set of actionable principles that I use for every POCO I supply, and today I want to share those insights with anyone navigating the same rigidity challenges.<\/p>\n<p>Let\u2019s start with the basics: what makes a POCO extensible? It boils down to three core pillars that prevent your POCO from becoming a dead end. First, avoid unnecessary sealing. Sealing a class or its members might feel like a quick way to enforce stability, but it eliminates the single most common path for extension: class inheritance. Second, prioritize loose coupling. If your POCO references concrete implementations of external libraries instead of abstractions, developers can\u2019t swap those implementations out for their own, limiting how they can extend the object\u2019s behavior. Third, design for partial updates. Many developers use POCOs with tools like Entity Framework Core or JSON APIs that rely on partial changes, so if your POCO locks down all setters or requires full object resets, it breaks these workflows.<\/p>\n<p>Let\u2019s dive into how I put these pillars into practice, with concrete examples of the mistakes I\u2019ve seen suppliers make, and the fixes that turn a basic POCO into an extensible asset.<\/p>\n<p>First, reimagine class design: skip the seal, embrace virtual members. Early in my career, I worked with a supplier that delivered <code>User<\/code> POCOs marked as <code>sealed<\/code>\u2014a choice that made sense for their internal codebase, but a nightmare for their clients. When a client wanted to add a <code>SubscriptionTier<\/code> property and override the <code>IsActive()<\/code> method to check both their original <code>LastLoginDate<\/code> and the new subscription status, they couldn\u2019t. The sealed class blocked inheritance, so they had to create a <code>ExtendedUser<\/code> wrapper class that duplicated the original <code>User<\/code>\u2019s logic, leading to bugs when the original POCO was updated.<\/p>\n<p>That\u2019s why every POCO I supply is unsealed by default\u2014unless a client explicitly requests sealing for a specific use case, and even then, I document clear paths for extension that work around that seal. For members that need customization, I add virtual methods and protected setters, not just public ones. Take a <code>Product<\/code> POCO I designed for an e-commerce client: originally, the <code>GetPrice()<\/code> method was hard-coded to return a base price, but I made it virtual so a client could override it to add tax, shipping, or discount logic without modifying the original POCO. The <code>Price<\/code> property has a protected setter, so developers can set its value in derived classes or constructor overloads, but not directly from external code unless they intentionally expose that access.<\/p>\n<p>I also avoid private fields unless they\u2019re critical to core POCO functionality. If I need a backing field for a property, I make it protected instead of private, so derived classes can modify the value if needed without rewriting the entire POCO. For example, in an <code>Order<\/code> POCO, the <code>OrderDate<\/code> has a protected backing field; a logistics client extended the POCO to add a <code>ScheduledShipDate<\/code> property and overrode the <code>CalculateFulfillmentDeadline()<\/code> method to use both dates, instead of having to create a separate field to track the original <code>OrderDate<\/code> value.<\/p>\n<p>Second, use abstractions instead of concrete dependencies to keep coupling low. One of the biggest anti-patterns I see in POCOs from suppliers that aren\u2019t focused on extensibility is hard-coded references to concrete libraries. A common example is a <code>Notification<\/code> POCO that uses a concrete <code>EmailService<\/code> class instead of an interface. If a developer needs to extend the <code>Notification<\/code> POCO to support SMS or in-app notifications, they can\u2019t swap out the <code>EmailService<\/code> without rewriting the POCO\u2019s core code.<\/p>\n<p>For my POCOs, I always rely on abstractions from the start, not just as an afterthought. When I supply a <code>Alert<\/code> POCO that needs to send notifications, I define an <code>INotificationService<\/code> interface as part of the POCO\u2019s assembly, not a third-party library, so developers can implement their own version of the interface to fit their stack. The POCO has a virtual <code>SendNotification()<\/code> method that accepts an <code>INotificationService<\/code> parameter, so a developer can extend the POCO to pass a custom service (like a push notification service for mobile apps) without modifying the original <code>Alert<\/code> class.<\/p>\n<p>I also avoid including functionality in POCOs that belongs to external systems. A common mistake is adding Entity Framework Core attributes like <code>[Required]<\/code> or <code>[Key]<\/code> directly to POCO properties. While these attributes work well for database mapping, they lock the POCO into a specific ORM, making it impossible for a developer using Dapper or a different database tool to extend the POCO without removing or overriding those attributes. Instead, I design POCOs with basic, system-agnostic properties, and provide optional metadata packages that include ORM-specific attributes for clients that need them. That way, the core POCO remains flexible, and clients can add metadata only for the tools they use.<\/p>\n<p>Third, design for partial updates and immutability with intent. Immutability is a selling point for many POCOs, as it ensures data consistency, but overdoing it can kill extensibility. A supplier that marks all setters as private or creates immutable records without providing a way to update specific properties forces developers to create copy-constructor patterns or use object mappers for even minor changes. For example, a <code>Customer<\/code> POCO that\u2019s an immutable record with a <code>UpdateEmail()<\/code> method is great for simple use cases, but if a developer needs to update just the <code>Email<\/code> property in a JSON API request, they have to send the entire <code>Customer<\/code> object, which is inefficient and can lead to large payloads.<\/p>\n<p>That\u2019s why I use what I call \u201cintentional immutability\u201d for my POCOs: I mark core, unchanging properties (like <code>CustomerId<\/code> for a database record) as having protected setters, while changing properties (like <code>Email<\/code> or <code>PhoneNumber<\/code>) have public setters. For immutable POCOs designed for domain models, I provide optional builder classes that let developers extend the POCO with new properties and still use the builder pattern to create instances. For example, a <code>Booking<\/code> POCO has a builder that includes a <code>AddExtraService()<\/code> method; a travel client extended the <code>Booking<\/code> POCO to add a <code>LuggageWeight<\/code> property, and used the builder to add that to the existing booking logic without rewriting the builder\u2019s core functionality.<\/p>\n<p>I also support partial updates by making POCOs compatible with tools that rely on change tracking, like Entity Framework Core\u2019s <code>Update()<\/code> method. That means avoiding <code>readonly<\/code> fields unless they\u2019re truly immutable, and ensuring that property setters are accessible to frameworks that track changes. For clients that need more granular control, I add virtual methods like <code>MarkAsModified()<\/code> that can be overridden in derived classes to integrate with their change tracking systems.<\/p>\n<p>But how do you test that your extensible POCO actually works for developers? Over the years, I\u2019ve learned that designing extensibility in the lab is one thing, but proving it works for real-world use is another. That\u2019s why I include comprehensive extension examples with every POCO I supply, so developers can see exactly how to inherit, override, and extend the POCO without breaking core functionality. For the <code>Transaction<\/code> POCO I mentioned earlier, I provide a sample extension that adds a <code>BlockchainHash<\/code> property and overrides the <code>Validate()<\/code> method to check the hash, so a fintech client can use that sample as a starting point instead of building their own from scratch.<\/p>\n<p>I also run regression tests for every POCO\u2019s extensibility. Whenever I update a POCO, I test that derived classes and overridden methods still work as intended, to prevent changes in the core POCO from breaking client extensions. For example, when I updated the <code>Order<\/code> POCO to add a <code>DiscountCode<\/code> property, I ran tests to ensure that the derived <code>InternationalOrder<\/code> class that overrides <code>CalculateFulfillmentDeadline()<\/code> still worked correctly, and that clients who had extended the POCO with custom logic didn\u2019t encounter unexpected bugs.<\/p>\n<p>None of this is to say that extensibility comes at the cost of stability. The POCOs I supply are still lightweight, still testable, still free of heavy dependencies\u2014they just give developers the flexibility to adapt them to their unique needs without starting from scratch. I\u2019ve worked with clients who\u2019ve extended my POCOs to support everything from healthcare patient records with HIPAA-mandated audit fields to e-commerce products with custom pricing tiers, and every time, the core POCO has remained intact, so when they update their system, they don\u2019t have to rework all their custom extensions.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.joylifevape.com\/uploads\/47976\/atvs-warship-18000-puffs815ee.jpg\"><\/p>\n<p>If you\u2019re a developer who\u2019s struggled with rigid POCOs that limit your project\u2019s potential, or if you\u2019re a business looking for a POCO supplier that prioritizes flexibility as much as quality, I\u2019d love to walk through how my approach can work for your team. We can review your current POCO needs, share a sample of my extensible POCO libraries, and talk through how to design a POCO solution that grows with your project. There\u2019s no one-size-fits-all when it comes to POCOs, and that\u2019s exactly why I focus on building extensible options that give you the control you need.<\/p>\n<hr \/>\n<p><a href=\"https:\/\/www.joylifevape.com\/disposable-vapes\/\">Disposable Vapes<\/a> References:<\/p>\n<ol>\n<li>Freeman, S., &amp; Pryce, N. (2018). Growing Object-Oriented Software, Guided by Tests. Pearson Education.<\/li>\n<li>Fowler, M. (2003). Patterns of Enterprise Application Architecture. Addison-Wesley.<\/li>\n<li>Microsoft Docs. (2024). Extensible Types in .NET. Retrieved from official Microsoft developer resources.<\/li>\n<\/ol>\n<hr>\n<p><a href=\"https:\/\/www.joylifevape.com\/\">Hongkong Voles Technology Co., Ltd.<\/a><\/p>\n<p>Address: Room 302, Tower A, Liangao Business Building, Bao&#8217;an District, Shenzhen City<br \/>E-mail: sales02@volestech.com<br \/>WebSite: <a href=\"https:\/\/www.joylifevape.com\/\">https:\/\/www.joylifevape.com\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you\u2019re a supplier of Plain Old CLR Objects (POCOs), you already know how critical these &hellip; <a title=\"How to make a POCO extensible?\" class=\"hm-read-more\" href=\"http:\/\/www.son-nagano.com\/blog\/2026\/11\/03\/how-to-make-a-poco-extensible-4e2b-4e79d9\/\"><span class=\"screen-reader-text\">How to make a POCO extensible?<\/span>Read more<\/a><\/p>\n","protected":false},"author":354,"featured_media":3657,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3620],"class_list":["post-3657","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-industry","tag-poco-4fcc-4ecd0e"],"_links":{"self":[{"href":"http:\/\/www.son-nagano.com\/blog\/wp-json\/wp\/v2\/posts\/3657","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.son-nagano.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.son-nagano.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.son-nagano.com\/blog\/wp-json\/wp\/v2\/users\/354"}],"replies":[{"embeddable":true,"href":"http:\/\/www.son-nagano.com\/blog\/wp-json\/wp\/v2\/comments?post=3657"}],"version-history":[{"count":0,"href":"http:\/\/www.son-nagano.com\/blog\/wp-json\/wp\/v2\/posts\/3657\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.son-nagano.com\/blog\/wp-json\/wp\/v2\/posts\/3657"}],"wp:attachment":[{"href":"http:\/\/www.son-nagano.com\/blog\/wp-json\/wp\/v2\/media?parent=3657"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.son-nagano.com\/blog\/wp-json\/wp\/v2\/categories?post=3657"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.son-nagano.com\/blog\/wp-json\/wp\/v2\/tags?post=3657"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}