荣耀彩票代理

IT技术互动交流平台

路由跳转的思考

来源:IT165收集  发布日期:2016-06-14 22:05:40

荣耀彩票代理YIQIETUOLIYEWUXUQIUDEJIEGOUSHEJIDOUSHISHUALIUMANG(WOJUEDEWOMENZHEIXIAODAXIAONAOWANQUANTANBUSHANGJIAGOUZHEIGECI)

荣耀彩票代理NEIWOMENXIANSHULIYIXIAWOMENXIANZAIDEYEWUCHANGJING

荣耀彩票代理MUQIANWOMENYOUYIGESHOUYAOWENTISHITIAOZHUAN

  • 书架banner是个运营位置,需要灵活可配的 各种跳转
  • 开机弹框也是个运营位置,依然需要 各种跳转
  • push,更别说了, 各种跳转
  • H5书城,运营活动H5落地页,通过Bridge还需要 各种跳转

    WOMENXIANZAISHIZENMEZUODENI?NASHUJIAbannerJULI

    FUWUQIHUIXIAFAYIGEtypeHAO,(SUIBIANJIASHE)1DAIBIAODAKAIwebview,2DAIBIAODAKAITUSHU,3DAIBIAODAKAIGERENZHONGXIN…DENGDENG,XIANGGUANCANSHUHUISUIZHEtypeDEBUTONG,XIAFABUTONGZIDUAN,YINCIDAIMAHUIZHANGZHEIYANG

    switch (type) { case 1: { //jumping code //NSString *url = /*解析对应url字段*/ //NSString *title = /*解析对应title字段*/ //NSString *ydwebview = [[ydwebview alloc]init]; ydwebview.url = url; ydwebview.navititle = title; [self.navigationController pushViewController:ydwebview animated:YES]; } break; case 2: { //balabalaba } break;

    荣耀彩票代理KEYIKANXIAWOMENDEswitchYOUDUOKONGBU

    • 书架banner跳转有6个switch,其中第一个switch有4种子switch
    • 开机弹窗有2个switch,支持能力弱
    • push,这可了不得有20个switch
    • H5bridge跳转,有10+个switch

      荣耀彩票代理NEIWOMENMEICIXINZENGJIAYIGEGONGNENGMOKUAIDESHIHOUGAIZENMEBANNI?

      荣耀彩票代理JIASHEXINZUOYIGEMOKUAIJIAO”YINGSHIMEIPINXIAOHUABAIKE”(WOHENAIKANDEYIGEWEIBOHAO╮(╯_╰)╭)

      我们就需要在书架,弹框,push,H5Bridge,四处核心跳转点全都新增代码,先要import “EnglishJoke.h” ,然后还要新增一个switch,新增一坨跳转viewcontroller的代码

      YOUMEIYOUGANJUE?what the fuck!

      荣耀彩票代理WOMENDEDAIMAJIUHAOXIANGSHIZHEIYANG,YITUANLUANMA。

      JIARUAMOKUAISHISHUJIA,TABENSHENHANYOUSHUJIAbannerDETIAOZHUANDAIMA,SUOYITAXUYAOOUHEGEZHONGTIAOZHUANMUBIAO。BIRUTIAOZHUANDAOBMOKUAISHUCHENG,XINGCHENGLE A==>B

      荣耀彩票代理JIARUBMOKUAISHISHUCHENG,TABENSHENHANYOUSHUCHENGH5BrdigeDETIAOZHUANDAIMA,SUOYITAYEXUYAOOUHEGEZHONGTIAOZHUANMUBIAO,BIRUTIAOZHUANDAOAMOKUAISHUJIA,XINGCHENGLE B==>A

      荣耀彩票代理JIARUSUOYOUMOKUAIDOUYOUZHEIZHONGDANTENGDETIAOZHUANQITAMOKUAIDEXUQIU,TAMENZHIJIANXIANGHUTIAOLAITIAOQU(MEICUO,YOUSHIHOUXUQIUJIUSHIZHEIMEDEBUJIANGDAOLI),NEIMEWOMENDEDAIMAJIEGOUJIUHUIRUTUYIYANG,SUIZHEYEWUJIEGOUDEZHUJIANPANGDA,JIUHUIBIANCHENGYIZHANGFUZADEZHIZHUWANG,NANYIWEIHU。

      结构梳理

      仔细思考一下,我们的业务需求的最直接痛点所在就是 各种跳转 ,但往深层考虑一下,这里面其实是耦合的问题,这里说的不是业务 逻辑耦合 ,而是 引用耦合 。

      • 逻辑耦合,作为程序员,作为面向对象开发的基本思路,一个业务逻辑模块,做到模块化,不把自己自身的业务逻辑与外部不相干的模块进行混杂,所有都以接口的形式提供给外部调用,这是一个最基本的设计理念,这是没有问题,也是必须要做到的
      • 引用耦合,被抽象成一个模块,外部要使用的时候势必要import这个模块的头文件,再根据头文件的api,进行调用,这无可厚非,但是如果发生这种处理需要统一跳转多个不同模块的逻辑的时候,引用耦合就会显得混乱不好管理

        荣耀彩票代理DANSHIMIANDUIZHEIZHONGDANGYINYONGOUHEYITUANLUANMADEQINGKUANGXIA,ZAIYEWUZHUJIANZHUANGDA,WOMENMIANDUIZHEYIZHANGFUZADERUTONGZHUWANGYIBANDEYINYONGGUANXIDESHIHOU,WOMENYOUGAIRUHEQUCHULI?

        QISHIYOULIANGZHONGFANGAN,DOUZAIBEIPUBIANSHIYONG

        • 中间人
        • urlroute
Tag标签:   
  • 专题推荐

About IT165 - 广告服务 - 隐私声明 - 版权申明 - 免责条款 - 网站地图 - 网友投稿 - 联系方式
本站内容来自于互联网,仅供用于网络技术学习,学习中请遵循相关法律法规