Posted in Uncategorized | Leave a Comment »
I am very much concerned about the future of WPF-Silverlight-.Net in the hands of Windows 8 OS.
Julie Larson-Green, Microsoft’s corporate vice president of the Windows experience said “This application [Windows 8] was written in our new development platform, based on HTML5 and JavaScript. … People can write new applications … using the things they are already doing on the Internet.” …
Which means, Windows 8 Apps are going to be on HTML5/JavaScript…..it’s really crazy? I don’t just understand the Redmond strategy behind it.
The people talking about is…..majority of the client developers are writing apps using HTML, and others are busy with Android and iOS apps. So Microsoft somehow get the guys back to develop Windows 8 Apps using HTML5 and JavaScript.
The noise and buzz being generated about the lack of clarity in this regard is puzzling to me.
Let wait and see!!!!
Posted in .Net Articles | Leave a Comment »
Language modifiers such as sealed, public, private, and virtual give you a level of control over the ability of classes to inherit from your class and override its members. However, these modifiers are inflexible, providing no selectivity in restricting what code can extend a class or override its members.
For example, you might want to allow only code written by your company or department to extend business-critical classes. By applying an InheritanceDemand attribute to your class or member declaration, you can specify runtime permissions that a class must have to extend your class or override particular members. Remember that the permissions of a class are the permissions of the assembly in which the class is declared.
Although you can demand any permission or permission set in your InheritanceDemand, it’s more common to demand identity permissions. Identity permissions represent evidence presented to the runtime by an assembly. If an assembly presents certain types of evidence at load time, the runtime will automatically assign the assembly the appropriate identity permission. Identity permissions allow you to use regular imperative and declarative security statements to base security decisions directly on code identity, without the need to evaluate evidence objects directly.
Note The runtime assigns identity permissions to an assembly based on the evidence presented by the assembly. You cannot assign additional identity permissions to an assembly through the configuration of security policy.
You must use declarative security syntax to implement an InheritanceDemand, and so you must use the attribute counterpart of the permission class that you want to demand. All permission classes, including InheritanceDemand, have an attribute counterpart that you use to construct declarative security statements. For example, the attribute counterpart of PublisherIdentityPermission is PublisherIdentityPermissionAttribute, and the attribute counterpart of StrongNameIdentityPermission is StrongNameIdentityPermissionAttribute. All permissions and their attribute counterparts follow the same naming convention and are members of the same namespace. To control which code can extend your class, apply the InheritanceDemand to the class declaration.
To control which code can override specific members of a class, apply the InheritanceDemand to the member declaration.
The Example
The following example demonstrates the use of an InheritanceDemand attribute on both a class and a method. Applying a PublisherIdentityPermissionAttribute to the SomeProtectedClass class means that only classes in assemblies signed by the publisher certificate contained in the pubcert.cer file (or assemblies granted FullTrust) can extend the class. The contents of the pubcert.cer file are read at compile time, and the necessary certificate information is built into the assembly metadata. To demonstrate that other permissions can also be used with an InheritanceDemand, the PermissionSetAttribute is used to allow only classes granted the FullTrust permission set to override the method SomeProtectedMethod.
using System.Security.Permissions;
[PublisherIdentityPermission(SecurityAction.InheritanceDemand, CertFile = "pubcert.cer")]
public class SomeProtectedClass
{
[PermissionSet(SecurityAction.InheritanceDemand, Name="FullTrust")]
public void SomeProtectedMethod ()
{
// Method implementation . . .
}
}
Posted in .Net Articles, C# | Leave a Comment »
.NET Framework 4 released with some exiting new features and applauded improvements in the area of Windows Communication Foundation (WCF). These WCF enhancements focus primarily on
• Simplifying the developer experience
• Enabling more communication scenarios and
• Providing rich integration with Windows Workflow Foundation (WF) by making “workflow services” a first-class citizen moving forward.
The good news is that most of the WCF 4 changes focus on making today’s common scenarios easier and making new communication scenarios and development styles possible. As a result, moving your existing WCF solutions to .NET 4 will be fairly seamless in terms of migration. Then you simply decide which WCF 4 features you want to take advantage of in your solutions moving forward.
WCF 4 comes with a wide range of specific features. These feature areas summarize most of what’s new in WCF 4 and they highlight the top-level opportunities offered by this release of the .NET framework.
Simplified Configuration
Simplification of the WCF configuration section through support for default endpoints, binding and behavior configurations. These changes make it possible to host configuration-free services, greatly simplifying the developer experience for the most common WCF scenarios.
Discovery
New framework support for both ad hoc and managed service discovery behaviors, which conform to the standard WS-Discovery protocol.
Routing Service
New framework support for a configurable routing service that you can use in your WCF solutions. Provides features for content-based routing, protocol bridging, and error handling.
REST Improvements
Enhancements to WCF WebHttp Services with some additional features and tooling that simplify REST service development.
Workflow Services
Rich framework support for integrating WCF with WF to implement declarative long-running workflow services. This new programming model gives you the best both frameworks have to offer (WCF & WF).
Posted in Uncategorized | Leave a Comment »
Last week I was busy with my training on PL/SQL for PSI Data Systems. I was discussing the “PL/SQL Performance tuning with BULK COLLECT” with participants and I demonstrated the performance boost with the example. I would like to share the discussion with this post.
Scenario: Having a table with 10 million records needs to store into the PL/SQL Table by Index collection using the Cursors. The code snippet is as below.
DECLARE
time_before BINARY_INTEGER;
time_after BINARY_INTEGER;
CURSOR empcur IS SELECT * FROM testemp;
TYPE emp_table_type IS TABLE OF varchar2(20) INDEX BY BINARY_INTEGER;
emp_table emp_table_type;
idx number := 1;
BEGIN
time_before := DBMS_UTILITY.GET_TIME;
OPEN empcur;
LOOP
FETCH empcur INTO emp_table(idx);
idx := idx + 1;
EXIT WHEN empcur%NOTFOUND;
END LOOP;
CLOSE empcur;
time_after := DBMS_UTILITY.GET_TIME;
DBMS_OUTPUT.PUT_LINE (round((time_after – time_before)/60));
END;/
The above code without any performance trick, it took nearly 5 minutes (in my laptop with normal configuration) to complete.
The reason behind the bad performance is, all we know that in PL/SQL there are two statement executors to execute the program. One is SQL statement executor which executes only SQL statements in the program and the other one is PL/SQL statement executor who will execute procedural instructions.
Whenever a PL/SQL program is executing, a context switching will take place between the two statement executors. Especially if the program is doing some iterative task which contains the combination of SQL and PL/SQL code, it needs frequent context switching which Leeds into performance drawback.
This is what happening in the above code while fetching the records one by one in the loop. For each iteration there is a context switching and this will happens over 10 million times.
To avoid the context switching repeatedly, we need to collect the data at once using the below code.
The same code has been modified with the BULK COLLECT as follows.
DECLARE
time_before BINARY_INTEGER;
time_after BINARY_INTEGER;
CURSOR empcur IS SELECT * FROM testemp;
TYPE emp_table_type IS TABLE OF varchar2(20) INDEX BY BINARY_INTEGER;
emp_table emp_table_type;
BEGIN
time_before := DBMS_UTILITY.GET_TIME;
OPEN empcur;
FETCH empcur BULK COLLECT INTO emp_table;
CLOSE empcur;
time_after := DBMS_UTILITY.GET_TIME;
DBMS_OUTPUT.PUT_LINE (round((time_after – time_before)/60));
END;
/
The above code with BULK COLLECT took just 1 minute to complete. So we nearly increased 80% of the performance.
Similarly in PL/SQL there are many such tuning tips are there. So keep visit my blog for more tips.
Happy programming.
Posted in PL/SQL | Tagged BULK COLLECT, Performance Tuning, PL/SQL | 1 Comment »