TURKISH BLOG   |  ABOUT ME  |  ARCHIVES  | DELETE LANGUAGE COOKIE

Enes TAYLAN

Mind Hegemony - Mood 1.0 - Total Control Edition

ADO.NET HIERARCHY

clock April 27, 2009 23:05

Whether we use ADO.NET or not generally we don't know about hierarcy of ADO.NET namespaces and classes. Therefore, I want to write its general hierarcy:

ADO.NET NAMESPACES

  • System.Data
  • System.Data.Common
  • System.Data.SqlClient

System.Data: The core of ADO.NET. Tables, Rows, Columns and DataSet  are all tools that are in System.Data. This namespace implements IDbCommand, IDbConnection, IDbDataAdapter interfaces.

System.Data.Common: This namespace is generally for custom data providers because it includes base classes of all providers in ASP.NET. For example if you want to write your own SQL provider, then you should use System.Data.Common.

System.Data.SqlClient: Data Provider for SQL. SqlCommand,SqlConnection etc. are in this class.

Now let's group ADO.NET classes considering their base features.

  •  Classes don't need live connection to database
  •  Classes do need live connection to database
  •  Base classes for Data Providers
  •  and Data Providers

Classes don't need live connection to database:  Their most important and basic future is to recreate tables (with its rows, columns, functional dependencies and all its futures) in memory and manipulate them. When needed they send this tables to client side. These classes includes DataSets, DataTables.

Classes do need live connection to database:
  Like DataReader class, gets the actual form of database and sends it to the client. If there is an update on the server side it should be resent. To do so, it requires live connection.

Base classes for Data Providers : These classes are in System.Data.Common and are base classes for all Data Providers. (including our own custom providers)

DataProvider classes: For each Data Provider, we have a unique DataProvider class. We do all operation related to a specific data source by its own DataProvider. Each and every Data Provider has its own DataConnection, Command, Adapter and Reader objects.

Let's examine a portion of a data access layer class. (This is a general ADO.NET example. In subsequent entries, I'll give more specific examples)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Configuration;
using System.Data.SqlClient;           //This is for MSSQL operations. 

public static void Insert_Customers(Guid? userID, string name, string surname, string tel_no)
{
SqlConnection conn = null;  //for database connection
SqlCommand cmd = null;   
//  with this object we send necessary commands (sql queries)
//  to database
SqlTransaction trans = null;  //SqlTransaction is used for insert and delete
//when there is an exception, we can undo our operations
//with this object 
try
{
conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ImaletConnectionString"].ConnectionString);
conn.Open();
trans = conn.BeginTransaction();
cmd = new SqlCommand("Insert_Customer",conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Transaction = trans;
cmd.Parameters.Add("@UserID", SqlDbType.UniqueIdentifier); 
//add sql parameters with the same name in sql queries
cmd.Parameters.Add("@Name", SqlDbType.NVarChar, 20);  
cmd.Parameters.Add("@Surname", SqlDbType.NVarChar, 20);
cmd.Parameters.Add("@Tel_No", SqlDbType.NVarChar, 20);
cmd.Parameters[1].Value = name;
cmd.Parameters[2].Value = surname;
cmd.Parameters[3].Value = tel_no;
cmd.ExecuteNonQuery();
trans.Commit();
}
catch (Exception pr)
{
if (trans != null)
trans.Rollback();       
//if there is an exception undo current operation
throw new Exception();
}
finally
{
if (conn != null)
conn.Close();  
// with Dispose() we prompt C# compiler to delete our objects
cmd.Dispose();
trans.Dispose();
conn.Dispose();
}
}


ASP.NET SECURITY: AUTHENTICATION AND AUTHORIZATION

clock April 21, 2009 08:23
ASP.NET gives developers very flexible and powerful capabilities in to secure to make decisions considering user actions.To apply settings we want, we can edit web.config, machine.config, IIS.Besides this settings there are great classes and namespaces in .NET ( we will use generally system.web.security ).Let's start with <authentication> element in web.config. (Authentication is the process that determines the identity of a user, in other words asking user his/her credentials.Authorization,on the other hand, after validating credential, giving the user access to any specific part of the application) 
 

<authentication mode="Forms"> //possible values are "Windows|Forms|Passport|Name   

</authentication> 

 90% we use authentication mode "Forms" so no need to focus on other types.By using <authorization> we define accession rules for specific folders or pages or website as a whole.
 

<authorization>

      <deny users="*"/>

      <allow roles="administrator"/>

</authorization> 

This setting first of all denies all users (*) then gives the access right to the role administrator.If we place this xml in web.config on the root of the application then it uses these settings for whole website.But in specific folders it is applied only to that folder. ie in our example, it seems that this code is for admin directory ( it gives access rights just for administrator(s).) We have deny and allow tags and users and roles attributes.For our need we can use them appropriate combination.And an example of how to use system.web.security and its basic functionalities:

using System.Web.Security;
protected void LoginButton_Click(object sender, EventArgs e)
{
if (Membership.ValidateUser(TextBox1.Text, TextBox2.Text))  //this method takes two arguments username,password
{
FormsAuthentication.RedirectFromLoginPage(TextBox1.Text, true); //go to page which was intended 
//before redirected to loginpage           
}
else
FormsAuthentication.RedirectToLoginPage();  //otherwise go to loginpage again
}
}


THE IMPACT OF INFORMATION AND COMMUNICATION TECHNOLOGIES ON SOCIETY, ECONOMY AND THE LAST ECONOMIC CRISIS

clock April 21, 2009 06:55
     In our ICT (Information and Communication Technologies) world, I want to share my article about ICT's impact on society,economy and also on the last economic crisis.I want and wait your comments:
 

Introduction:
    The world has been experiencing breathtaking proliferation of information over the past few decades. This information age , came with Information and Communication Technologies(ICT) , made tremendous effect on socio economic life , economy of society and how it is governed. Even we can compare these effects with Industrial Revolution’s. These effects changes the structure of Global System , how democracy is understood and managed , relative importance of components of democracy (healthy information , conscious electorate , importance of  ethics etc.)

Analysis
    Before analyzing ICT by regarding its impact and benefits on society , economy and last economic crisis and its benefits , first of all should we define what is a benefit and what conditions it satisfy? In terms of areas that we examine , the criterion of benefit must be what the subject brings to human development , human and social capital , security , economic and social development and efficiency in public and private management. Also , these benefits have effects not in the short-term but in the medium-to-long term. (we will discuss impacts of ICT on short term views and how it promotes long term decisions) Optimization of world , making a better world needs deliberately understanding of following matters:

  • Social and human development
  • National and specific concerns of national states (we can’t just think globally impacts of ICT , because there are national institutions in reality , their own problems and concerns should be addressed in every beneficiary concepts to make them applicable.)
  • Developing technology , education , health , culture
  • Making its own power sustainable 


ICT and Governance

    How a society is governed is profoundly related with information , because decision makers need a sufficient flow of information to solve problems and challenges they face. Even , we can say that entire decision making process depends on information. However , as I said , information proliferates at exponential rates so that a decision  maker faces infinite amount of information but of course not all information is relevant to any given problem and associated with it. Therefore , a mechanism to filter these huge heap information and extract finite set of data is needed. Also these infinite amount of information (means a man or a system cannot itself process it) is much more prone to errors and deterioration also intended deterioration. To satisfy requirements of decision makers and decision making structures we need more reliable , more efficient , faster , more selected and better information models. Also ICT should make available access to transdisciplinary information by decision makers. This eventually leads to need to advanced and sophisticated algorithms and information technology.
   
The relation between decision makers , decision making structures and information is two-way. Information systems with needed advanced technologies should give qualified information to decision makers whereas decision maker structure should convey its responsibility to address economical needs of info-systems. This mutual responsibility accentuates the power of ICT.However , this relationship that is between decision makers , decision making structures and ICT is not a simple one and requires very sophisticated analysis. Since everything that includes society and economy also includes human behavior and this leads eventually requirement of dealing with very high complex , mathematically chaotic and low predictable social problems. To make these problems easier , more technological developments (better algorithms , advanced technological systems) and also more profound investments are needed. Although ICT tries to solve this problem , it needs first of all to define the problem and find cons , this  , as I said , is a very difficult process. This problem make us think another big role of ICT ,  that it is the main determinant in the evolution of social sciences and decision making structures besides just affecting them. After improvement of more advances systems and algorithms , people will need the reconsideration of existing theories and methods and forming new methodologies.

    The other big importance of ICT is the connection of overspreading of information and democracy. Since what makes democracy viable are mainly a transparent and functioning market system , solving social and civic problems , a powerful structure of culture and civilization. 

   Besides these main requirements , there are other contributions that ICT makes to society and healthy decision making process:

  • Transparent situation on markets and prices
  • Production of new ideas and also accessing them
  • A conscious and informed electorate (electorate is the main component of the system and is very important for health of democracy)
  • Keeping scientific integrity and independence (is important not only for improvement of science but also keep science from biased information)
  • A responsible government that knows it is observed always
  • Constructing a global connection that makes further improvement for information health and ICT
  • Increased social and human capital
  • Connection and competition between ideas that leads to better , refined , more effective and applicable ideas and opinions
  • Eliminating targeted-biased reality and replacing it with observable reality with a minimum margin error    


ICT and Media

    In our information era , as I said , world has been experiencing proliferation of information at exponential rates. In this era , media is the main channel of transmitting information.  People have used books , magazines , tapes , radio , TV to access information.   After use of PC in almost everybody in developed countries and internet , this transition reached an enormous amount.   

   The effect that comes with media’s main role in transmitting information is seen in political participation in democracies. The media is the main response channel to national as well as international challenges. The benefits that we mentioned above (new , better , refined ideas , more discussion on problems , more open society etc. ) are mainly achieved by media. Today all problems can be discussed in pluralistic and participatory manner. This gives one more dimension to democracy and makes it better. (solves some basic problems of representative form of  democracy that modern countries adopt now)  This is achieved by participation of citizens in discussions and interpretations of events and decisions that are made in states institutions.

    Unfortunately , besides all these benefits for democracy , media plays sometimes a bad and dangerous role in society because of the fact that it has tremendous power and authority in society and effect to change the decisions of society , it has also immaturity. We see , although the media , especially television and internet keeps channels open between institutions and society  , it have not yet reached the maturity and responsibility which exercise of such a big power would require.

ICT and Economy
 
     The countries and some big companies that started their Industrial Revolution earlier and became powerful economically , politically and militarily also some big companies have become progressively concentrated on production , distribution and use of information. (IBM recently sold its computer production factories to its emerging Chinese rival Lenovo and become specialized on software on climate change , environment and information process(like in the transfer or textile factories to Far East rising markets) ) This specialization (the post-modern production) guaranteed sustainable affluence gains.   

     The impact of ICT on economy is seen firstly on its effect on efficient resource allocation and marketing techniques since this gives the ability making better market plans and more optimized selling and transportation strategies.

    Economic activities are much related with good information. Therefore , widely spreading of information makes national states and companies more competitive and efficient. Information on several variables which are key to market strategies technology , marketing strategies and decision making process and quality helps  markets to intensify their economic activity. However , information gaps between states and companies makes difficult cooperation and lessen the profits.  We see this effect when we compare developed and undeveloped countries and big networked companies and small ones. Also this information results in unemployment  , misallocation of credit and big policy mistakes that damage all markets and sectors by decreasing overall competitivity but also companies directly.

    Information-based companies are better competitors in global markets. This advantage comes from mainly their experience and experiment in knowledge creation. They produce information , refine it to make better and use it practically. Also , this gain them sustainable and more profits.        

   Besides this development and growth in information , the structure of companies undergoing significant change , as I said in IBM example. Because the information system grows with information technology – software , media , consulting services ,communication technology and services and overall information services.  The information related market is now estimated about $1.2 trillion.  Also not only information systems but all sectors becomes more related with information and communication technologies. This makes structural changes and reconsidering strategies again (as I mentioned above). After all these development information became main input to company’s strategies and also their spending. In OECD countries , 50% of workforce’s task is to collect , process or transmit information.    

   All these progression , make information and information technologies as a component of economy that has a very big strategic role. Because decision making process is related with all sectors and national states themselves , people give a very high importance to this structure. And as I mentioned above decision making is very related with information. To make better anticipations , less wrong decisions and reduce
the risk decision makers take , healthy information is needed much.

    All developed countries , their economies and industrial restructuring relies heavily on information technology. In last few decades many national states made their own IT programs.
   
    All importance of ICT in economy make us think about solving problems that the world is facing now : environment , global warming , climate change , terrorism , poor people , famine etc. Because ICT is the main component of prosperity and development , developed countries should share their information and information structure with underdeveloped countries.



ICT (specifically Internet) and Last Economic Crisis

    Information and communication technologies gives very big opportunities to companies , people who works with investment banks to observe everything in financial markets , selling and buying easily with just one click. Especially Internet has done many important things for financial markets and world financial system. All people not just analysts started to access information on all level of markets. However they bring us a very dangerous things also : now the amount of money in derivative markets is $trillion 660  although total of gdp’s of countries in the world is $trillion60 that means it is ten times bigger than real money.

    Like 2000 dotcom bubble , in our current economic crisis , brilliant staff in banks made very brave selling and buying process without considering what they are doing. In our power and power of money driven systems , banks are just focused on money.  They made billions of dollars with just clicks. They got loans and with this made investments that are much more than these loans. Also they gave billions of dollars of credit to customers and other companies in mortgages and other staff by not considering how these clients and companies can pay up these mount of money.


    Not only loaners and banks but also customers didn’t things that their responsibility requires. They always get , but not think how to pay up that.  All these thing are related with internet and easiness of buying and selling with just clicks.  Because internet made it possible to be online brokerage because accessing to information is so easy.

    Because of complex structures of financial systems with many sphere made it almost impossible track the flow of money in markets. You can easily get the money with loans and buy a product or borrow to another man.

Concluding Remarks
    The world has been entering a new era that national states , companies and all institutions become more and more interdependent. All trends , economic , political , sociological and technological transcend regional and national boundaries although obstacles to protect them.
    This globalization is occurring very rapidly because ICT technologies and Internet make it possible the proliferation of information at exponential rates. Therefore , society , economy , governance , governments and decision makers are facing new challenges.
    Very powerful relationship between information , ICT and democracy is shaping the world. With the help of media , people can access information easily and affect the decisions that decision makers make.
    ICT and Internet also affects economy in many aspects. We see the results : an unprecedented growth and margin rates over past few decades (about since 1970) and also crisis: 2000 dotcom bubble and now , in 2008-2009 , very big collapse and potential economic slowdown.


References
1. www.psychology.iastate.edu/faculty/caa/abstracts/2000-2004/02AB2.PDF
2. Guvenen , O .The Emerging Information Society : A Political Challenge
3. http://www.newsweek.com/id/164588
4. http://en.wikipedia.org/wiki/Financial_crisis_of_2007-2008

 


10 SKILLS DEVELOPERS WILL NEED IN THE NEXT FIVE YEARS

clock April 18, 2009 19:58
With the amazing changes in people's life, their traditions and in IT world; demands, demand types and requirements to respond these demands are changing.People want more media content: graphics,music,video etc. So to become a good developer requires learning new skills and being coordinated with time.So our list to become a better developer in next 5 years:
 
1.ONE OF THE BIG THREE(.NET,JAVA,PHP)
To be able to work in highly web-oriented software world, developers should use .NET (has many sub areas but generally ASP.NET,SILVERLIGT,C# etc), JAVA (core JAVA,JSF,JavaFX) and PHP.
 
2.RICH INTERNET APPLICATIONS(RIA)
SILVERLIGHTAlmost all good-looking internet pages use FLASH,SILVERLIGHT,JavaFX,Adobe FLEX and AIR.The era of just using CSS,Javascript has passed.Therefore, being able to use some of these technologies is very important to work in big, enterprise-level projects.
 
3.WEB DEVELOPMENT
The core of Web Development is still HTML,CSS,JavaScript and to use RIA and server side technologies they are very important because all ways  goes to these core guys.(It doesn't seem to change dramatically in the next years) 
 
4.WEB SERVICES
For maintenance and use one service in several ares, for example for computers and mobile devices simultaneously, Web Services is needed.
 
5.SOFT SKILLS
Communation skills, understanding consumers' needs are very important in all areas not just software area.
 
6.ONE DYNAMIC AND ONE FUNCTIONAL PROGRAMMING LANGUAGE
JavaFXTo have a wide horizon and see the problems in more ways, developers should know one dynamic and one functional programming language at least.This is very important not just for our horizon but also dynamic languages for example Ruby has made very big efforts in last  year.
 
Ruby7.AGILE METHODOLOGIES
In enterprise-level projects, generally there are several teams works on different parts of the solution.So working with other people and other groups is very important.
 
8.MOBILE DEVELOPMENT
Today mobile devices are as capable and powerful as computers about 10-15 years ago. (Even they are more powerful in terms of graphics) There is a huge market in mobile development that incorporates Web Services and RIA.

http://blogs.techrepublic.com.com/10things


BUILDING A SIMPLE ASP.NET PAGE WITH AJAX

clock April 18, 2009 06:16

I will show how to use AJAX capibilities in ASP.NET by using major AJAX controls in our VS2008 toolbox.We have ScriptManager,ScriptManagerProxy,Timer,UpdatePanel and UpdateProgress. In these tutorial we'll use UpdatePanel and UpdateProgress controls.Let's do the classic example that gets the current time from server.To do so first create a website whose name is AJAX (or whatever you want:)) 



 After creating the project lets code our default.aspx page.Add one ScriptManager to the page.(just one because more than one ScriptManager gives error and don’t forget that you should place it above all AJAX controls.To be safe I add it just after <form.....>)

    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>

    <div>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
                <br />
                <asp:Button ID="Button1" runat="server" Text="Button" />
            </ContentTemplate>           
        </asp:UpdatePanel>

    </div>
    </form>

Then add UpdatePanel.In design view you can just drag and drop ASP.NET server controls inside it.But if you are in source view, add contempt template tags in UpdatePanel and now you can add what ASP.NET controls you want since UpdatePanel is a container control. Very simple code behind file:

protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = DateTime.Now.ToString();
} 


When we click the button, it gets the result from the server but doesn't refresh the page.This is the use of UpdatePanel.When an event related with it, Update Panel just request the controls inside it.This is the advantage of AJAX.( In our example because we have just a label and a button, using AJAX doesn't make much sense. However in big pages only updating small partion of the html is very useful!)

And our UpdateProgress Control.This control is very easy to use, too. Now add it above our UpdatePanel.

        <asp:UpdateProgress ID="UpdateProgress1" runat="server">
            <ProgressTemplate>
                updating wait , please
            </ProgressTemplate>
        </asp:UpdateProgress>

        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <br />
                <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
                <br />
                <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
            </ContentTemplate>
        </asp:UpdatePanel> 

And to see the result in localhost (very fast so should sleep it) add to code behind:

protected void Button1_Click(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(4000);
Label1.Text = DateTime.Now.ToString();
}  

Now our program sleeps for 4 seconds and UpdateProgress control shows what it has in <ProgressTemplate>......</ProgressTemplate. After 4 seconds it disappears.We can also add very good wait.gifs. Write this:

<ProgressTemplate>               
                <img style="float:left" src="ajax-loader-darkblue.gif" />
</ProgressTemplate> 

 



HISTORY OF MICROSOFT

clock April 10, 2009 17:16
Yesterday I watched the history MICROSOFT on ( http://channel9.msdn.com/shows/history) and I am just so amazed about the expanding of the company. MICROSOFT makes $ 22000 in 1976 just one year after it jumps to $380000 and in 1979 its revenue is $2million and in 1980, $17million. What a fast growth!!!!! Now Microsoft makes $60.420 billion in a year!!
 

Bill Gates 1983The little boyLaughing (on left) has now $40 billion (last year it was $58 billion). He has also very humanitarian man. He works in Microsoft part-time and in Bill & Melinda Gates Foundation full-time.Bill Gates He has a theory of creative capitalism to supply more medicine, food etc. to poor people all around the world while protecting market interests of companies.
(for more information http://www.time.com/time/business/article/0,8599,1828069,00.html")

  I started with the history of Microsoft and now I am talking about Bill Gates, as you know Microsoft is Bill Gates, so no problem:) !!!!!



AJAX'S PLACE IN WEB PROGRAMMING

clock April 10, 2009 17:15
At the very core of the website programming developments, providing clients a smooth (like thick-desktop applications) rendering capibilities lays.To do so developers have introduced new techniques to development.One of them was XMLHttpRequest. By using XMLHttpRequest(with JavaScript) rather than HTTPRequest we could have the ability to update portions of webpages.This dramatically decreased server loads and waiting minutes of clients also gave them much more smoother user experiences.All improvements in the area of these technologies are then packed into AJAX Technology.Now we have several AJAX libraries of different companies. After story and history of AJAX , let's look at AJAX life cycle.



AJAX enabled sites load necessary js libraries to client side and this libraries takes the responsibility to communicate with the server. Moreover the client just asks for portion of the page that needs to be updated.Advantages are: minimal data transfer because of just partial page update,fluidity due to less waiting  time on client side.After AJAX became more popular , Microsoft embedded the ability to use AJAX in its ASP.NET server side controls. (Now in Visual Studio 2008 to use AJAX, no extra patch is needed). Also an AJAX control-toolkit has been developed.(http://www.asp.net/ajax/ajaxcontroltoolkit/samples). In next entries I will talk more on AJAX  and show how can we use AJAX control-toolkit.