New Technologies in Computer Programming
Saturday, 5 July 2014
Wednesday, 25 June 2014
What is the Dot NET Framework?
What is the .NET Framework?
The .NET Framework is a new and revolutionary platform created by Microsoft for developing applications. The first release of the .NET Framework runs on the Windows operating system, future plans include versions that will work on others, such as FreeBSD, Linux, Macintosh, and even personal digital assistant (PDA) class devices. One of the key motivational forces behind this technology is its intention as a means of integrating disparate operating systems.
The .NET Framework allows the creation of Windows applications, web applications, web services, and pretty much anything else you can think of.
The .NET Framework has been designed such that it can be used from any language. This includes C#, C++, Visual Basic, JScript, and even older languages such as COBOL. In order for this to work, .NET-specific versions of these languages have also appeared: Managed C++, Visual Basic .NET, JScript .NET, J#, and so on – and more are being released all the time. Not only do all of these have access to the .NET Framework, they can also communicate with each other. It is perfectly possible for C# developers to make use of code written by Visual Basic .NET programmers, and vice versa.
The .NET Framework consists primarily of a gigantic library of code that we use from our client languages (such as C#) using object-oriented programming (OOP) techniques. This library is categorized into different modules – we use portions of it depending on the results we want to achieve. For example, one module contains the building blocks for Windows applications, another for network programming, and another for web development. Some modules are divided into more specific sub modules, such as a module for building web services within the module for web development.
Part of the .NET Framework library defines some basic types. A type is a representation of data, and specifying some of the most fundamental of these (such as "a 32-bit signed integer") facilitates interoperability between languages using the .NET Framework. This is called the Common Type System (CTS).
As well as supplying this library, the framework also includes the .NET Common Language Runtime (CLR), which is responsible for maintaining the execution of all applications developed using the NET library.
How do I Write Applications using the .NET Framework?
Writing an application using the .NET Framework means writing code (using any of the languages that support the framework) using the .NET code library.
In order for VB.NET code to execute it must be converted into a language that the target operating system understands, known as native code. This conversion is called compiling code, an act that is performed by a compiler. Under the .NET Framework, however, this is a two-stage process.
MSIL and JIT
When we compile code that uses the .NET Framework library, we don't immediately create operating system-specific native code. Instead, we compile our code into Microsoft Intermediate Language(MSIL) code. This code isn't specific to any operating system, and isn't specific to Visual Basic .NET. Other .NET languages – for example, c# – also compile to this language as a first stage.
Obviously, in order to execute an application more work is necessary. This is the job of a Just-In-Time (JIT) compiler, which compiles MSIL into native code that is specific to the OS and machine architecture being targeted. Only at this point can the OS execute the application. The "just-in-time" part of the name here reflects the fact that MSIL code is only compiled as and when it is needed. In the past it has often been necessary to compile your code into several applications, each of which targets a specific operating system and CPU architecture. This is now unnecessary, as JIT compilers (as their name suggests) use MSIL code, which is independent of the machine, operating system, and CPU.
Assemblies
As well as containing MSIL, assemblies also contain meta information (that is, information about the information contained in the assembly, also known as metadata) and optional resources (additional data used by the MSIL, such as sound files and pictures). This means that deploying applications is often as simple as copying the files into a directory on a remote computer.
It is often useful to place this reusable code in a place accessible to all applications. In the .NET Framework, this is the Global Assembly Cache (GAC). Placing code in this cache is simple – we just place the assembly containing the code in the directory containing this cache.
The role of the CLR doesn't end once we have compiled our code to MSIL and a JIT compiler has compiled this to native code. Code written using the .NET Framework is managed when it is executed (this stage is usually referred to as being at "runtime"). This means that the CLR looks after our applications, by managing memory, handling security, allowing cross-language debugging, and so on. By contrast, applications that do not run under the control of the CLR are said to be unmanaged.
One of the most important features of managed code is the concept of garbage collection. This is the .NET method of making sure that the memory used by an application is freed up completely when the application is no longer in use..NET garbage collection works by inspecting the memory of your computer every so often, and removing anything from it that is no longer needed.
There is one additional point to note concerning the above process. The VB.NET code that compiles into MSIL in step 2 needn't be contained in a single file. It is possible to split application code across multiple source code files, which are then compiled together into a single assembly. This process is known as linking, and is extremely useful. The reason for this is that it is far easier to work with several smaller files that one enormous one. You can separate out logically related code into an individual file, so that it can be worked on independently, and then practically forgotten about when completed.
Tuesday, 24 June 2014
Content Management System (CMS)
I Want To Build A Website. Do I Need a Content Management System (CMS)?
Since everyone has blogs and profile pages these days, you may want to create a website of your very own. Do you need a content management system (CMS) to make life easier, or is the old system of updating a file manually and uploading it to your server good enough for today's web developer?
What Can a CMS Do For You?
Web developers initially developed a website by creating web pages on their local computers, using an FTP program to move those files over to their web server, and then those pages became available via their website. If any changes were needed, they would begin the process anew by going through the process again. Some simplified the process by using Server Side Includes (SSI), which cut the number of pages that needed to be updated down, since an include which contained the site's menu could be updated and used throughout the site without any additional changes being required.
The problems began when a website went beyond the traditional "brochure-ware" design and delved into dynamic content, fresh material and live communities. Websites need to be able to be updated daily, with different people adding content as it becomes available, along with some content that is updated automatically through the use of RSS feeds. Content Management Systems came to be a useful part of a web developer's toolbox. The problem then came to be, which CMS is best for me? How much is it going to cost me in terms of money and a learning curve? What features does each CMS offer that my business requires? In this tutorial we'll discuss a few free (and almost free) CMSes, tell you what they offer, and help you get started with your own website.
Open Source CMS to the Rescue
Although there are many open source CMSes available, we're going to focus on those that are based upon PHP. The following CMSes are thus PHP-based, and use a MySQL database. The advantages of using such a CMS include portability, support and a large developer base with frequent updates and improvements. We will discuss the following four CMSes:
- Drupal - a free open source content management system written in PHP and distributed under the GNU General Public License
- Joomla - an open source content management system platform for publishing content as a Model–view–controller (MVC) web application framework
- PHPNuke - a web-based automated news publishing and content management system based on PHP and MySQL
- Wordpress - an open source CMS, often used as a blog publishing application, and is the most popular blog software in use today
Drupal
Drupal is currently up to version 6.17, with working ongoing for version 7, a much anticipated release. Drupal's built-in functionality, plus the thousands of freely available add-on modules, provides developers with much-requested features including:
- Electronic commerce
- Blogs
- Collaborative authoring environments
- Forums
- Peer-to-peer networking
- Newsletters
- Podcasting
- Picture galleries
- File uploads and downloads
Installing Drupal is fairly straight-forward: Create a MySQL database, upload the Drupal package to your web server, following the on-screen instructions via your web browser, and configure your new website. It's a bit more complicated than that, but we've already written an article about it, so that saves you even more time. Once you've got it up and running, you can select from thousands of free themes, select some modules and get to tweaking your site and adding content!
Joomla
Like Drupal, Joomla enables developers to build complex web sites and online applications. It is built upon PHP and MySQL, is free, and can be used to create:
- Inventory control systems
- Data reporting tools
- Application bridges
- Custom product catalogs
- Integrated e-commerce systems
- Complex business directories
- Reservation systems
- Communication tools
The Joomla CMS has a very large developer base, and its core "out-of-the-box" features include:
- User Management
- Media Manager
- Language Manager
- Banner Management
- Contact Management
- Polls
- Search
- Web Link Management
- Content Management
- Syndication and Newsfeed Management
- Menu Manager
- Template Management
- Integrated Help System
- Web Services
- Extensibility
Installation is much the same as with Drupal. Create a MySQL database, upload the Joomla package files to your web server, point your web browser at the installation file, and follow the on-screen instructions. Then, customize your installation, work on the theme, and post some content!
PHPNuke
PHPNuke version 8.1 was recently released, with new BB2Nuke forums, security fixes and other fixes and functionality, however, versions after 7.5 are "pay for use"--but we're only talking about $12, so it's still practically free.
PHPNuke enables visitors and editors to post news items and other types of articles, and registered users can comment on these articles using PHPNuke's full-featured commenting system. Like Drupal and Joomla, PHPNuke comes with many features out-of-the-box, including:
- Advertising
- Avantgo
- Content
- Downloads
- Encyclopedia
- FAQ
- Feedback
- Forums
- Journal
- News
- Private Messages
- Statistics
- Stories
- Submit News
- Surveys (Polls)
- Topics
- Web Links
Installation of PHPNuke is much like the others we have discussed. The only difference is that you must first purchase the software before you begin the installation procedure. Once that is done, the process is the same--create a database on your web host, upload the software, and follow the web-based installation prompts. Once that's done, log in and begin tweaking your new site.
Wordpress
Wordpress is the most popular CMS in use today. With many thousands of Wordpress sites alive today, the software is supported by a large developer network--it's hard to find a question about Wordpress that hasn't already been answered. Wordpress provides the following features to developers:- Full standards compliance
- WordPress Pages
- WordPress Links
- WordPress Themes
- Cross-blog communication tools
- Comments
- Spam protection
- Full user registration
- Password Protected Posts
- Easy installation and upgrades
- Easy Importing
- XML-RPC interface
- Workflow
- Typographical niceties
- Intelligent text formatting
- Multiple authors
- Bookmarklets
The first step to using the CMS is, like the others, to download the software. If you don't want to host the CMS on your own web host, you can also signup on the Wordpress site and use their servers and resources to host your site/blog. Also, you will need to create a new MySQL database, like all the others we have discussed. The difference is that you will need to edit the Wordpress configuration file, wp-config.php, and add the database details for the database you just created. Once you've done that, you upload that file, and all the other Wordpress files, to your web server, and use your web browser for the rest of the installation process.
Conclusion
We've discussed the reasons why a CMS can make your life easier, and we've given you some examples of open source CMSes that you can download and try out on your site for free (or almost free). Here are a few additional articles to whet your CMS appetite!
- Drupal for the Web Developer: An Introduction and Overview
- Drupal for the Web Developer: Configuring Your Drupal Website
- Drupal for the Web Developer: Managing Content For Your Drupal Website
- WordPress For the Web Developer: Top 10 Plugins
- WordPress For the Web Developer: Working With Theme Templates
- WordPress For the Web Developer: How To Write Your Own Plugins
- WordPress For the Web Developer: Writing Plugins--Actions and Filters
- Drupal Basics: Introduction
- Drupal Basics: Modules, Blocks and Roles
- Drupal Basics: Be a Role Model
- A Quick Look at Joomla! Templates
Subscribe to:
Posts (Atom)