Code Monkey home page Code Monkey logo

reactivecocoa-mvvm-afnetworking-fmdb's Introduction

ReactiveCocoa-MVVM-AFNetworking-FMDB

ReactiveCocoa-MVVM-AFNetworking-FMDB小项目框架设计。需要自行 pod install

详细介绍见:

小项目框架设计(ReactiveCocoa+MVVM+AFNetworking+FMDB)

工程目录

  1. 【Module】+【Model】

    在这个目录中,比较核心的是【Module】与【Model】,他们组成了整个MVVM框架。

    【Module】与【Model】均包含【Base】,其中有BaseModelBaseViewModelBaseViewController。在开发中,我还是习惯无论是否需要基类,都去写一个。难免开发之初就考虑到,也难免之后需求会变更。

  2. 【Interface】接口

    这是借鉴了Java中的接口**,目的是为了统一方法名。例如里面的SQLInterface.h文件,就是一个对数据进行CRUD操作的protocol,并且可以规定里面的方法是否必须实现。

  3. 【Configuration】配置

    对项目的一些基本配置,如基本宏定义、常量、通知名,亦或是Cell的identifier。宏定义中一般包含项目基本属性,如:主色调、常用方法等。

    在提供的Demo中,我将SQL语句放在了SQL.h中,是因为SQL只有一个文件在引用,其中的定义方式是:

     static NSString * const selectArticleSQL = @"SELECT * FROM article";

    NotificationNames.h会在大部分文件中用到,所以使用UIKIT_EXTERN定义为了全局变量:

     -----.h
     
     UIKIT_EXTERN NSString * const LoadAllNotification;
     
     -----.m
     
     NSString * const LoadAllNotification = @"LoadAllNotification";
     

  4. 【Category】类目

    项目中没有打包的类目,例如给三方或系统类新增的一些方法。

最后

每个项目完后,都会有很多收获,有很多东西需要整理总结。写这篇博客的原因有两个:

原因之一:因为我在开发过程中踩了不少坑,可能开发到中途,发现框架设计不好。框架如何设计,并没有一个标准答案,而且设计**,还需要在不断实践中得出,所以每次总结,是为了给自己看,也是为了帮到其他有同样困扰的朋友。

原因之二:也正是因为我不知道框架到底怎么样,所以写出来,让大家看看,都多多提出建议。谢谢。

reactivecocoa-mvvm-afnetworking-fmdb's People

Contributors

saitjr avatar

Watchers

James Cloos avatar tangbin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.