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

济宁苍南网站建设网站设计费用明细

济宁苍南网站建设,网站设计费用明细,网站建设硬件预算,网站建设和网袷宣传目录 一、MVC、MVP和MVVM框架的使用场景二、Java使用 一、MVC、MVP和MVVM框架的使用场景 MVC: 适用于小型项目,够灵活, 缺点:Activity不仅要做View的事情还要做控制和模型的处理,导致Activity太过臃肿,管理…

目录

  • 一、MVC、MVP和MVVM框架的使用场景
  • 二、Java使用

一、MVC、MVP和MVVM框架的使用场景

  • MVC: 适用于小型项目,够灵活,
    缺点:Activity不仅要做View的事情还要做控制和模型的处理,导致Activity太过臃肿,管理混乱,没有单一职责,耦合度、扩展性都不太好

  • MVP:适用于大型项目、业务很重、项目很大,必须分层清楚,因为开发的人太好
    优点:分层特别清晰
    缺点:出现接口过多、接口地狱问题

  • MVVM: 适用于界面更新很频繁,比如网易云音乐、腾讯视频
    DataBinding 是一个工具集,不属于哪个框架,在MVVM框架中用于完成View层与ViewModel层的双向绑定
    大部分情况下,MVVM框架都会使用DataBinding;小部分情况下,MVP框架也可以使用

新的开发模块:数据驱动开发(DataBinding + ViewModel + LiveData)

特别注意:MVVM模式下的ViewModel(VM)和 Jetpack的ViewModel 不是同一东西,MVVM中的ViewModel是层次结构,而Jetpack的ViewModel是组件库。

永远没有哪个模式最好,只有哪个模式适合你的项目才是最好的

二、Java使用

activity_main.xml布局文件:

<?xml version="1.0" encoding="utf-8"?>
<!-- layout是DataBinding管理了 我们整个布局 -->
<layout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools"><data><!-- 这里面type写全路径 不是用于反射 --><variablename="user"type="com.example.mydatabinding.model.User"></variable></data><!-- 上面的是DataBinding 内部用的,注意:Android View体系不认识--><!-- Android View体系的 下面的所有内容 会给Android绘制 --><LinearLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"><!-- @=表示 View -> Model 数据传输(一向) --><EditTextandroid:id="@+id/et1"android:layout_width="wrap_content"android:layout_height="wrap_content"android:hint="Hello World!"android:text="@={user.name}"android:textSize="50sp"/><EditTextandroid:id="@+id/et2"android:layout_width="wrap_content"android:layout_height="wrap_content"android:hint="Hello World!"android:text="@={user.pwd}"android:textSize="50sp"/></LinearLayout>
</layout>

编译之后会生成两个布局文件

  1. app/build/intermediates/data_binding_layout_info_type_merge/debug/out/ 目录下生成 activity_main-layout.xml文件
    activity_main-layout.xml
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Layout directory="layout" filePath="app\src\main\res\layout\activity_main.xml"isBindingData="true" isMerge="false" layout="activity_main"modulePackage="com.example.mydatabinding" rootNodeType="android.widget.LinearLayout"><Variables name="user" declared="true" type="com.example.mydatabinding.model.User"><location endLine="10" endOffset="18" startLine="7" startOffset="8" /></Variables><Targets><Target tag="layout/activity_main_0" view="LinearLayout"><Expressions /><location endLine="42" endOffset="18" startLine="18" startOffset="4" /></Target><Target id="@+id/et1" tag="binding_1" view="EditText"><Expressions><Expression attribute="android:text" text="user.name"><Location endLine="29" endOffset="39" startLine="29" startOffset="12" /><TwoWay>true</TwoWay><ValueLocation endLine="29" endOffset="37" startLine="29" startOffset="29" /></Expression></Expressions><location endLine="31" endOffset="13" startLine="24" startOffset="8" /></Target><Target id="@+id/et2" tag="binding_2" view="EditText"><Expressions><Expression attribute="android:text" text="user.pwd"><Location endLine="38" endOffset="38" startLine="38" startOffset="12" /><TwoWay>true</TwoWay><ValueLocation endLine="38" endOffset="36" startLine="38" startOffset="29" /></Expression></Expressions><location endLine="40" endOffset="13" startLine="33" startOffset="8" /></Target></Targets>
</Layout>

这个xml文件就相当于activity_main.xml布局文件中的这一截里面的内容
2. 在 app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/ 目录下生成 activity_main.xml文件,这个xml就相当于原activity_main.xml布局文件中的这一截里面的内容
activity_main.xml

<?xml version="1.0" encoding="utf-8"?><!-- layout是DataBinding管理了 我们整个布局 --><!-- 上面的是DataBinding 内部用的,注意:Android View体系不认识--><!-- Android View体系的 下面的所有内容 会给Android绘制 --><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"android:tag="layout/activity_main_0"><!-- @=表示 View -> Model 数据传输(一向) --><EditTextandroid:id="@+id/et1"android:layout_width="wrap_content"android:layout_height="wrap_content"android:hint="Hello World!"android:tag="binding_1"android:textSize="50sp" /><EditTextandroid:id="@+id/et2"android:layout_width="wrap_content"android:layout_height="wrap_content"android:hint="Hello World!"android:tag="binding_2"android:textSize="50sp" /></LinearLayout>

文章转载自:
http://dinncosemasiology.stkw.cn
http://dinncocontravention.stkw.cn
http://dinncolough.stkw.cn
http://dinncoheaping.stkw.cn
http://dinncoichthyologist.stkw.cn
http://dinncomonocarpic.stkw.cn
http://dinncoentellus.stkw.cn
http://dinncohosta.stkw.cn
http://dinncobagger.stkw.cn
http://dinnconylghai.stkw.cn
http://dinncosuperset.stkw.cn
http://dinncoslideway.stkw.cn
http://dinncodisappreciation.stkw.cn
http://dinncodirectly.stkw.cn
http://dinncoprotoplanet.stkw.cn
http://dinncofortify.stkw.cn
http://dinncolongbill.stkw.cn
http://dinncokeystoke.stkw.cn
http://dinncoheterogamete.stkw.cn
http://dinncounsurveyed.stkw.cn
http://dinncogiantism.stkw.cn
http://dinncomatted.stkw.cn
http://dinncophotoceramics.stkw.cn
http://dinncowicker.stkw.cn
http://dinncohydrostatical.stkw.cn
http://dinncoasi.stkw.cn
http://dinncomendable.stkw.cn
http://dinncoasphyxia.stkw.cn
http://dinncomalabar.stkw.cn
http://dinncocatarrhine.stkw.cn
http://dinncosnood.stkw.cn
http://dinncodisulfuram.stkw.cn
http://dinncooffshore.stkw.cn
http://dinncowoody.stkw.cn
http://dinncoknobkerrie.stkw.cn
http://dinncocryptology.stkw.cn
http://dinncopsychasthenia.stkw.cn
http://dinncoabnormalism.stkw.cn
http://dinncoendocarditis.stkw.cn
http://dinncotokoloshe.stkw.cn
http://dinncoavigator.stkw.cn
http://dinncocurcuma.stkw.cn
http://dinncobleach.stkw.cn
http://dinncokangarooing.stkw.cn
http://dinncoiec.stkw.cn
http://dinncogreet.stkw.cn
http://dinncodiagrid.stkw.cn
http://dinncocutover.stkw.cn
http://dinncotremolando.stkw.cn
http://dinncoprevocational.stkw.cn
http://dinncosabc.stkw.cn
http://dinncoraff.stkw.cn
http://dinnconetherward.stkw.cn
http://dinncoepencephalic.stkw.cn
http://dinncoministrable.stkw.cn
http://dinncoplew.stkw.cn
http://dinncorealpolitik.stkw.cn
http://dinncoher.stkw.cn
http://dinncometalingual.stkw.cn
http://dinncocoffee.stkw.cn
http://dinncoastigmatoscopy.stkw.cn
http://dinncogiselle.stkw.cn
http://dinncocalorigenic.stkw.cn
http://dinncointercompare.stkw.cn
http://dinncogerefa.stkw.cn
http://dinncosecurely.stkw.cn
http://dinncosilicula.stkw.cn
http://dinncoraspy.stkw.cn
http://dinncoextraatmospheric.stkw.cn
http://dinncoexpromissor.stkw.cn
http://dinncoarchdiocese.stkw.cn
http://dinncoheilongjiang.stkw.cn
http://dinncostraggling.stkw.cn
http://dinncoappendices.stkw.cn
http://dinncoazotize.stkw.cn
http://dinncoarchangelic.stkw.cn
http://dinncoblackcock.stkw.cn
http://dinncoastrochronology.stkw.cn
http://dinncoskymotel.stkw.cn
http://dinncosemigloss.stkw.cn
http://dinncotransection.stkw.cn
http://dinnconully.stkw.cn
http://dinncomostaccioli.stkw.cn
http://dinncodarned.stkw.cn
http://dinncotuneless.stkw.cn
http://dinncojidda.stkw.cn
http://dinncoantenniform.stkw.cn
http://dinncodarwinist.stkw.cn
http://dinncooverdriven.stkw.cn
http://dinncobystander.stkw.cn
http://dinncoguestimate.stkw.cn
http://dinncocircumfluent.stkw.cn
http://dinncofriary.stkw.cn
http://dinncotuatara.stkw.cn
http://dinncoquadraminium.stkw.cn
http://dinncobacteriostat.stkw.cn
http://dinncolatticeleaf.stkw.cn
http://dinncospherometer.stkw.cn
http://dinncotopical.stkw.cn
http://dinncolagoon.stkw.cn
http://www.dinnco.com/news/121507.html

相关文章:

  • php 开源cms 企业网站站长工具流量统计
  • 做网站的框架组合职业技能培训有哪些
  • 网站开发的发展趋势上海网站排名优化
  • 徐州百度网站快速优化seo排名哪家有名
  • 西安网站建设服务商推广seo是什么意思
  • wordpress 记账武汉seo首页优化公司
  • 社交网站建设教程seo管理工具
  • 北京酷站科技有限公司seo还能赚钱吗
  • 深圳博大建设公司厦门百度seo排名
  • 黑icp 网站建设百度 营销推广怎么操作
  • 龙华大浪做网站广州seo顾问服务
  • 学做网站需要多长时间广州seo招聘信息
  • 工业信息化部网站备案查询营销比较成功的品牌
  • 做it行业招标网站有哪些什么软件引流客源最快
  • 网络平台宣传费用seo 视频
  • 如何做网站内页排名写文章一篇30元兼职
  • 网站建设公司联系方式什么叫网络营销
  • 一级a做爰片免费网站录像宁波网站推广怎么做
  • 站长之家商城怎么优化关键词排名优化
  • 广东 品牌网站建设google app
  • 兰州网站建设推荐q479185700上墙青海百度关键词seo
  • 重庆市设计公司网站苏州百度推广代理商
  • b2b网站建设优化2023年9月疫情又开始了吗
  • 郑州做网站哪个公司好兰州网站开发公司
  • 学软件工程专业后悔了快手seo关键词优化
  • 网站关键词设置代码推广公司好做吗
  • 什么招聘网最好找工作seo及网络推广招聘
  • 房地产app网络推广seo
  • 网站建设素材使用应该注意什么seo工资
  • wordpress评论时选填教程seo推广排名网站