ETHAN'S BLOG

"This cow gets stuck in a chair"

Deploy Octpress

To relase me:

rysnc then at my root fold do rake genrate rake watch

1
2
rake generate
rake watch

Some Comments Regarding Spring vs Rails

For the starters, couple reasons that Spring is better than Ruby on Rails. Reason1: Routes Service - Complex routers Ruby on Rails Given link:

1
%a{:href => export_path} Export_Link

/config/routes.rb:

1
2
3
4
5
6
7
8
9
   match ‘/export’ => ‘PatientController#exportservice’
$rake routes:
export /export(.:format) {:controller=>”PatientController”, :action=> ”export”}
/app/controller/patients_controller.rb:
Class Patientcontroller < ApplicationController
  def exportservice
    puts “export executed”  
  end
end

Spring Given link:

1
<a href = ‘/dbo/patient/export.html’> Export_link </a>

/dbo/patientController.java:

1
2
3
4
5
6
7
8
9
@Controller
@RequestMapping("/dbo/patient/\*")
public class PatientCOntroller extends AbstractDboController{
  @RequestMapping(value=”export.html”, method=RequestMethod(GET))
  public ModelAndView exportService(){
    System.out.println(‘exported excuted’);
    Return new ModelAndView(“dbo/patient/export.jsp”);
  }
}

Reason2: Database Service - ActiveRecord vs Hibernate Ruby on Rails

1
2
3
4
@patients = Patient.all
@patients.each do |patient|
    return paitent.paient_name
end

Spring

1
2
3
4
5
@Autowired
private DboDaoService dboDaoService;
public String function(){
    return dboDaoService.getPatientService().getPaitent_Name();
}

Reason3: Model Initialization - Crazy ruby syntax Ruby on Rails app/model/patient.rb:

1
2
3
4
5
6
class Patient < ActiveRecord :: Base
belongs_to :MRN
  def exportService
    return “activated”
  end
end

app/controller/patients_controller.rb:

1
puts Patient.new.exportService

Spring src/main/java/package/dbo/exporter/patient.java:

1
2
3
4
5
6
7
8
9
10
@Service
public class Patient implements PetientService {
    public String exportService(){
        return “activated”;
    }
}
src/main/java/package/dbo/exporter/patientService.java:
public interface PatientService{
    public String exportService();
}

src/main/java/package//dbo/patientController.java:

1
2
3
4
5
6
7
8
9
10
11
12
@Autowired
private patientService PatientService

@Controller
@RequestMapping(“/dbo/patient/\*”)
public class PatientCOntroller extends AbstractDboController{
  @RequestMapping(value=”export.html”, method=RequestMethod(GET))
  public ModelAndView exportService(){
    System.out.println(patientService.exportService());
    Return new ModelAndView(“dbo/patient/export.jsp”);
  }
}