使用合適的框架後 本身須要作的4件事情

 

  1. We write if-else, switch, while, AND, OR and equalsIgnoreCase more than we know.  Our business logic depends on them.
  2. 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.
  3. 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.
  4. 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句話是赤裸裸的現實。java

 

做爲一個開發者,一個項目我以爲應該有如下幾條準則須要確認:node

 

 

 

Criteria 1: You need to build something fast.git

 

Criteria 2: You have to learn an existing system and improve upon it.github

 

Criteria 3: You have to integrate with an outside service provider to pull or push data.web

 

Criteria 4: You are able to work with limited control over presentation.spring

 

Criteria 5: And you want your system to be mature and perform well.apache

 

 

如下是列舉Spring框架的好處。session

 

 

Spring Framework

With Spring, I can build something fast. Let me give you an example.app

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 HandlebarsThymeleaf, JSP, JSTLTilesFree MarkerSiteMesh 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.

相關文章
相關標籤/搜索