Trenler, Asansörler ve Bilgisayar

George Westinghouse bir teorisyen değildi fakat 1800′lerin en büyük mucitlerindendi. En büyük icadı raylı sistemlerde kullanılan havalı frendir.
Bu yazıda Westinghouse’ın fikirleri ve bilgisayar bilimlerine yapmış olabileceği katkılar üzerinde duracağız.

Tren Frenleri

Atlar tarafından çekilen Wagonways isimli ilk tren 1550′lerde Almanlar tarafından kullanıldı. 1804 yılında Richard Trevithick buharlı tren ile 9 mil boyunca 10 ton demir ve 70 adam taşıdı. Bu kısa yolculuk modern trenlerin başlangıcıydı.

Read the rest of this entry »

Share and Enjoy:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • DZone
  • Linkter
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati

Comments (1)

Object Orientation

Encapsulation
Do not expose class variables, instead of doing this, use setter and getter methods and keep class variables private.

public class Car {
   private int price;
   private int maxSpeed;
   public int getPrice() {
      return price;
   }
   public void setPrice(int price) {
      this.price = price;
   }
   public int getMaxSpeed() {
      return maxSpeed;
   }
   public void setMaxSpeed(int maxSpeed) {
      this.maxSpeed = maxSpeed;
   }
}

What is the advantage of previous usage, first of all flexibility. For example you have changed your mind, decide to keep max speed read only. So we can just remove setMaxSpeed method or change it to private for internal use.
Another advantage is validation, if user want to set negative value for car price, so you can add a validation in setPrice that is it.

Is-A and Has-A Relationship
So, Ferrari is a Car, Cow is an animal lets codify these statements.
Read the rest of this entry »

Share and Enjoy:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • DZone
  • Linkter
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati

Comments

Java Basics

An introduction to Java programming languages. This post is intended to people who already know Java language but not sure about limits of what they can do and they cant such as which identifiers are valid which are not valid. An array can be defined in how many different ways ? Variables in interfaces. Enum definitions. Naming rules.

Read the rest of this entry »

Share and Enjoy:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • DZone
  • Linkter
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati

Comments off

Java Threads

A thread allow us to run task simultaneously. In this post you will learn how to initialize a thread, what is Runnable interface and Thread class, when we use Runnable or Thread classes, running multiple threads, thread synchronization.

Read the rest of this entry »

Share and Enjoy:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • DZone
  • Linkter
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati

Comments

Michael Feathers’ın Unit Test Tanımı

Bir çok proje takımında aşağıdaki kuralları uyguladım. Bu kuralların iyi dizaynı, hızlı geri bildirimi teşvik ettiğini ve proje takımlarını sorunlardan mümkün olduğunca uzak tuttuğunu gördüm.

Bir test aşağıdakilerden herhangi birini yapıyor ise unit test değildir.

Read the rest of this entry »

Share and Enjoy:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • DZone
  • Linkter
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati

Comments (1)