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

创建网站忘记了怎么办中国建设八局 哪里的

创建网站忘记了怎么办,中国建设八局 哪里的,商丘网站建设网站推广,建正建设官方网站在大型软件开发项目中#xff0c;面向服务的体系结构非常常见#xff0c;因为它提供了可供不同团队或部门使用的功能接口。 创建用户界面时#xff0c;应应用相同的原理。 对于具有开票部门和客户管理部门等的大型公司#xff0c;组织结构图可能如下所示#xff1a; 如果计… 在大型软件开发项目中面向服务的体系结构非常常见因为它提供了可供不同团队或部门使用的功能接口。 创建用户界面时应应用相同的原理。 对于具有开票部门和客户管理部门等的大型公司组织结构图可能如下所示 如果计费部门要开发一个用于创建发票的新对话框则可能如下所示 如您所见上面的屏幕在上部引用了一个客户。 单击短名称文本字段后面的“ ..”按钮将打开以下对话框允许用户选择客户 按“选择”后客户数据将显示在发票表格中。 也可以通过简单地输入客户编号或在发票屏幕上的文本字段中输入简称来选择客户。 如果输入唯一的短名称则根本不会出现选择对话框。 而是直接显示客户数据。 只有不明确的简称会导致打开客户选择屏幕。 客户功能将由属于客户管理团队的开发人员提供。 一种典型的方法是由客户管理开发团队提供一些服务而计费部门的开发人员创建用户界面并调用这些服务。 但是这种方法涉及到这两个不同部门之间的耦合要强于实际需要。 发票只需要一个唯一的ID即可引用客户数据。 创建发票对话框的开发人员实际上并不想知道如何查询客户数据或在后台使用哪些服务来获取该信息。 客户管理开发人员应提供UI的完整部分以显示客户ID并处理客户的选择 使用JSF 2使用复合组件很容易实现。 客户管理部门和计费部门之间的逻辑接口包括三个部分 复合组件XHTML 复合组件的支持bean 侦听器界面用于处理选择结果 提供者客户管理部门 复合组件 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//ENhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtdhtml xmlnshttp://www.w3.org/1999/xhtmlxmlns:uihttp://java.sun.com/jsf/faceletsxmlns:hhttp://java.sun.com/jsf/htmlxmlns:fhttp://java.sun.com/jsf/corexmlns:compositehttp://java.sun.com/jsf/compositexmlns:icehttp://www.icesoft.com/icefaces/componentxmlns:acehttp://www.icefaces.org/icefaces/componentsxmlns:icecorehttp://www.icefaces.org/icefaces/coreui:compositioncomposite:interface namecustomerSelectionPanel displayNameCustomer Selection Panel shortDescriptionSelect a customer using its number or short namecomposite:attribute namemodel typeorg.fuin.examples.soui.view.CustomerSelectionBean requiredtrue / /composite:interfacecomposite:implementationui:param namemodel value#{cc.attrs.model}/ice:form idcustomerSelectionFormicecore:singleSubmit submitOnBlurtrue /h:panelGroup idtable layoutblocktabletrtdh:outputLabel forcustomerNumbervalue#{messages.customerNumber} //tdtdh:inputText idcustomerNumbervalue#{model.id} requiredfalse //tdtdnbsp;/tdtdh:outputLabel forcustomerShortNamevalue#{messages.customerShortName} //tdtdh:inputText idcustomerShortNamevalue#{model.shortName} requiredfalse //tdtdh:commandButton action#{model.select}value#{messages.select} //td/trtrtdh:outputLabel forcustomerNamevalue#{messages.customerName} //tdtd colspan5h:inputText idcustomerNamevalue#{model.name} readonlytrue //td/tr/table/h:panelGroup/ice:form/composite:implementation/ui:composition/html 复合组件的后备bean package org.fuin.examples.soui.view;import java.io.Serializable;import javax.enterprise.context.Dependent; import javax.inject.Inject; import javax.inject.Named;import org.apache.commons.lang.ObjectUtils; import org.fuin.examples.soui.model.Customer; import org.fuin.examples.soui.services.CustomerService; import org.fuin.examples.soui.services.CustomerShortNameNotUniqueException; import org.fuin.examples.soui.services.UnknownCustomerException;Named Dependent public class CustomerSelectionBean implements Serializable {private static final long serialVersionUID 1L;private Long id;private String shortName;private String name;private CustomerSelectionListener listener;Injectprivate CustomerService service;public CustomerSelectionBean() {super();listener new DefaultCustomerSelectionListener();}public Long getId() {return id;}public void setId(final Long id) {if (ObjectUtils.equals(this.id, id)) {return;}if (id null) {clear();} else {clear();this.id id;try {final Customer customer service.findById(this.id);changed(customer);} catch (final UnknownCustomerException ex) {FacesUtils.addErrorMessage(ex.getMessage());}}}public String getShortName() {return shortName;}public void setShortName(final String shortNameX) {final String shortName (shortNameX ) ? null : shortNameX;if (ObjectUtils.equals(this.shortName, shortName)) {return;}if (shortName null) {clear();} else {if (this.id ! null) {clear();}this.shortName shortName;try {final Customer customer service.findByShortName(this.shortName);changed(customer);} catch (final CustomerShortNameNotUniqueException ex) {select();} catch (final UnknownCustomerException ex) {FacesUtils.addErrorMessage(ex.getMessage());}}}public String getName() {return name;}public CustomerSelectionListener getConnector() {return listener;}public void select() {// TODO Implement...}public void clear() {changed(null);}private void changed(final Customer customer) {if (customer null) {this.id null;this.shortName null;this.name null;listener.customerChanged(null, null);} else {this.id customer.getId();this.shortName customer.getShortName();this.name customer.getName();listener.customerChanged(this.id, this.name);}}public void setListener(final CustomerSelectionListener listener) {if (listener null) {this.listener new DefaultCustomerSelectionListener();} else {this.listener listener;}}public void setCustomerId(final Long id) throws UnknownCustomerException {clear();if (id ! null) {clear();this.id id;changed(service.findById(this.id));}}private static final class DefaultCustomerSelectionListener implementsCustomerSelectionListener {Overridepublic final void customerChanged(final Long id, final String name) {// Do nothing...}}} 用于处理结果的侦听器接口 package org.fuin.examples.soui.view;/*** Gets informed if customer selection changed.*/ public interface CustomerSelectionListener {/*** Customer selection changed.** param id New unique customer identifier - May be NULL.* param name New customer name - May be NULL.*/public void customerChanged(Long id, String name);} 用户计费部门 发票Bean只是通过注入来使用客户选择Bean并使用侦听器接口连接到它 package org.fuin.examples.soui.view;import java.io.Serializable;import javax.annotation.PostConstruct; import javax.enterprise.context.SessionScoped; import javax.enterprise.inject.New; import javax.inject.Inject; import javax.inject.Named;Named(invoiceBean) SessionScoped public class InvoiceBean implements Serializable {private static final long serialVersionUID 1L;Inject Newprivate CustomerSelectionBean customerSelectionBean;private Long customerId;private String customerName;PostConstructpublic void init() {customerSelectionBean.setListener(new CustomerSelectionListener() {Overridepublic final void customerChanged(final Long id, final String name) {customerId id;customerName name;}});}public CustomerSelectionBean getCustomerSelectionBean() {return customerSelectionBean;}public String getCustomerName() {return customerName;}} 最后在发票XHTML中使用了复合组件并将其链接到注入的支持bean !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//ENhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtdhtml xmlnshttp://www.w3.org/1999/xhtmlxmlns:uihttp://java.sun.com/jsf/faceletsxmlns:hhttp://java.sun.com/jsf/htmlxmlns:fhttp://java.sun.com/jsf/corexmlns:fuinhttp://fuin.org/examples/soui/faceletsxmlns:customerhttp://java.sun.com/jsf/composite/customerui:composition template/WEB-INF/templates/template.xhtmlui:param nametitle value#{messages.invoiceTitle} /ui:define nameheader/ui:defineui:define namecontentcustomer:selection-panel model#{invoiceBean.customerSelectionBean} //ui:defineui:define namefooter/ui:define/ui:composition/html 摘要 总之用户界面中引用其他部门数据的部分应由提供数据的部门负责。 然后可以很容易地对提供的代码进行任何更改而无需对使用代码进行任何更改。 此方法的另一个重要好处是可以统一应用程序的用户界面。 显示相同数据的控件和面板始终看起来相同。 每个部门还可以为其提供的用户界面组件创建一个存储库从而使设计新对话框的过程像将正确的组件放在一起一样容易。 参考 A Java Developers Life博客上的JCG合作伙伴 Michael Schnell提供的面向服务的UI 。 翻译自: https://www.javacodegeeks.com/2012/09/service-oriented-ui-with-jsf.html
http://www.pierceye.com/news/562431/

相关文章:

  • 企业官网建站费用长沙做无痛肠镜东大医院l网站
  • 建网站资料wordpress 读书模板
  • 网站建设初学者教程成华区微信网站建设公司
  • 沈阳网站建设-中国互联商城页面
  • 成交型网站倡导公司进贤南昌网站建设公司
  • 网站跟软件有什么区别是什么点击器原理
  • 网站建设项目策划书范文杭州 网站开发公司
  • 酒店网站建设设计企业营销型网站策划
  • 用dw怎么做登录页面的网站成都微信网站建设推
  • 合肥网站建设案例美丽说网站模板
  • 大学网站建设管理办法手机网站如何推广
  • 本网站正在建设升级中常用的软件开发平台
  • 招标网站开发文档上海免费网站建站模板
  • 备案系统网站wordpress 条件查询
  • 网站建设的两个方面有网站源码如何搭建自己的网站
  • 网站建设的十点优势智慧团建电脑版登录入口官网
  • 重庆专业网站排名团队wordpress标签页模板
  • 网站模板安卓郑州网站建设氵汉狮网络
  • 想学做网站学那个软件好哪些网站可以做设计赚钱
  • 公司网站模板中英文苏州网站建设套餐
  • 威海外贸网站建设可拖拽html网页编辑器
  • 西乡塘网站建设企业vi形象设计是什么意思
  • 做服装到哪个网站拿货品质好广告软文小故事200字
  • 廊坊网站建设设计wordpress上传后如何访问
  • 禅城网站制作网站推广优化技巧大全
  • xampp做的网站能搜索吗广州外贸公司集中地
  • 茶网站建设网站的基础建设
  • 大型机械网站建设公司免费的cms视频网站
  • 杭州做网站哪家好在线设计平台都有哪些比较好用的
  • 内外网网站栏目建设方案专门做电容的网站