مقالات

JavaBean دقیقا چیست؟

A JavaBean is just a standard

  1. ( All properties private (use getters/setters
  2. A public no-argument constructor
  3. Implements Serializable

 ....That's it. It's just a convention. Lots of libraries depend on it though

With respect to Serializable, from the API documentation:

Serializability of a class is enabled by the class implementing the java.io.Serializable interface. Classes that do not implement this interface will not have any of their state serialized or deserialized. All subtypes of a serializable class are themselves serializable. The serialization interface has no methods or fields and serves only to identify the semantics of being serializable.

In other words, serializable objects can be written to streams, and hence files, object databases, anything really.

Also, there is no syntactic difference between a JavaBean and another class -- a class defines a JavaBean if it follows the standards.

There is a term for it because the standard allows libraries to programmatically do things with class instances you define in a predefined way. For example, if a library wants stream any object you pass into it, it آ(knows it can because your object is serializable (assuming the lib requires your objects be proper JavaBeans

Content Link

این مقاله برایتان مفید بود؟

نظرها هنوز نظری ثبت نشده

برای ثبت نظر، صفحه را در مرورگر باز کنید.

مقالات دیگر

‏HashiCorp Vault چیست؟ راهنمای جامع مدیریت رازها از مفاهیم تا استقرار Production با Docker

راهنمای جامع و کاربردی مدیریت secret ها با HashiCorp Vault: تاریخچه، تغییر مجوز به BSL، OpenBao و خرید HashiCorp توسط IBM، مفاهیم Seal/Unseal و Raft، توکن و Policy، AppRole و Kubernetes، رازهای پویا، PKI و Transit، راه‌اندازی با Docker Compose و TLS، اتصال Spring Boot و چک‌لیست Production.

‏پراکسی و Reverse Proxy چیست؟ راهنمای جامع Nginx از مفاهیم تا پیکربندی Production

راهنمای جامع و کاربردی پراکسی سرور به زبان ساده: تفاوت پراکسی فوروارد، معکوس و شفاف، انواع HTTP و SOCKS، الگوریتم‌های توزیع بار و آموزش کامل Nginx شامل نصب، ساختار پیکربندی، Reverse Proxy، SSL با Let's Encrypt، WebSocket، کش، محدودیت نرخ، هدرهای امنیتی و عیب‌یابی خطاهای 502 و 504.

‏WSO2 چیست؟ راهنمای جامع نصب API Manager با Docker، پیکربندی SSL و استقرار Production

راهنمای کامل و کاربردی WSO2: آشنایی با شرکت و محصولاتش، معماری API Manager نسخه‌ی 4.7، نصب با Docker و Docker Compose، پیکربندی deployment.toml، راه‌اندازی SSL با Let's Encrypt و Nginx، نکات استقرار Production و مقایسه با رقبا.