使用合适的框架后 自己需要做的4件事情
2017-03-16 11:47
267 查看
We write if-else, switch, while, AND, OR and equalsIgnoreCase more than we know. Our business logic depends on them.
We also do some reading from / writing to a persistent store in most of our projects. We write to the files. We write to cache, in-memory or session. We write to the database. We write to a stream (byte or character). We write to the indexer (Solr, graph, nodes). And then we read from it all.
We leverage maps and lists for the rest of the code. We store things as key value pair. We iterate over a map or list in most of our projects. We iterate over objects which come from various sources in these lists or map. We iterate over items from the persistent stores I mentioned above.
We figure out a way to send the data that we played with in three steps above all the way up to the browser. This exchange of data is web development. Web Frameworks make this possible.
上面的4句话是赤裸裸的现实。
作为一个开发者,一个项目我觉得应该有以下几条准则需要确认:
Criteria 1: You need to build something fast.
Criteria 2: You have to learn an existing system and improve upon it.
Criteria 3: You have to integrate with an outside service provider to pull or push data.
Criteria 4: You are able to work with limited control over presentation.
Criteria 5: And you want your system to be mature and perform well.
以下是列举Spring框架的好处。
I am learning Cassandra for one of my projects. I spent couple hours learning how to setup Cassandra and understanding CQL.
I am already familiar with Spring Data for MongoDB and Oracle. Bringing Spring Data for Cassandra was as simple as pulling ‘Cassandra’ dependency Jar.
The Spring Initializer generated jar came with a unit test. I added Cassandra properties and an example I copied from the web. Voila! I am in business. Maybe I will do a video showing this next.
With Spring, I can work with an existing system and improve it.
Most of my projects involved taking an existing system and enhancing it with Spring. Spring Framework allowed me to not disrupt any existing behavior but build in parallel. I migrated to Spring in increments.
With Spring, I can integrate my application to expose to or pull from third party services.
I can give you a number of examples here.
I used to work with Axis2 and brought Spring to expose my service as SOAP.
I had an existing Spring MVC application and leveraged same service to expose as a REST resource.
Spring allows me to switch between JAX-RS Implementations.
Spring allows me to switch between databases with minimal code changes.
With Spring, I can work with any front-end technology.
I have worked with Struts, jQuery, AngularJS, Tapestry and JSF with Spring as a backbone. I worked with Handlebars, Thymeleaf, JSP, JSTL, Tiles, Free Marker, SiteMesh and Velocity templates. Speaking of AngularJS + Spring, check out jHipster.
With Spring, I get a mature framework.
This beats almost all the other criteria above. And I can say this separates Spring Framework from the rest of the offerings out there in any language.
I can bring upcoming technologies into Spring and later swap it with others if needed. Without disturbing the underlying architecture.
You could use Spring framework for web applications. You could use Spring as an MVC framework which is only one part of its offering. You could use it as a backbone for integrating all layers.
Spring provides full stack flexibility in my projects that is hard to come by in ANY language or a framework. The thriving community has a plethora of plugins to integrate with most other prominent tools.
You could take these same criteria, apply it to any language and identify winner amongst them. Remember your winner may be different than someone else’s winner for the same criteria.
We also do some reading from / writing to a persistent store in most of our projects. We write to the files. We write to cache, in-memory or session. We write to the database. We write to a stream (byte or character). We write to the indexer (Solr, graph, nodes). And then we read from it all.
We leverage maps and lists for the rest of the code. We store things as key value pair. We iterate over a map or list in most of our projects. We iterate over objects which come from various sources in these lists or map. We iterate over items from the persistent stores I mentioned above.
We figure out a way to send the data that we played with in three steps above all the way up to the browser. This exchange of data is web development. Web Frameworks make this possible.
上面的4句话是赤裸裸的现实。
作为一个开发者,一个项目我觉得应该有以下几条准则需要确认:
Criteria 1: You need to build something fast.
Criteria 2: You have to learn an existing system and improve upon it.
Criteria 3: You have to integrate with an outside service provider to pull or push data.
Criteria 4: You are able to work with limited control over presentation.
Criteria 5: And you want your system to be mature and perform well.
以下是列举Spring框架的好处。
Spring Framework
With Spring, I can build something fast. Let me give you an example.I am learning Cassandra for one of my projects. I spent couple hours learning how to setup Cassandra and understanding CQL.
I am already familiar with Spring Data for MongoDB and Oracle. Bringing Spring Data for Cassandra was as simple as pulling ‘Cassandra’ dependency Jar.
The Spring Initializer generated jar came with a unit test. I added Cassandra properties and an example I copied from the web. Voila! I am in business. Maybe I will do a video showing this next.
With Spring, I can work with an existing system and improve it.
Most of my projects involved taking an existing system and enhancing it with Spring. Spring Framework allowed me to not disrupt any existing behavior but build in parallel. I migrated to Spring in increments.
With Spring, I can integrate my application to expose to or pull from third party services.
I can give you a number of examples here.
I used to work with Axis2 and brought Spring to expose my service as SOAP.
I had an existing Spring MVC application and leveraged same service to expose as a REST resource.
Spring allows me to switch between JAX-RS Implementations.
Spring allows me to switch between databases with minimal code changes.
With Spring, I can work with any front-end technology.
I have worked with Struts, jQuery, AngularJS, Tapestry and JSF with Spring as a backbone. I worked with Handlebars, Thymeleaf, JSP, JSTL, Tiles, Free Marker, SiteMesh and Velocity templates. Speaking of AngularJS + Spring, check out jHipster.
With Spring, I get a mature framework.
This beats almost all the other criteria above. And I can say this separates Spring Framework from the rest of the offerings out there in any language.
I can bring upcoming technologies into Spring and later swap it with others if needed. Without disturbing the underlying architecture.
You could use Spring framework for web applications. You could use Spring as an MVC framework which is only one part of its offering. You could use it as a backbone for integrating all layers.
Spring provides full stack flexibility in my projects that is hard to come by in ANY language or a framework. The thriving community has a plethora of plugins to integrate with most other prominent tools.
You could take these same criteria, apply it to any language and identify winner amongst them. Remember your winner may be different than someone else’s winner for the same criteria.
相关文章推荐
- Curator是Netflix开源的一套ZooKeeper客户端框架. Netflix在使用ZooKeeper的过程中发现ZooKeeper自带的客户端太底层, 应用方在使用的时候需要自己处理很多事情
- 根据自己的需要适度使用Web开发框架
- 用别人的“轮子”,专注与自己的事情--CSDN的下载搜索终于使用goolge了
- 在使用JS框架之前自己写的一些工具代码
- 如何在自己工程项目中使用TouchJSON框架
- 在Drupal的form表单中使用js事件,比如onClick和onChange等,或者加载一些css样式等自己需要的杂七杂八的东西
- 使用CKEditor需要注意的事情
- Asp.Net 中使用客户端Activex控件需要注意的事情
- 设计自己的基于Selenium 的自动化测试框架-Java版(1) - 为什么selenium还需要测试框架?
- 设计自己的基于Selenium 的自动化测试框架-Java版(1) - 为什么selenium还需要测试框架?
- 汇编语言处理器面向机器的编程语言 : 汇编语言:如果自己要发明一种编程语言,那么需要做些什么事情呢?
- 在Drupal的form表单中使用js事件,比如onClick和onChange等,或者加载一些css样式等自己需要的杂七杂八的东西
- Foundation框架,几乎为我们提供了日常需要使用的所有核心实用工具类---之一
- 使用之前需要自己下载jspSmartUpload.jar包
- 使用Log时需要做和避免做的事情
- 产品需要合适自己的设计
- 动软.net代码生成器自定义模板(根据自己需要来生成数据访问类)及牛腩的动软的简单使用(原创)
- 如何在自己工程项目中使用TouchJSON框架
- PHP的 urlencode()在ThinkPHP框架中的使用需要注意的地方
- 设计自己的基于Selenium 的自动化测试框架-Java版(1) - 为什么selenium还需要测试框架?