Wednesday, May 7, 2014

Software Engineer or Software Writer? Is TDD dead?

DHH , creator of Rails, recently wrote a blogpost saying that he is giving up on TDD. 
Big war started i think in twitter, and other sites. 

Then he gave this talk, a few days back in RailsConf (which seems to be an important Rails related conference) - 

Tip: Watch it at double-speed using the Settings in YouTube..since it is a 1hr talk.

There are several interesting points in this talk. Below are the ones that immediately come to my mind, but I will have to watch again, and improve this post:

1. Software Writers - 

Difference between 'computer science' and what typical programmers like me are working on..I think everyone has that in their mind, but he gave a new term to us - 'software writers', instead of 'software engineers', and that we should focus on clarity, readability just like writers of stories, articles do.. 

He used an analogy of piano creators vs piano players:
Computer Scientists/Software Engineers ~= people who make pianos
Software Writers ~= people who play the piano

When put like that, it really shows how different those two are.

2. Patterns are not really helpful
We become better at creating applications by writing applications, reading others' code, and in the process by developing 'an eye' for it. There is no short cut, like learning patterns etc.

3. TDD is not useful in most cases 

TDD is useful when we know exactly know what is needed - this goes in, and this has to come out. 
In cases, where we are figuring out what the app needs to do, it is not that useful, and is in fact harmful to the code (if you stop believing the idea that functions becoming testable is the ultimate goal).

4. Drafts

The first time we write a class or some unit of code that works, should be considered as a Draft (analogous to drafts of emails/articles/stories etc).
Then we should improve upon that Draft.

-----------------------------------------------------------------------------------------------------------------------------------------------------

Response from Kent Beck (it seems he invented TDD) -

Below is a comment that seems to suggest where TDD can be useful and where it is not -

Vasileios Mitrousis TDD is a perfect fit for corporate software, when all the requirements have been written down the last two years of discussion. But when working in a dynamic environment where the specs are changing every day it starts to be an overhead. On the other side, when a system is in production, TDD applied on any patches made can make you sleep well at night. I don't believe TDD it's a history, but cannot be applied to everywhere.


https://www.destroyallsoftware.com/screencasts - Unix, Vim etc related screencasts

7 simple steps to implementing a programming language

Google's web fundamentals handbook for multi-device web development

A Crash Course in Modern Hardware


10 Secrets to Becoming a Great Remote Developer

Very good tips for remote-developers like me:
http://x-team.com/2014/05/10-secrets-to-becoming-a-great-remote-developer/

Excerpts from above article:
Contribute trust every day
It all begins with trust. If you only read one thing here, I hope it’s this.

The very definition of a team is a group of individuals who are bound by trust.
Physical teams suffer from physical barriers (such as a floor for each department) which consequently create tribes and ultimately compartmentalize trust.
physical teams are still able to operate even with weakened trust.
Remote teams, however, live and die by their trust. 
Secret 1: Communicate more than you did with your first girlfriend 
And it’s not just about saying “Hello” every day. It’s about:

When you step away from your desk, you let your team know.
When you realize you’re not going to hit a deadline, you let your team know.
When you have some free time, you let your team know you’re there to help.
When you learn about some awesome new framework, you let your team know.
When you see your team falling behind or bad code getting committed, you let your team know.
You will never collaborate with developers more than on a remote dev team. You are forced to collaborate (it’s collaborate or die, really)
Secret 2: Find time for Focus
It’s really important that you cut out 3-hour blocks of time each day to do nothing but focus on the must-finish tasks of the day. It’s easier said than done, but you’ll love the feeling once you get into a rhythm of doing it consistently.
Secret 3: Find your hedgehog 
And so the idea is to do one thing, do it really well, and you will succeed in life, in your career, and in avoiding getting eaten by a fox.
So find your hedgehog in the development world. If it’s Drupal theming, do that. If it’s node.js, do that. If it’s infrastructure, do that. It doesn’t matter what it is, the point is to focus.

Why? Because companies today only need remote developers when they realize they can’t find specialized developers in their geographic location for niche development technologies.
If, on the other hand, you try to be a jack of all trades, someone who knows front-end, back-end, infrastructure, JS, PHP, .NET, everything…you’re less valuable. It’s much easier to find a jack of all trades within your geographic location. Companies that go remote have specific challenges that require a specific skillset that only hedgehogs have.
The best remote teams are filled with hedgehogs.
Secret 7: Have the right attitude
At X-Team, we have a culture of #sleepcanwait, which means our team doesn’t sleep until they’ve said: “Hey team, how can I help?”
It also makes you feel really good to say that line every day. It feels incredibly good helping out your team every day
Remote teams hire almost entirely based on attitude, because contributing trust every day all starts with having the right selfless attitude.
Secret 9: Your word is everything
When you say you’re going to get something done, you need to follow through with that, and if you can’t, then you need to let the whole team know so they can adjust their own timelines.
Remember: The second you aren’t contributing trust to the team, you won’t be on the team very long. 
Secret 10: Be proactive
If you want to know the #1 secret to contributing trust every day, here it is.
The definition of being proactive is quite simple: it means you make things happen before they become problems.
Proactive means bringing in new ideas around workflow to the team. Proactive means always keeping progress moving forward. Proactive means that you are truly ready to be on a remote team because you don’t need someone to babysit you.
Instead, you are proactive; you get up, you get to work, you know what needs to be done, you check in with your teammates often, and you keep things moving.
If you let laziness seep into your work ethic because you have so much flexibility, you will fail.

Sunday, May 4, 2014

Nice Quote


"the solution that solves all your problems is not going to be the best solution for all your problems."

Friday, May 2, 2014

iOS tutorial

A colleague pointed me towards this site:
http://www.tutorialspoint.com/ios/ios_quick_guide.htm

Has Ruby tutorial also

Thursday, May 1, 2014

A Journey of a software project & developer

Nice blogpost on medium.com -  https://medium.com/p/19784e23163b

Several interesting points like the below:
Excerpt:
"I decided to quit my part time job and work full time on the app with the hope to focus my time on it and get it out sooner. I would later realise this was a bad move and it had the opposite effect. Having the two jobs allowed me to set apart my time and therefore I could set apart my focus on them, giving me much better bursts of productivity. It forced boundaries upon me in terms of how much time I could put into the app each week. Instead, the time I had just ended up becoming one large giant blur and I got bored easily."

Monday, April 28, 2014

Abstractions & Duplication

This is a tweet from someone

Don't abstract too early. Duplication is far easier to deal with than the wrong abstraction. (OO version of YAGNI)

Thursday, April 24, 2014

Against the use of Frameworks (Javascript frameworks, ORMs etc)

Very good blogpost about  'No Frameworks' strategy. (Have to read the Comments section & follow-up bloposts as well)
http://codeofrob.com/entries/look-ma,-no-frameworks.html
Abstractions should be used because there is a pain that needs solving, whether that be because you're talking to third party code, or slow remote calls that need hiding during testing or because there is complexity that needs hiding. Putting abstractions in before we feel any of this pain just means more code to wade through when trying to get stuff done - no thanks.
This goes against current-popular-thinking as of today.

The strategy for No Frameworks would be -
We start off a project without a framework.
After a certain point, if the requirements start giving us 'pain', then we pull in a framework, whichever one is appropriate.
We'll have to refactor our existing code to use the framework.

A very important pre-requisite for the above strategy to work -
We need to know at least one or two frameworks, and know them pretty well, in order to know how they will benefit us. Otherwise, we will not know, at which point in the project, a framework could start being helpful.

Wednesday, April 16, 2014

Tools - Free tools for software teams

Except Digital Ocean, all of the below are Free, but some are freemium

Trello.com - for listing features/bugs

iDoneThis.com - for daily updates

HipChat  - Group Chat, IM - for staying in touch throughout the day
(free for teams upto 5 - https://www.hipchat.com/pricing)

Jing - quick video captures to report issues
(5min captures are free)

git & Github.com -  Source Code Management

Skype, Google Hangouts - Audio/Video calls

Skype, Teamviewer, Google Hangouts - for ScreenSharing

Teamviewer, Google Hangouts - for giving presentations to large group of people, Group Meetings

Teamviewer + Skype - Pair programming, Mob programming
(Teamviewer - in Meeting mode, we can give control to meeting-participants. This works in the free version also, so TeamViewer can be used for 'mob programming')

Digital Ocean - hosting, creating remote dev machines

Yammer.com - Enterprise Social Network

Balsamiq - Wireframing tool

Rails: start server using a port other than 3000

rails s -p 10524
This is useful when trying to run multiple rails applications during development.

Sunday, April 13, 2014

Azure - VM experiment (Ubuntu 12.04)

1. default username - azureuser  (password - what we specify while creating the VM)
2. Install Teamviewer
http://techs2resolve.blogspot.in/2013/12/how-to-install-teamviewer-9-in-ubuntu.html
3. See http://www.tonisoto.com/?p=215  for "Launching Teamviewer remotely through SSH"
teamviewer --info     -> should give the ID
and set the password using : teamviewer --passwd [PASSWD]
If not, see http://serverfault.com/questions/547206/how-to-find-my-teamviewer-id-on-ssh
To see all commands : teamviewer --help

Stuck - Not able to connect via Teamviewer

4. Alternate option to Teamviewer
http://blogs.technet.com/b/uktechnet/archive/2013/11/12/running-a-remote-desktop-on-a-windows-azure-linux-vm.aspx

Status - Able to connect via RDP, but nothing is visible on the screen


Saturday, April 12, 2014

Digital Ocean - VM experiment

Useful instructions here - http://10kb.nl/blog/setup-and-keep-up-with-the-latest-versions-of-a-complete-rails-dev-stack

0. Create droplet
0. tasksel  (and select Lubuntu )
1. Install Teamviewer
2. Add user 'sai' using 'adduser' command (because we cannot run browser as 'root')
add user sai
3. Give sudo privileges to 'sai'
 sudo usermod -a -G sudo sai
4. install Mysql (and mysql workbench)
5. install git
sudo apt-get install git-core
(https://www.digitalocean.com/community/articles/how-to-install-git-on-ubuntu-12-04)
6. install sublime text 2
https://www.digitalocean.com/community/articles/how-to-install-git-on-ubuntu-12-04

Status - Able to connect via Teamviewer; Have to install Ruby, RVM etc
Problems - LXTerminal is not working properly

To reboot - sudo reboot
To poweroff - sudo poweroff

Sunday, March 23, 2014

Button click handlers, AJAX, and premature submission

http://encosia.com/button-click-handlers-ajax-premature-submission

Excerpts:

Clicking the button did run our JavaScript code, which we can verify by seeing that the request began. However, it also triggered a form submission since that’s the browser’s default behavior when buttons inside forms are clicked.
 ... 

Putting a leash on the browser’s default behavior

There are a couple ways to tame the browser’s form submission mechanism and make the button work asynchronously, as expected.
  • return false – In almost all cases, an event handler function returning false causes the browser to cancel any subsequent behaviors that the event would normally have triggered (like submitting a form). Using return false works, but you need to be careful about where you place it since the return statement can abort your code early and it can have unintended side-effects.
  • preventDefault() – The browser sends an event parameters to handlers, which details information about the action that triggered the handler. That event object also exposes a method that prevents the browser’s default reaction to that event:preventDefault(). For click handlers on submit buttons inside forms, that includes preventing the form submission.
Since return false does have the issue of sometimes breaking other code and plugins when it stops propagation, I use preventDefault() by… default.


10 IT Admin skills every .NET developer should have before going live

Wednesday, March 19, 2014

queue.acm.org & 2006 conversation with Verner Wogels (Amazon)

queue.acm.org - seems like a very good website in general

Amazon related - https://queue.acm.org/detail.cfm?id=1142065

(Have to list some of the important points over here later)


Criticism of Agile

- Have started seeing more and more blogposts criticizing Agile.
- Perhaps the criticism (review), is inevitable because, about a decade has passed since Agile became popular.

http://mikehadlow.blogspot.co.uk/2014/03/coconut-headphones-why-agile-has-failed.html

http://effectivesoftwaredesign.com/2014/03/17/the-end-of-agile-death-by-over-simplification/ - this has more links in it

http://effectivesoftwaredesign.com/2014/01/20/attention-agile-programmers-project-management-is-not-software-engineering/ - talks about how Project-Management ideas of Agile are being used heavily but not Agile's Software-Engineering ideas

Friday, March 7, 2014

rvm issue

"You need to change your terminal emulator preferences to allow login shell."

http://stackoverflow.com/questions/10939968/why-wont-my-rvm-allow-me-to-switch-to-an-alternative-ruby

The Problem

RVM does its own installation magic, but in Ubuntu's case it doesn't always install to the right Bash startup file. You probably don't actually have RVM running properly; even though it's sort of installed.

The Fix

You need to make sure the following two lines are at the BOTTOM of your ~/.bashrc file.
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
export PATH=$PATH:$HOME/.rvm/bin
Then restart your terminal emulator or log back in. Note that sourcing ~/.bashrc has been known not to work in some cases, so this step will save your sanity.
RVM should now be working properly. The last step is to set your default Ruby.
rvm --default use 1.9.2

Important Edit

As I've just been reminded, RVM breaks Ubuntu login shells by installing ~/.bash_login, which overrides your Ubuntu ~/.profile in login shells. Move the code over to your ~/.bashrc if you haven't already done so, then remove or rename ~/.bash_login.

Tuesday, March 4, 2014

Salesforce & Ruby

http://www.citoresearch.com/cloud/direct-salesforcecom-why-we-bought-heroku
Kelman argues that eventually IT departments will recognize the power of Ruby and use it.
When they do, Salesforce.com will have the most business-friendly way to use Ruby, one that delivers Ruby as a Platform-as-a-Service, but which is connected to a mature ecosystem of business software components like Chatter, Force.com, and Database.com....
Heroku + Chatter + Force.com + Database.com

Heroku - hosting service
Chatter - enterprise social network
Force.com - application development platform
Database.com - database in the cloud

Rails: specifying a 'local' gem

Saturday, March 1, 2014

Foy Savas' methods of giving a Presentation & Blogging

Presentation/Talk technique - Great use of slides

http://www.infoq.com/presentations/savas-polyglots

Not sure how to describe the technique, but the talk just felt great to watch, with the Slides playing a very important role.

Blogging technique - 

http://www.foysavas.com/2013/12/29/why-im-rebooting-my-blog-as-outlines.html

What is the technique ?
  • His blog-posts are going to be structured as Outlines (i.e. list of points) 
How does it help the Writer during writing?
  • He says it - Forces (i.e. helps) the writer to better structure the entire blog-post
How does it help the Reader ?
  • He says it - Allows the reader to "fully absorb" the blog-post
  • I want to add that it - Makes it easier for the reader to 'study' the blog-post (i.e. re-read the points, ponder over them) 
He explains his reasoning in more detail (but, remarkably, by needing to use very few words) in his blog-post. 

Extra effort required by Writer? Yes... but it is suited for Mobile Devices....so... -
Such (well structured) blog-posts or articles will be easier to read on Mobile devices.
This can benefit the Writer immensely. That could be the payoff for spending the extra effort to structure & condense the blog-post using such a technique.


Asp.Net Web API - getting started

Sublime Text 2 extensions - 'git' , 'Github Tools', etc

Before adding any extensions:
1. it is best to install Package Control first
2. to install Package Control, I had to start Sublime Text using admin account (i.e 'sudo' in Ubuntu)

https://sublime.wbond.net/installation#st2

Some useful extensions:

git extension:
------------------
https://github.com/kemayo/sublime-text-git/wiki

Github Tools extension:
------------------------------
From Readme.md:
## Usage ##
Open any directory of your GIT working copy in Sublime Text 2.
* Press `Ctrl + Shift + P` and select `Github: Open File` or just press `Ctrl + Shift + ^` to open currently edited file in Github.
* Press `Ctrl + Shift + P` and select `Github: Blame` to open blame for currently edited file in Github.
Github Color Theme:
---------------------------
https://github.com/alexanderekdahl/github-sublime-theme

Also installed the following:
----------------------------
Color Picker - https://github.com/weslly/ColorPicker
SublimeREPL - https://github.com/wuub/SublimeREPL
BracketHighlighter -https://github.com/facelessuser/BracketHighlighter
Emmet - https://github.com/sergeche/emmet-sublime
Zen Tabs - https://sublime.wbond.net/packages/Zen%20Tabs
Git Gutter - https://github.com/jisaacks/GitGutter

Enable some features that are already in Sublime Text:
    -- we do this by changing the Preferences -> Settings - Default

From http://webdesign.tutsplus.com/articles/simple-visual-enhancements-for-better-coding-in-sublime-text--webdesign-18052

highlight_modified_tabs
To bring more focus to the unsaved files in the current project, this setting will highlight the tabs of the modified files inside a window.
"highlight_modified_tabs": true,
fade_fold_buttons
Did you know Sublime Text can fold and unfold chunks of code? I did, but I always forget that feature is available. If you turn on this setting, it will leave the folding tag to the right instead hiding it.
"fade_fold_buttons": false,

bold_folder_labels

There are some great settings available to bring some stronger visual elements to the side bar, here they are:
"bold_folder_labels": true,

Show Open Files in the Side Bar

Oddly, this option is not set up in the preferences file. To show open files on the top of your side bar, go to:
View → Side Bar → Show Open Files
-------------------------------------------------------------------------------------
Sublime Text Shortcuts:

From http://daker.me/2013/05/5-sublimetext2-packages-to-enhance-your-frontend-development-workflow.html :
Here are some useful Keyboard shortcuts to remember :
  • ctrl+d Select the next occurrence of the selected word
  • ctrl+k, ctrl+b - Toggle the sidebar
  • f11 - Toggle Full Screen
  • shift+f11 - Toggle Distraction Free (this one is my favorite)
  • alt+. - Close Tag
  • ctrl+p - Show the go to overlay panel
  • ctrl+shift+p - Show the command overlay panel
  • ctrl+alt+p - Show the project selector panel
  • ctrl+r - Show the go to overlay panel default to method selector
  • ctrl+g - Show the go to overlay panel default to go to line selector
  • ctrl+; - Show the go to overlay panel default to variable selector
  • ctrl+shift+up - Swap with the line above
  • ctrl+shift+down - Swap with the line below
  • ctrl+/ - Toggle a comment
  • ctrl+shift+/ - Toggle a comment block
  • ctrl+shift+d - Duplicate a line
  • ctrl+` - Display console panel
  • ctrl+space - Auto complete the current selected snippet

Thursday, February 27, 2014

Ruby: decorators, modules

Computer Programming in 5 minutes & Tiny-Robots

I have wondered several times how I would introduce 'programming' to someone who has never done it, not even a little bit.

Below is Larry Wall's take on it. He is the creator of Perl programming language.



The rest of this post is based on an idea from the above video - the idea of robots being at your disposal to do certain tasks.

We can probably explain programming-constructs, by :

  • asking the student to imagine that each programming-construct is actually a tiny-robot. So, for e.g., a for-loop, is actually a tiny-robot that is capable of just doing a 'loop'. Similarly, we can imagine a if-then-else tiny-robot, print-to-screen tiny-robot, etc
  • Notice that I modified 'robots' to 'tiny robots' so as to convey the idea/feeling that a tiny-robot can do a 'tiny' task
  • This idea might work because everyone knows that robots need to be instructed what to do i.e. robots need to be given 'commands'.
  • And it is also easy to add that the commands have to be very specific, otherwise the robot will not understand what to do. We would have introduced concept of 'syntax' by doing that.

And that is probably half the battle won right at the start.

------------------------------------------------------------------------
More complex point that can be introduced after a couple of programs -

  • We can ask the tiny-robots to give commands to each other. 

------------------------------------------------------------------------
Example:

PROBLEM:
Print numbers 1 to 100 on screen

TINY-ROBOTS AT YOUR DISPOSAL:
1. LOOP tiny-robot
2. PRINT-TO-SCREEN tiny-robot

Info about the LOOP tiny-robot -
obviously since it is a robot, we have to tell it exactly how many times it has to loop;
once we give tiny-robot this number, it stores it and starts looping; it keeps track of how many loops it has completed, how many are remaining, etc; the LOOP tiny-robot is quite smart in this aspect.

Info about PRINT-TO-SCREEN tiny-robot - 
this tiny-robot does nothing but print to screen whatever you give it.

SOLUTION:
Instructions from us (programmer) to the tiny-robots will be:
"LOOP tiny robot -  please loop 100 times"
"During each loop, since you keep track of how many loops you have already done, give that number to the PRINT-ON-SCREEN tiny-robot, and ask it to print that number on screen.
-------------------------------------------------------------------------------
(In the above example, I have tried to tackle the 'loop' construct, which is a slightly advanced concept for an absolute beginner.
Have to try and add IF-THEN-ELSE construct example;
If idea seems good, perhaps, I will try to create examples for all the main programming-constructs.
In the worst-case, it can be a good way for me to try out while trying to understand new concepts)

Wednesday, February 19, 2014

git add -p

http://johnkary.net/blog/git-add-p-the-most-powerful-git-feature-youre-not-using-yet/
If you use git, you've used the command git add. But do you know about git add's "patch mode" using git add -p ?
Patch mode allows you to stage parts of a changed file, instead of the entire file. This allows you to make concise, well-crafted commits that make for an easier to read history.

10-signs-that-you-are-an-awesome-web-developer

Friday, February 14, 2014

Tuesday, February 11, 2014

MySql: find out which tables contain a certain column

To search for a column 'rank' in a database 'mydb':

select * From INFORMATION_SCHEMA.COLUMNS Where column_name like '%rank%' and TABLE_SCHEMA = "mydb"

Monday, February 3, 2014

drive.draw.io - mockup tool

Ruby: yield

Ruby: inject

http://ruby-doc.org/core-2.0/Enumerable.html#method-i-inject

inject( initial )  { |memo, obj|      block  }  → obj

def sum_of_cubes(a, b)
  sum = 0
  (a..b).inject(sum) { |sum, x| sum + (x*x*x) }
end

What does it do ?
-- Combines all elements of enum
-- by applying a binary operation, specified by a block

For each element in enum -
- the block is passed an accumulator value (memo) and the element
- the result becomes the new value for memo.
At the end of the iteration -
the final value of memo is the return value for the method.

Variation:
-------------------------
inject  { |memo, obj|     block  }  → obj

What is the initial value for memo ?
- If you do not explicitly specify an initial value for memo, then the first element of collection is used as the initial value of memo.


Thursday, January 30, 2014

Rails: specifying callback-javascript in response to Ajax request

respond_to do |format|  
  format.js { render js: "toastr.success('"+successmsg+"')"}
end

If callback-javascript is only 1 line of code or so, then we can avoid creating a new .js.erb file (with name of controller-action) and just include the javascript as above.

HipChat - Group Chat & IM for teams

https://www.hipchat.com/pricing - free for teams of size <= 5

Friday, January 24, 2014

Outside-In TDD

Boundaries of the System = User Interface OR Service Layer (like a Restful Service/Soap Service)

(Slide is from "Outside-In Test-Driven Development" course from Pluralsight)


Thursday, January 23, 2014

Ruby: eval, define_method, send

eval, define_method, send

http://rubymonk.com/learning/books/5-metaprogramming-ruby-ascent/chapters/24-eval/lessons/63-eval#solution3816
eval should best be avoided in real scenarios. Ruby has saner tools (#define_method#send) in its meta-programming repertoire that you can use to achieve eval-like cleverness.

Tuesday, January 21, 2014

Dependency Injection example

(I am trying to learn DI. Below is an Example from Adam Freeman's book - Pro ASP.Net MVC 5. Below is my attempt at understading the example in the book)
Dependency Injection example with Ninject: 

Starting point 

1. ShoppingCart's constructor expects a concrete class's object (i.e. object of class LinqValueCalculator)
2. HomeController's Index action is instantiating 2 objects before using them (observe the 'new' keyword being used in 2 lines of code)


Summary

In Stage1, we 'fix' ShoppingCart class (by transferring the responsibility of creating the object to HomeController class). 
Putting this in another way - we make it easier to write the ShoppingCart class, by asking HomeController to pass, as parameter to constructor, whatever ShoppingCart class needs 
Now we have to 'fix' HomeController class 

In Stage 2, we fix HomeController class

Stage 1 - left page in below screenshot

In page 124 (left page in below screenshot):

ShoppingCart has been 'fixed' now:
-- it has 'declared' that it has a dependency on an object of type IValueCalculator
-- It has done this 'declaration' via its constructor
-- basically it is saying - send me the object and I will use it; i am not going to go through the trouble of creating it
-- Also notice that, in ShoppingCart's constructor, concrete class LinqValueCalculator has been replaced by an interface IValueCalculator

- So, now the responsibility of getting hold of a IValueCalculator object has been transferred to Index() method of HomeControler.cs

Stage 2 - right page in below screenshot

In page 128 (right page in below screenshot):

Now, we use the same strategy with HomeController.cs :
-- we make it 'declare' that it has a dependency on an IValueCalculator object via its constructor
-- basically, now, it is also saying - send me the object and I will use it; i am not going to go through the trouble of creating it)

- So the question is - who is going to create the object now (since each class seems to be handing over that responsibility to someone else, and there is no one else to hand that responsibility over to) ?
Ninject or such DI container will do that...


Monday, January 20, 2014

Reverse Proxy

E.g. NGINX
http://en.kioskea.net/contents/308-proxy-and-reverse-proxy-servers
reverse-proxy is a "backwards" proxy-cache server; it's a proxy server that, rather than allowing internal users to access the Internet, lets Internet users indirectly access certain internal servers.
http://serverfault.com/questions/8654/what-is-a-reverse-proxy
A reverse proxy, also known as an "inbound" proxy is a server that receives requests from the Internet and forwards (proxies) them to a small set of servers, usually located on an internal network and not directly accessible from outside. It's "reverse", because a traditional ("outbound") proxy receives requests from a small set of clients on an internal network and forwards them to the Internet. 
http://www.jscape.com/blog/bid/87783/Forward-Proxy-vs-Reverse-Proxy
         has good diagrams to differentiate between a forward-proxy and a reverse-proxy

Followers

Blog Archive