Personal Blog of Mustafa Basgun

I Don’t Own Any Facebook Account

I have been receiving emails about some Facebook accounts under my name. None of them belongs to me as it is possible that people having the same name might have created these accounts.

Update – I don’t have any Myspace account either.

Update – I am not against any social networking, it is just my personal preference at this time.

Written by Mustafa Basgun

December 2, 2009 at 8:57 AM

Posted in Personal

Tagged with

Design Considerations for Mobile Development

with one comment

Decide if you will build a rich client, a thin Web client, or rich Internet application (RIA)

If your application requires local processing and must work in an occasionally connected scenario, consider designing a rich client. A rich client application will be more complex to install and maintain. If your application can depend on server processing and will always be fully connected, consider designing a thin client. If your application requires a rich user interface (UI), only limited access to local resources, and must be portable to other platforms, design an RIA client.

Determine the device types you will support

When choosing which device types to support, consider screen size, resolution (DPI), CPU performance characteristics, memory and storage space, and development tool environment availability. In addition, factor in user requirements and organizational constraints. You may require specific hardware such as a global positioning system (GPS) or a camera, which may impact not only your application type, but also your device choice.

Design considering occasionally connected, limited-bandwidth scenarios when required

If your mobile device is a stand-alone device, you will not need to account for connection issues. When network connectivity is required, mobile applications should handle cases when a network connection is intermittent or not available. It is vital in this case to design your caching, state management, and data-access mechanisms with intermittent network connectivity in mind. Batch communications for times of connectivity. Choose hardware and software protocols based on speed, power consumption and chattiness, and not just on ease of programming.

Design a UI appropriate for mobile devices, taking into account platform constraints

Mobile devices require a simpler architecture, simpler UI, and other specific design decisions in order to work within the constraints imposed by the device hardware. Keep these constraints in mind and design specifically for the device instead of trying to reuse the architecture or UI from a desktop or Web application. The main constraints are memory, battery life, ability to adapt to difference screen sizes and orientations, security, and network bandwidth.

Design a layered architecture appropriate for mobile devices that improves reuse and maintainability

Depending on the application type, multiple layers may be located on the device itself. Use the concept of layers to maximize separation of concerns, and to improve reuse and maintainability for your mobile application. However, aim to achieve the smallest footprint on the device by simplifying your design compared to a desktop or Web application.

Design considering device resource constraints such as battery life, memory size, and processor speed

Every design decision should take into account the limited CPU, memory, storage capacity, and battery life of mobile devices. Battery life is usually the most limiting factor in mobile devices. Backlighting, reading and writing to memory, wireless connections, specialized hardware, and processor speed all have an impact on the overall power usage.

Reference: Codeplex (Microsoft Patterns and Practices)

Written by Mustafa Basgun

November 7, 2009 at 1:40 PM

Getting Connection String From Web.Config Inside A DLL Code

leave a comment »

I have been working on creating some .NET dlls at work which would commonly be utilized by our web applications. And, one of the requirements was getting the connection string information from web.config file. Simply making the call by using the ConfigurationManager class wouldn’t work since it was giving some kind of compile time error when you try to build the dll. So, I needed to find a workaround to retrieve the connection string from either connectionStrings or appSettings elements. Here is the solution that I have figured out so far.

Necessary namespaces:

mustafa-basgun-blog-aspnet-connstring-webcofig-1

Generic function that grabs the information based on your connection string name:

mustafa-basgun-blog-aspnet-connstring-webcofig-2

Sample usage:

mustafa-basgun-blog-aspnet-connstring-webcofig-3

To understand the ConnectionStringSettingsCollection and NameValueCollection classes, followings links would be helpful:

http://msdn.microsoft.com/en-us/library/system.configuration.connectionstringsettingscollection.aspx
http://msdn.microsoft.com/en-us/library/system.collections.specialized.namevaluecollection.aspx

Written by Mustafa Basgun

March 22, 2009 at 7:20 AM

Best Practices for Speeding Up Your Web Site

leave a comment »

There are tones of programming practices that I have been doing while developing an online application without even knowing or thinking about the technical reasons behind them; such as placing stylesheets at the top between the head tags, preferring CSS sprites to create menu items, utilizing <link> instead of @import, putting or linking the heavy JavaScript code at the bottom, etc.. This list can easily get longer.

While googling a solution to fix an issue in one of my development projects, I just found a very useful article from Yahoo Developer Network which explains all the things that I mentioned above along with some other cool practices.

Click here to read it, and then print and bookmark it.

Written by Mustafa Basgun

February 12, 2009 at 6:04 AM

Everything You May Want to Know About Azure Briefly

Here are two introductory presentations by David Chou about Azure. They both give a great overview of Microsoft’s Cloud Computing platform.

Written by Mustafa Basgun

December 7, 2008 at 10:44 AM

Posted in Web Development

Want To Validate Username Availability Asynchronously?

leave a comment »

While I was reading my feed aggregator at the weekend, I was paid attention to the recent post from Encosia because of its title. Validating a username asynchronously would be a great functionality in almost every types of online registration scenarios. Right after reading the post, I downloaded the binary file from CodePlex and created a very simple demo in about half an hour. That was really easy to implement.

Implementation

Before starting to code, be sure that the dll that is downloaded from CodePlex is in the Bin directory:

mustafa-basgun-blog-aspnet-validate-username-1

My sample (yes, very simple) registration form is:

mustafa-basgun-blog-aspnet-validate-username-2

As it can be seen, the trick is with the ServicePath and ServiceMethod attributes. ServicePath is the path to the webservice housing the ServiceMethod, and ServiceMethod is the method checking the availability of a username. My sample (yes, again very simple) webservice is:

mustafa-basgun-blog-aspnet-validate-username-3

Details of other attributes of the control can be read via its Discussions page at CodePlex.

Finally, here is how the form looks like after all these implemenations:

mustafa-basgun-blog-aspnet-validate-username-4

Download

You can download this sample registration form from here.

Issue Tracker

I would encourage to write your comments to here if you face any issues about the control.

Written by Mustafa Basgun

October 6, 2008 at 9:51 PM

Implementing New Virtual Earth Map Control in ASP.NET

with 4 comments

When the July 2008 CTP of Live Tools were released a few weeks ago, I was kind of impressed with the Map control. I finally had a chance yesterday to read more about it and develop my own simple testing page. You may need to download this CTP release first before reading the rest of this post.

Implementation

Here is the 5 steps to implement this control into any ASP.NET page:

1. When you create a new website, select “ASP.NET Windows Live Web Site” as a template:

2. Be sure that “Microsoft.Live.ServerControls.VE.dll” is in the Bin directory:

3. Be sure that “Virtual Earth” tab is in the Toolbox:

4. Drag the “Map” control and drop it into the ASP.NET page, and play around with some of the attributes in it:

Note: Latitude and longitude of any location can be found in Terraserver. This sample demonstrates the aerial view of a mall that is very near to my house.

5. Press the magic key (F5) to build and view the sample page:

Download

This sample can be downloaded via here.

Written by Mustafa Basgun

August 15, 2008 at 8:05 AM