Monday, 20 July 2015

The Spring Framework Series(Introduction)





  1. The Spring Framework is an application framework and inversion of control container for the Java platform. The framework's core features can be used by any Java application, but there are extensions for building web applications on top of the Java EE platform.
  2. in the next few weeks we would be taking time to break this big framework into bits.. i mean bits... I have heard about theoretical jargons about inversion of control, pretty much sums up why some of us must have knocked our heads to ask if we were really in our field.. believe me a few times it does happen.. especially when u have a serious subtle bug that could have been solved only if u had slept .i.e cached web pages, semi colon in javascript, server configurations and the worst of all calling the wrong method or function...
  3. Let me explain Dependency Injection/ Inversion Of control in my little experience, stack overflow style.. LOL!!. The main aim of dependency injection is to make software components less dependent(loosely coupled rather than tightly coupled.... story for another day)..  such that a change to one part of a sofware doesnt necessarily brings it to ground zero. i would be using my great university as a big example.. im sorry if you dont know that already.. OAU!!... I joke... I joke!

  4.    




 YEAH!!!! This would work but this is a wrong design pattern!

This would work well .. BUTTTTTT......   lemme explain!

1. this is hardcoded because we have to initialize the ViceChancellor object every time we use the University class. which the dependency injection paradigm negates .. it assumes all objects are loosely coupled.

2. It is untestable as we cant Mock the classes easily.. MOCK with mockito!!!!! another story , we would see that later guys..



NOW!!! This is more like IT..

Enough of the running around.. Lets go to  Spring !

The Spring framework is divided into these parts.. One good thing about spring framework is the ability to use any of its parts without using others.



Spring Framework parts

Lets explain each in essence, We would take it part by part.. We Start with Spring Configuration.. Get all these ready before next series. 
1. Eclipse IDE
2. You must have installed maven on system and its plugin
     (http://stackoverflow.com/questions/7111483/installing-apache-maven-plugin-for-eclipse)

Contact me on twitter via @AmaCodeCode or fatimeindare@gmail,com

Wednesday, 21 January 2015

Installing NodeJS on Cloud Server and its Issues

Started this thing called NodeJs and i thought it was cool, i used it for the backend of a yet to be finished mobile-App. Cool right. i was crazy about it until i had it deployed on a borrowed cloud server(ubuntu). To Freshers lemme Explain how it is done
  STEP 1:
 Install NodeJs on the cloud server,
  apt-get install nodejs
 check version by npm -v 
STEP 2:
Transfer Code?repo Unto Cloud Server using WinSCP or other ssh third part apps
  STEP 3:
 Navigate to the folder where the nodejs code is and do a
  node filename.js 
 and what do u see? Voila ERRORS!! Intentional Apparently Ubuntu has a conflict so it uses the nodejs keyword instead of node as used on windows.

  STEP 4:
 So i tried to consume my new service on my 'borrowed ' cloud server. And it didnt work!!!! after so much happiness?This is spiritual! So i found out putty had closed connection and hence closed session to the server hence the unavailability to reach Server. So i wanted it to run forever. i searched and found this wonderful script. Wonderful,
noHup nodejs filename.js &
That worked for a while until my mochahost server decided to do a maintenance on a weekend. They did and they didnt start up my server. Crazy abi? Was i expecting them to before? So i wanted a solution. So i searched further. Got another called
Forever 
Forever does the Job perfectly, restarts your server incase of 'iranu'(errors).

 STEP 5:
 Install forever using sudo apt-get install forever --global
 DONE!!! But it doesnt recognize the NodeJs used as keyword hence it reports 'file not found' on doing a 'forever list'. So i found an alternative.
 Install node-legacy by: sudo apt-get install nodejs-legacy That fixed it. So Forever has a couple of operands: Three most important ones are : start, stop and list.
  LIST lists all the processes being run by the forever service;
Look at the circled red stuff, That is the process id;
 This can also be achieved by using the
          'ps aux| grep nodejs' 

  STOP as usual stops the process i.e
          'forever stop [process_id]', 
            equivalent to the kill -9 [ubuntuprocess_id]

  START: Starts a forever process for the nodeJs server 'forever start filename.js'

  Voila! You have Set Up That Server. !!

Tuesday, 20 January 2015

Yes I did IT

Last week i said i was gonna be writing an API, and i meant IT , Just put one up on github in a starange language called AngularJs, it is basically a Popup/menu alert with custom directives. Fun AHead just visit YES I DID.

Friday, 16 January 2015

Node JS and its attendant Interest

I dont Enjoy blogging, But for one ting in particular i get reminded of those blogs that helped me when is started this journey of self discovery. Ild start blogging today to help people too. Ild start with a grey area called NodeJs NODEJS Node Js is....... blah blah blah. i used to be a staunch hater of anything web but getting outside the four walls of the university you get to understand we are all hustlers. i am trying NodeJs for a backend job and AngularJs/HTML5 as front end and i am amazed how much the world is moving. javascript from the back? Its mindblowing, its crazy since i am an unapologetic javaist i find other technologies/ languages not me. But working over a few weeks with angular js , node js and momentjs API i notice one big thing, We have a very selfish developers ecosystem in nigeria. People contribute to API opensource to make it better, We just consume and do nothing. and so i put it to you guys, uld get my API in february, i dont know what it would be or what language but i WILL do it. enough of this yeye.