Introduction:
Smart client when we divide them into words we get two words; 'smart' and 'client'.
In application development terms 'client' application is a application which runs in your local system and takes full advantage of the local hardware resources and advantages which are featured in your local operating system.
Now comes the term 'smart', smart in general terms is someone who knows by itself what to do? There is no necessity for someone to tell a smart person what to do.
So, a smart client is an application ,which runs in your local system and is designed so as to know what it has to do at a given point of time. To be more specific, it gives application access to local hardware when not connected to internet and when connected allows application to take full advantages of remote services and information available.
I can say smart client = thick client + thin client.
Now we have introduced two terms thick client ; thin client.
Let us know explain these terms one by one.
Thick clients:
Thick clients are also known as rich client applications.
Thick/Rich client applications are the windows or more generally speaking desktop applications which we use more often.These were very popular in mid- nineties. Thick client applications take advantage of local hardware resources and features of the client operating systems.
Advantages of thick clients:
Thick client/ Rich client applications have following advantages:
a. High qulaity
b. Responsive user experience
c. Easy to maintain
d. Take full capabilities of local hardware resources.
e. Esay to develop.( Developer friendly ;) applications)
Disadvantages of thick clients:
a. Applications are stand-alone and operate on the client computer.
b. Integration between applications is limited .
c. At times features are limited to the features provided by .
d. Transfer of data between applications is very difficult.
e. These applications are very difficult to deploy and maintain.
f.One application can easily break another application if an incompatible shared component or library is deployed.Thi s is also known as application fragility.
g. New versions of the application are made available by redeploying the entire application, which can increase an application fragility problem.
Thin Clients:
Thin clients are browser-based applications . HTML and .NET and java Web applications can be called as thin clients. These applications are deployed and updated on a central Web server. These applications solve a lot of disadvantages of thick clients for example the interaction between different systems in network is very good, even the deployment and upgradation of these applications are relatively simpler and easy.
Advantages of thin clients:
a. Thin client model allows companies to expose their applications to a large and diverse external audience. Retail and banking sites can take advantages of these applications.
b. It is easier to deploy and maintain thin client applications.
Disadvantages of thin clients:
a. Thin applications are browser based . These applications must have a network connection at all times.
b.Usability of these applications are not that very good as these applications cannot take advantages of local operating systems.
c. Latency period of the application is quite high. That is the wait period of the application when the client requests for a data, server process the data and sends it back is quite high.
d. Donot support ocassionally connected applications.
Smart Client Applications
As discussed earlier, Smart client applications are designed to combine the benefits of a rich client application with the benefits of a thin client applications.
Advantages of smart client applications
a. Make use of local hardware resources
b. Make use of network resources
c. Easier for update installations
d. supports ocassionally supported clients.
e. We can develop smart windows application, smart office applications and mobile smart client applications.
Challenges of smart client applications
a. Creating the architecture of a smart client applications is very difficult.
b. Handling data in smart client applications is a real difficulty because in smart client application data resides both in the client and web server.
Following are various types of smart clent applications:
a. Windows smart client applications
b. Office smart client applications
c. Mobile smart client applications
Windows smart client applications:
Windows smart client application are suitable when we need an application that has to be deployed and accessed like a desktop-type application.
Windows smart client applications typically provide the msot of their functionality as a stand-alone application but when needed these applications can integrate themseleves with other applications when required. These applications provide functionality that can be tuned to particular tasks . These applications take the very advantage of rich UI of thick clients.
Windows smart client applications are most suitable for applications that run on desktop, laptop, or tablet PCs. These applications are not tightly associated with a particular document or
document type.
Office smart clients:
I have not worked much on office smart clients , so I maynot be able to explain office smart clients completly.
But briefly speaking , office smart clients are Microsoft office applications which can provide context-sensitive data as the user works ,these applications also provide workflow and task guidance, data analysis, collaboration, reporting etc. smart office applications are exposed by Web services and help transform data into useful information.
Mobile smart client applications:
Mobile smart client applications are used to provide stable connected and disconnected access to mobile users, laptop and tablet PC users. These are similar to Windows smart client applications with a small difference that these applications are developed in Micrsoft .NET compact framework.More or less these applications are similar to Windows smart client applications.
Conclusion:
At this age , mobile client users are increasing so smart clients are taking up the thick client applications , because using smart client it is easier to address these client who are connected/disconnected based on business use.
Monday, 28 January 2013
Sending and Logging Custom Errors in ASP.Net MVC
When you set the custom errors as remote only , you basically want to use the errors for debugging and fixing the problems.
There are various ways how you can use the very useful information from custom errors and notify these errors to the website administrators within no time.
Notifications can happen in many different ways out of which following are the most used:
a. Use Event Log on the server system.
b. Use log tables in SQL Server to log errors.
c. Write error log on to a text file and save them in folders.
d. Send Email to admin(s) with relevant information.
e. Send pager/sms with relevant information to the admin/maintenance team.
Notification of the error can be sent to the administrator in one of the following two ways:
1) Error can be registered as a log entry in the Windows Event Log on the administrator's machine
2) An Email can be sent to the administrator with a suitable error message
Writing to the Event Log
In ASP.NET, error can be handled programmatically by writing appropriate code in the page-level error event, for errors on an individual page or in the application-level error event for handling errors that may occur in any page of the application.
Therefore, code for writing in the Event Log should be written in either of the events, depending on the requirement of the application. To illustrate this example, I have written the code in the application-level event with the error mode set to "RemoteOnly" and the defaultRedirect attribute to error.htm. The application-level error event should be included in the global file global.asax within the same application folder.
Event Log support is provided in .NET through the namespace System.Diagnostics.
SMTP mail service support is provided in .NET through the namespace System.Web.Mail.
To Log the errors into SQL, create a log table and use ADO.Net classes to write the errors.
To Log error on to text file use System. IO
To send message use System.Net
Send a mail across to me in case you want to implement any of these methods but are confused/need help to implement this.
There are various ways how you can use the very useful information from custom errors and notify these errors to the website administrators within no time.
Notifications can happen in many different ways out of which following are the most used:
a. Use Event Log on the server system.
b. Use log tables in SQL Server to log errors.
c. Write error log on to a text file and save them in folders.
d. Send Email to admin(s) with relevant information.
e. Send pager/sms with relevant information to the admin/maintenance team.
Notification of the error can be sent to the administrator in one of the following two ways:
1) Error can be registered as a log entry in the Windows Event Log on the administrator's machine
2) An Email can be sent to the administrator with a suitable error message
Writing to the Event Log
In ASP.NET, error can be handled programmatically by writing appropriate code in the page-level error event, for errors on an individual page or in the application-level error event for handling errors that may occur in any page of the application.
Therefore, code for writing in the Event Log should be written in either of the events, depending on the requirement of the application. To illustrate this example, I have written the code in the application-level event with the error mode set to "RemoteOnly" and the defaultRedirect attribute to error.htm. The application-level error event should be included in the global file global.asax within the same application folder.
Event Log support is provided in .NET through the namespace System.Diagnostics.
SMTP mail service support is provided in .NET through the namespace System.Web.Mail.
To Log the errors into SQL, create a log table and use ADO.Net classes to write the errors.
To Log error on to text file use System. IO
To send message use System.Net
Send a mail across to me in case you want to implement any of these methods but are confused/need help to implement this.
Custom Errors in ASP.NET
What are Custom Errors?
There are certain errors/exceptions which are thrown by the operating system or the dot net framework when doing application programming we need to handle these errors properly. Dot net provides various ways to handle these kind of exceptions using CLR.
There are some errors which are application specific , there are also some errors which may pop-up in your application in adverse scenarios. When these kind of errors/exceptions are not handled properly ASP.NET shows a default error page that gives a brief description of the error along with the line number on which the error occurred. This page reveals a lot of information to the public , which may be dangerous when the information gets into wrong hands. Although these error pages are useful to a developer , who would wish to view this default error page, during the testing of the application since the description helps him in rectifying the error. But you would never want a user trying to access his application, to view this error page. The user would be least bothered to know about the error. Instead of showing the default error page, you should show a customized error page that would let the user send notification of the error to the administrator.
There are three different ways you can handle errors in ASP.Net.
Following are the error modes in which an ASP.NET application can work:
1) Off Mode
2) On Mode
3) RemoteOnly Mode
By default, the mode value is set to "RemoteOnly".
Off Mode :When the error attribute is set to "Off", ASP.NET uses its default error page for both local and remote users in case of an error.
On Mode :In case of "On" Mode, ASP.NET uses user-defined custom error page instead of its default error page for both local and remote users. If a custom error page is not specified, ASP.NET shows the error page describing how to enable remote viewing of errors.
RemoteOnly :ASP.NET error page is shown only to local users. Remote requests will first check the configuration settings for the custom error page or finally show an IIS error.
You need to customize error page implementatio in configuration file by adding a value for an attribute defaultRedirect in the <customErrors> tag of the configuration file web.config.
This file determines configuration settings for the underlying application.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<customErrors mode="Off" />
</system.web>
</configuration>
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<customErrors defaultRedirect="error.htm" mode="On" />
</system.web>
</configuration>
RemoteOnly Mode
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<customErrors defaultRedirect="error.htm" mode="RemoteOnly" />
</system.web>
</configuration>
In the next article we will see how we can send errors to administrators.
There are certain errors/exceptions which are thrown by the operating system or the dot net framework when doing application programming we need to handle these errors properly. Dot net provides various ways to handle these kind of exceptions using CLR.
There are some errors which are application specific , there are also some errors which may pop-up in your application in adverse scenarios. When these kind of errors/exceptions are not handled properly ASP.NET shows a default error page that gives a brief description of the error along with the line number on which the error occurred. This page reveals a lot of information to the public , which may be dangerous when the information gets into wrong hands. Although these error pages are useful to a developer , who would wish to view this default error page, during the testing of the application since the description helps him in rectifying the error. But you would never want a user trying to access his application, to view this error page. The user would be least bothered to know about the error. Instead of showing the default error page, you should show a customized error page that would let the user send notification of the error to the administrator.
There are three different ways you can handle errors in ASP.Net.
Following are the error modes in which an ASP.NET application can work:
1) Off Mode
2) On Mode
3) RemoteOnly Mode
By default, the mode value is set to "RemoteOnly".
Off Mode :When the error attribute is set to "Off", ASP.NET uses its default error page for both local and remote users in case of an error.
On Mode :In case of "On" Mode, ASP.NET uses user-defined custom error page instead of its default error page for both local and remote users. If a custom error page is not specified, ASP.NET shows the error page describing how to enable remote viewing of errors.
RemoteOnly :ASP.NET error page is shown only to local users. Remote requests will first check the configuration settings for the custom error page or finally show an IIS error.
You need to customize error page implementatio in configuration file by adding a value for an attribute defaultRedirect in the <customErrors> tag of the configuration file web.config.
This file determines configuration settings for the underlying application.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<customErrors mode="Off" />
</system.web>
</configuration>
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<customErrors defaultRedirect="error.htm" mode="On" />
</system.web>
</configuration>
RemoteOnly Mode
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<customErrors defaultRedirect="error.htm" mode="RemoteOnly" />
</system.web>
</configuration>
In the next article we will see how we can send errors to administrators.
Sunday, 27 January 2013
How to add double quotes in a string
Often we face situations where we need to add double quotes in a string.
In C# following is the way I have found out to add double quotes to a string.
1. Add escape characters to string by doubling them (verbatim string literal):
var str = @"""doublequotes""";
var string1 = @"firstpart ""part in quotes"" laterpart";
2. Add a normal string literal you escape them with a \:
string str = "\"doublequotes\"";
var string2 = "firstpart\"part in quotes\" laterpart";
When working on asp.net , you can try following.
string title = string.Format("<div>\"{0}\"</div>", "text to be filled");
You can also use:
&dquo;
<div>&dquo;"+ title +@"&dquo;</div>
or escape the double quote
\"
<div>\""+ title +@"\"</div>
In C# following is the way I have found out to add double quotes to a string.
1. Add escape characters to string by doubling them (verbatim string literal):
var str = @"""doublequotes""";
var string1 = @"firstpart ""part in quotes"" laterpart";
2. Add a normal string literal you escape them with a \:
string str = "\"doublequotes\"";
var string2 = "firstpart\"part in quotes\" laterpart";
When working on asp.net , you can try following.
string title = string.Format("<div>\"{0}\"</div>", "text to be filled");
You can also use:
&dquo;
<div>&dquo;"+ title +@"&dquo;</div>
or escape the double quote
\"
<div>\""+ title +@"\"</div>
Saturday, 26 January 2013
How to host wcf rest services on IIS
Configuring a WCF service and WCF REST service on IIS differs a little why because,
WCF does not understand the REST address so you need to configure the endpoint behavior as webHttp.
Generally we encounter exceptions when hosting WCF REST services on IIS.
The message with To <address> cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver's EndpointAddresses agree.
Following is a sample of configuration file that should be used to resolve this.
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="WebBehavior">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
<services>
<service name="FullName">
<endpoint address="js" binding="webHttpBinding" behaviorConfiguration="WebBehavior" contract="ServiceContractName"/>
</service>
</services>
</system.serviceModel>
WCF does not understand the REST address so you need to configure the endpoint behavior as webHttp.
Generally we encounter exceptions when hosting WCF REST services on IIS.
The message with To <address> cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver's EndpointAddresses agree.
Following is a sample of configuration file that should be used to resolve this.
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="WebBehavior">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
<services>
<service name="FullName">
<endpoint address="js" binding="webHttpBinding" behaviorConfiguration="WebBehavior" contract="ServiceContractName"/>
</service>
</services>
</system.serviceModel>
Windows Azure with database other than SQL Server
There are many application which are in asp.net/C# but use the database as Oracle / MySQL. How to convert these applications into a Azure cloud hosted application.
Option 1 : Write a completely new application for Azure cloud , also change the database from Oracle/MySQL or other to a SQL database on cloud.
Option 2: Port the asp.net app on Azure and change the database from Oracle/MySQL or other to a SQL database on cloud.
Option 3 : Port the asp.net app on Azure and keep the database as is as an on-premise database.
Now , I will vote for option 3.
I will try to explain this with the following architecture solution.
We have the db as Orcale/My SQL which is present as an on-premise database , now create an ADO.Net entity Model for the database , create a WCF data service to connect to the database , host the WCF service on-premise. Port your asp.net application on Azure cloud and connect to the server which is hosting the WCF service using a service bus.
In case you want to know the solution in detail or want me to help you architecting your solution , write to me at archita.dash@happiestminds.com
Option 1 : Write a completely new application for Azure cloud , also change the database from Oracle/MySQL or other to a SQL database on cloud.
Option 2: Port the asp.net app on Azure and change the database from Oracle/MySQL or other to a SQL database on cloud.
Option 3 : Port the asp.net app on Azure and keep the database as is as an on-premise database.
Now , I will vote for option 3.
I will try to explain this with the following architecture solution.
We have the db as Orcale/My SQL which is present as an on-premise database , now create an ADO.Net entity Model for the database , create a WCF data service to connect to the database , host the WCF service on-premise. Port your asp.net application on Azure cloud and connect to the server which is hosting the WCF service using a service bus.
In case you want to know the solution in detail or want me to help you architecting your solution , write to me at archita.dash
Tuesday, 22 January 2013
Windows 8 Apps : Guidelines
Recently we are trying to push a few of our apps on to windows 8 app store. Before we push the apps the store the app needs to undergo some basic guideline checks.
Microsoft team definitely does those checks , but you can also ensure that your app adheres to all the guidelines set across. To do this we follow a two step process.
Step 1: Run certification kit on your app.
Step 2: Ensure that your app adheres to all the Windows store guidelines set at msdn.
I have captured them here for my reference. You too can use this.
You can also download the document from gdocs.
Microsoft team definitely does those checks , but you can also ensure that your app adheres to all the guidelines set across. To do this we follow a two step process.
Step 1: Run certification kit on your app.
Step 2: Ensure that your app adheres to all the Windows store guidelines set at msdn.
I have captured them here for my reference. You too can use this.
You can also download the document from gdocs.
| Category | Guidance | A few facts |
| Windows Store apps provide value to the customer | Your app must offer customers unique, creative value or utility in all the languages and markets that it supports | |
| Your app must be fully functional when the customer gets it from the Windows Store | ||
| Your app’s trial functionality must reasonably resemble its full functionality | ||
| Each app must display only one tile after it is installed | ||
| Windows Store apps can display ads but are more than just ads or websites | Your app must not display only ads | |
| Ads in your apps must comply with our content policies | ||
| Your app must not use its description, tiles, notifications, app bar, or the swipe-from-edge interactions to display ads | ||
| The primary experiences your app provides must take place within the app | ||
| Ads must not execute program code that didn't come from the ad provider | ||
| Windows Store apps behave predictably | You must use only the Windows Runtime APIs to implement the features of your Windows Store app | |
| Your app must not stop responding, end unexpectedly, or contain programming errors | ||
| Your app must provide the same user experience on all processor types that it supports | ||
| Updates must not decrease your app’s functionality in a way that would be unexpected to a reasonable customer | ||
| Your app must fully support touch input, and fully support keyboard and mouse input | ||
| Your app must use the mechanisms provided by the system for those features that have them | ||
| Your app must meet the basic performance criteria on a low-power computer | The
app must launch in 5 seconds or less |
|
| The app must suspend in 2 seconds or less | ||
| All app logic must originate from, and reside in, your app package | ||
| Direct3D apps must support a minimum feature level | ||
| If your app contains Windows Runtime components, they must conform to the Windows Runtime type system | Must
be located in the package file with the longest namespace-matching
name. |
|
| Must be the only types with public visibility
in a Windows Metadata (.winmd) file. |
||
| Must have a unique, case insensitive
name. |
||
| Must not be located in the Windows or global namespace. | ||
| Must have public visibility unless the type is an interface marked as exclusive to a specific runtime class. | ||
| Must be sealed unless the type is a runtime class marked as composable. | ||
| Must compose an unsealed system class, if the type is a composable runtime class. | ||
| Must not include write-only properties. | ||
| Must not implement interfaces that are marked as exclusive to another class. | ||
| Must not be generic or parameterized. | ||
| Must not define methods that overload operators. | ||
| Must not change signature or parameter names between interface and runtime method declarations. | ||
| Must not include default values for method parameters. | ||
| Must not include property getters that take input parameters. | ||
| Must not include property setters that take more than the single set value parameter. | ||
| Must not define factory methods with additional out parameters beyond the return value. | ||
| Must not use IReferenceArray<T> or IReference<string> as a parameter type. | ||
| Must not use the signed byte fundamental type. | ||
| Must define enums with an underlying type of Int32 or UInt32 only. | ||
| Must apply the FlagsAttribute to UInt32 enums. | ||
| Must not apply the FlagsAttribute to Int32 enums. | ||
| Windows Store apps put the customer in control | Your app must comply with the following privacy-related requirements: | |
| Your app must have a privacy statement if it is network-capable | ||
| Your app must obtain opt-in or equivalent consent to share personal information | ||
| Your app must respect system settings for notifications and remain functional when they are disabled | ||
| Your app must not jeopardize or compromise the security or functionality of the Windows system | ||
| Your app must not be designed or marketed to perform, instruct, or encourage tasks that could cause physical harm to a customer or any other person | ||
| Your app must protect customers from unintentional large data transfers over metered networks | ||
| Your app must comply with Windows Push Notification Service (WNS) requirements if it uses WNS notifications | You may only use WNS for apps distributed through the Windows Store. Notifications provided through WNS are considered app content and are subject to all Windows Store app policies, including the certification requirements. | |
| Your app must be associated with only one Package Security Identifier. | ||
| You may not obscure or try to disguise the source of any WNS message or Package Security Identifier, or other unique referral identifier. | ||
| You may not include in a notification any info a customer would reasonably consider to be confidential or sensitive. | ||
| Your app must not use excessive network capacity or WNS bandwidth, or otherwise unduly burden the Windows system with WNS notifications. For example, using WNS to stream content or transfer files violates this requirement. | ||
| If you use a commerce transaction provider other than the Store's, you must identify the provider at the time of the transaction or whenever you collect any payment information from the customer | ||
| Your app must prompt the user for authentication to allow a commerce transaction to be accomplished. | ||
| If your app collects credit card info or uses a third-party payment processor that collects credit card info, the payment processing must meet the current PCI Data Security Standard (PCI DSS) | ||
| Windows apps are appropriate for a global audience | Your app must conform to our content and age rating guidelines, and metadata must be appropriate for everyone | |
| Your app must not contain content that
advocates discrimination, hatred, or violence based on membership in a
particular racial, ethnic, national, linguistic, religious, or other social
group, or based on a person’s gender, age, or sexual orientation |
||
| Your app must not contain content or
functionality that encourages, facilitates or glamorizes illegal activity in
the real world |
||
| Your app must not contain or display content
that a reasonable person would consider to be obscene or pornographic |
||
| Your app must not contain content that is defamatory, libelous or slanderous, or threatening | ||
| Your app must not contain content that facilitates or glamorizes excessive or irresponsible use of alcohol or tobacco products, drugs or weapons | ||
| Your app must not contain content that facilitates or glamorizes extreme or gratuitous violence, human rights violations, or the creation or illegal use of weapons against a person or animal in the real world | ||
| Your app must not contain excessive or gratuitous profanity | ||
| Windows Store apps are easily identified and understood | Your app must have a unique name | |
| Your app must have a Windows age rating, and you must submit third-party ratings for your app if you have them | ||
| You must provide technical support info for your app | ||
| You must list your app in at least one of the Windows Store's geographic markets | ||
| You must list your app in at least one of the Windows Store's geographic markets | ||
| The capabilities you declare must relate to the core functions and value proposition of your Windows Store app, and the use of those declarations must be compliant with our app capability declarations | ||
| You must describe any changes to your app when you submit an update to the Store | ||
| You must provide localized screenshots of your app for each language your app supports | ||
| Your Windows Store app’s packages must have a correct app manifest | ||
| Your Windows Store app’s packages must be correctly formatted | ||
| The app's category and subcategory must correspond to the character or purpose of your app | ||
| Desktop apps must follow additional requirements | The purchase page link provided for your app must send users to a location where they can directly download the app, and must not lead users to another intermediary site or a site that spoofs the purchase page | |
| The information you provide to the Store about
your app must match the information used on the purchase page for that app.
That includes your app or company logo, the app name, price and major and
minor version numbers |
Subscribe to:
Posts (Atom)
