Saturday, October 1, 2011

Class Inheritance and Interface Inheritance

It's also important to understand the difference between class inheritance and interface inheritance (or subtyping). Class inheritance defines an object's implementation in terms of another object's implementation. In short, it's a mechanism for code and representation sharing. In contrast, interface inheritance(or subtyping) describes when an object can be used in place of another.

It's easy to confuse these two concepts, because many languages don't make the distinction explicit. In languages like C++ and Eiffel, inheritance means both interface and implementation inheritance. The standard way to inherit an interface in C++ is to inherit publicly from a class that has (pure) virtual member functions.

Pure interface inheritance can be approximated in C++ by inheriting publicly from pure abstract classes. Pure implementation or class inheritance can be approximated with private inheritance. In Smalltalk, inheritance means just implementation inheritance. You can assign instances of any class to a variable as long as those instances support the operation performed on the value of the variable.

Although most programming languages don't support the distinction between interface and implementation inheritance, people make the distinction in practice. Smalltalk programmers usually act as if subclasses were subtypes (though there are some well-known exceptions [Coo92]); C++ programmers manipulate object through types defined by abstract classes.

Thursday, September 29, 2011

How to change instance name of sql-server

SQL Server doesn’t use the network name, it only excepts that as an alias. My SQL Server instance was still named “old_name”. I found that out by running these two queries:

1

2

sp_helpserver

select @@servername

So in order to get the network name and the SQL Server instance name back in sync I had do these steps:

1. Run this in Microsoft SQL Server Management Studio:

1

2

3

4

sp_dropserver 'old_name'

go

sp_addserver 'new_name','local'

go

2. Restart SQL Server service. I prefer the command prompt for this, but you can just as easily do it in Services under the Control Panel
net stop mssqlserver
net start mssqlserver

Then after that is done run this again, to make sure everything is changed:

1

2

sp_helpserver

select @@servername

For further detail click here

Sunday, September 25, 2011

Unable to connect to mysql host

I was facing a problem, from few days i.e. whenever I tried to connect to Mysql database a message appears, Unable to connect to mysql host. I was using mysql connector for dot net. My connection string was also correct, according to connection-strings site. I had also added Mysql port (3306) in windows firewall, but still the problem persist.

After doing some RND, I saw a post in which it was highlighted that this issue, may be appeared because of Winsock2 corruption. To repair Winsock I used netsh winsock reset command at the command prompt, and then press ENTER. After restarting my notebook, mysql connection starts working.

For detail click here. Thank You.

Earn Money ! Affiliate Program
Open Directory Project at dmoz.org