当前位置: 首页 > news >正文

做网站使用字体图标化工材料 技术支持 东莞网站建设

做网站使用字体图标,化工材料 技术支持 东莞网站建设,推广的公司,成立一个网站需要多少钱什么是POJO#xff0c;JavaBean#xff1f;总结#xff1a;POJO#xff1a;一个简单的Java类#xff0c;这个类没有实现/继承任何特殊的java接口或者类#xff0c;不遵循任何主要java模型#xff0c;约定或者框架的java对象。在理想情况下#xff0c;POJO不应该有注解。…什么是POJOJavaBean总结POJO一个简单的Java类这个类没有实现/继承任何特殊的java接口或者类不遵循任何主要java模型约定或者框架的java对象。在理想情况下POJO不应该有注解。JavaBeanJavaBean是可序列化的实现了serializable接口具有一个无参构造器有按照命名规范的set和gettis(可以用于访问布尔类型的属性)方法pojoPOJO的创始人(martinfowler)博客The term was coined while Rebecca Parsons, Josh MacKenzie and I were preparing for a talk at a conference in September 2000. In the talk we were pointing out the many benefits of encoding business logic into regular java objects rather than using Entity Beans. We wondered why people were so against using regular objects in their systems and concluded that it was because simple objects lacked a fancy name. So we gave them one, and its caught on very nicely....在谈话中我们指出编写业务逻辑的时候使用常规的java对象要比实体bean要好的多。我们怀疑为什么一些人极力反对在他们的代码中使用常规对象还辩解称因为这些常规对象没有一个花哨的名字所以我们给他们起了一个非常好听的名字。(Plain Old Java Object)维基百科原文————(以下代码和示例均来源于此)The term POJO initially denoted a Java object which does not follow any of the major Java object models, conventions, or frameworks; nowadays POJO may be used as an acronym for Plain Old JavaScript Object as well, in which case the term denotes a JavaScript object of similar pedigree.[2]术语POJO起初表示为不遵任何主要的java模型约定或者框架的java对象现在pojo也可以用作Plain Old JavaScript Object的缩写这样的话和javascript对象有着相似的渊源。理想状态下pojo应该是一个不受Java语言规范限制的java对象。换句话说pojo不应该1.继承预先设定的类如public class Foo extends javax.servlet.http.HttpServlet {// ...}2.实现预先设定的接口如public class Bar implements javax.ejb.EntityBean {// ...}3.包含预先指定的注解如javax.persistence.Entitypublic class Baz {// ...}However, due to technical difficulties and other reasons, many software products or frameworks described as POJO-compliant actually still require the use of prespecified annotations for features such as persistence to work properly. The idea is that if the object (actually class) was a POJO before any annotations were added, and would return to POJO status if the annotations are removed then it can still be considered a POJO. Then the basic object remains a POJO in that it has no special characteristics (such as an implemented interface) that makes it a Specialized Java Object (SJO or (sic) SoJO).然而由于技术和其他原因很多被称之为POJO标准的软件产品或框架仍然需要使用特定的注解来保证持久化等功能。这个想法是如果对象(类)在任何注解添加之前是一个pojo的话并且注解移除之后仍然是pojo。所以最基础的pojo解释是没有特别的特征(尤其是实现接口之类的)使其称之为“专用java对象”JavaBeanA JavaBean is a POJO that is serializable, has a no-argument constructor, and allows access to properties using getter and setter methods that follow a simple naming convention. Because of this convention, simple declarative references can be made to the properties of arbitrary JavaBeans. Code using such a declarative reference does not have to know anything about the type of the bean, and the bean can be used with many frameworks without these frameworks having to know the exact type of the bean. The JavaBeans specification, if fully implemented, slightly breaks the POJO model as the class must implement the Serializable interface to be a true JavaBean. Many POJO classes still called JavaBeans do not meet this requirement. Since Serializable is a marker (method-less) interface, this is not much of a burden.JavaBean是一个可序列化的POJO具有一个无参构造器并且允许使用遵循简单命名约定的getter和setter方法来访问属性。由于这个惯例可以对任意JavaBean属性进行简单的声明引用。使用这种声明引用的代码不需要知道bean的具体类型。并且这个bean还可以被很多框架使用这些java框架也不需要知道bean的类型。由于java.io.Serializable是一个标记接口(无方法)所以这并不是一个多大的负担。如果JavaBean完全实现的话稍微打破了一些POJO模型。很多被称之为JavaBean的POJO类并不符合这个要求因为JavaBean必须实现Serializable接口才能成为真正的JavaBean。JavaBean的优点The properties, events, and methods of a bean can be exposed to another application.A bean may register to receive events from other objects and can generate events that are sent to those other objects.Auxiliary software can be provided to help configure a bean.The configuration settings of a bean can be saved to persistent storage and restored.bean中的属性事件和方法可以暴露给另一个应用程序一个bean可以注册来自于其他对象的事件也可以产生事件并发送给其他对象辅助代码可以提供javabean的配置一个bean的配置设置可以永远被存储和恢复一些疑问什么是事件有什么作用bean如何注册来自于其他对象的事件配置设置如何被存储和恢复serializable接口是做什么的
http://www.zqtcl.cn/news/552455/

相关文章:

  • 佛山优化网站关键词衡水专业做网站
  • 京东alexa排名seo发外链网站
  • 中国工业设计网站制作网页版权怎么修改
  • 贞丰县建设局网站一般的电脑培训班要多少钱
  • 模板网站建设清单太原网站制作电话
  • 网站建设的需求要素设计企业网站机
  • 深圳百度推广电话西安官网seo技术
  • 沈阳建站免费模板福州建设企业
  • 怎么在百度首页做网站wordpress返回前页
  • 张家口城乡建设局网站wordpress 等待响应
  • 专门设计网站的公司叫什么怎么做网站多少钱
  • 淡水网站建设健身器材 网站模版
  • 河南建设网站公司简介做新闻类网站需要什么资质
  • 网络文化经营许可证图片下载优化大师安装桌面
  • 网站cms系统教育网站开发文档
  • 用网站做淘客怎么做网站建设在电访销售话术
  • 做电影网站赚了几百万动画制作流程
  • 怎么做企业的网站首页wordpress 主机迁移
  • 网站常见问题网页设计代码开头
  • 聊城网站推广品牌推广计划描述
  • 池州网站制作优化有没有专业做特产的网站
  • wordpress采集站源码wordpress好用的会员插件
  • 寿县城乡建设局网站青岛网站建设大全
  • 杭州做网站的好公司哪家好做影视网站侵权吗
  • 自助建站网站seo公司想学编程做网站
  • 网站空间备案要多久花木公司网站源码
  • 高端求职网站排名ftontpage如何做网站
  • 音乐网站开发技术河南省住房和城乡建设门户网站
  • 吉安微信网站弋阳县建设工程网站
  • 网站建设自学建站视频教程哈尔滨全国网站建设