<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5101186261789138201</id><updated>2011-04-21T14:51:53.669-07:00</updated><title type='text'>Software Design &amp; Development</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://softwaredesigns.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5101186261789138201/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://softwaredesigns.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Rabeeh Abla</name><uri>http://www.blogger.com/profile/13861386414274784680</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5101186261789138201.post-8115820918614084492</id><published>2008-01-15T00:21:00.000-08:00</published><updated>2008-01-20T14:01:24.459-08:00</updated><title type='text'>.Net Design patterns</title><content type='html'>&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;Design patterns are recurring sequences, built-in .Net patterns are scattered over the framework.&lt;br /&gt;&lt;br /&gt;In practice following standard software patterns will help to achieve a more standard code, that is manageable, and understandable by a bigger set of software programmers/developers and architects.&lt;br /&gt;&lt;br /&gt;For example the data adapter factory, that enables the creation of specific DBMS adapters. This centralized class helps in establishing a strong data layer, that supplies a more generic way to communicate with business layer.&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;br /&gt;Imports System.Data.Common&lt;br /&gt;&lt;br /&gt;dbPFactory = DbProviderFactories.GetFactory(“FactoryName”)&lt;br /&gt;adapter = dbPFactory.CreateDataAdapter() &lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;In simple technical english, a factory pattern is responsible for managing and creating product class instances from a base class that has increasing or more than one number of child classes. The DbProviderFactories is a factory of factories, that manages the dbms adapters in .Net 2.0. Building a class wrapper over this architecture and supplying the correct parameters will enable the direct generation of specified data adapters to communicate with most of the standard DBMS in the market.&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;Singleton pattern is implemented in many places in the .net framework, single instance window applications, also in remoting we deal with singleton classes.&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;A singleton pattern can be achieved by forbidding the creation of direct class instance, using the constructors. This is done by making constructors private, and preventing the user from creating an instance of the class.&lt;br /&gt;&lt;br /&gt;This enables only the creation of instances from class scope. To enable single instance in memory we use static or shared reference to the class, we make it private to prevent public access, and we set it to NULL.&lt;br /&gt;&lt;br /&gt;We add a static or shared function that checks if the class static reference is NULL, if NULL an instance is created, otherwise the previous instance is returned.&lt;br /&gt;&lt;br /&gt;The .Net frame makes good use of the proxy pattern , that is a mediator between the real object and the client object. When applying proxy design pattern, the proxy class provides the same services as the real object. That is they inherit from same base class, or apply the same interface. Proxy classes are used in remoting, and when communicating with services. &lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;Such patterns define the extensions road map for the framework, using these patterns will allow your application benefit a great deal, for extendability and code maintenance.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left"&gt;This was an introduction to .Net Design patterns, I an example of using DBFactory to create a generic adapter can be downloaded using the following link &lt;a id="ctl00_MC_ArticlePath" href="http://www.codeproject.com/KB/dotnet/dotNetDesignPatterns_.aspx"&gt;http://www.codeproject.com/KB/dotnet/dotNetDesignPatterns_.aspx&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;Regards&lt;/div&gt;&lt;div align="justify"&gt;Rabeeh Abla &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5101186261789138201-8115820918614084492?l=softwaredesigns.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://softwaredesigns.blogspot.com/feeds/8115820918614084492/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5101186261789138201&amp;postID=8115820918614084492' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5101186261789138201/posts/default/8115820918614084492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5101186261789138201/posts/default/8115820918614084492'/><link rel='alternate' type='text/html' href='http://softwaredesigns.blogspot.com/2008/01/net-software-patterns.html' title='.Net Design patterns'/><author><name>Rabeeh Abla</name><uri>http://www.blogger.com/profile/13861386414274784680</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5101186261789138201.post-954523279030956064</id><published>2008-01-15T00:17:00.000-08:00</published><updated>2008-01-16T04:35:41.231-08:00</updated><title type='text'>Refactoring - Functions</title><content type='html'>&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;Rules:&lt;br /&gt;&lt;br /&gt;- A function does only one goal, or a grouped goal created from sub goals.&lt;br /&gt;&lt;br /&gt;- A set of instructions is formed into a function, if it achieves a certain job that can be of multiple or future use.&lt;br /&gt;&lt;br /&gt;- Instructions that can not be grouped into one goal or job , are classified under compound functions, and should be partitioned into sub functions.&lt;br /&gt;&lt;br /&gt;Functions should follow defined patterns, for example a function will be more manageable if has defined exit points, increasing the exit points by adding returns, will make the function harder to debug, maintain and fix.&lt;br /&gt;&lt;br /&gt;Return types should be documented, for example if return type is Boolean, the values that will be returned belong to the following set : {True, False}, this is manageable.&lt;br /&gt;&lt;br /&gt;But if the return type is of bigger set for example integer belonging to set {…,-3,-2,-1,0,1,2,3,4,…}, and the function logic we wrote calculates values that belong to a smaller set N of non-negatives.&lt;br /&gt;&lt;br /&gt;We pattern our function ‘return type’ domain to the following:&lt;br /&gt;&lt;br /&gt;- Positive as legal value&lt;br /&gt;- 0&lt;br /&gt;- -1 as Error occurred for example, or nothing found&lt;br /&gt;&lt;br /&gt;The idea is to define boundaries for the return type domain, in order to remove ambiguity.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Variables and References // global to function&lt;br /&gt;&lt;br /&gt;Info resultInfo { Success, Result, Error}&lt;br /&gt;&lt;br /&gt;Try&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;Critical Code instructions&lt;br /&gt;&lt;br /&gt;resultInfo.Result = {Code Result}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;Catch(Exception ex)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;resultInfo.Error = ex.Message&lt;/div&gt;&lt;div align="justify"&gt;resultInfo.Success = false // Signal failure&lt;/div&gt;&lt;div align="justify"&gt;Log(ex) // Log error&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;Finally&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;Recurring logic, clean up or concluding calculation&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Return resultInfo&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5101186261789138201-954523279030956064?l=softwaredesigns.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://softwaredesigns.blogspot.com/feeds/954523279030956064/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5101186261789138201&amp;postID=954523279030956064' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5101186261789138201/posts/default/954523279030956064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5101186261789138201/posts/default/954523279030956064'/><link rel='alternate' type='text/html' href='http://softwaredesigns.blogspot.com/2008/01/refactoring-functions.html' title='Refactoring - Functions'/><author><name>Rabeeh Abla</name><uri>http://www.blogger.com/profile/13861386414274784680</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5101186261789138201.post-2165954292620357590</id><published>2008-01-15T00:13:00.000-08:00</published><updated>2008-01-15T01:05:36.111-08:00</updated><title type='text'>Naming patterns</title><content type='html'>&lt;div align="justify"&gt;Choosing friendly variable names, types, and Methods will help in making the code easier to read understand and use.&lt;br /&gt;&lt;br /&gt;Enumeration Type Naming Guidelines&lt;br /&gt;&lt;br /&gt;Namespace Naming Guidelines&lt;br /&gt;&lt;br /&gt;Class Naming Guidelines&lt;br /&gt;&lt;br /&gt;Interface Naming Guidelines&lt;br /&gt;&lt;br /&gt;Method Naming Guidelines&lt;br /&gt;&lt;br /&gt;Parameter Naming Guidelines&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5101186261789138201-2165954292620357590?l=softwaredesigns.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://softwaredesigns.blogspot.com/feeds/2165954292620357590/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5101186261789138201&amp;postID=2165954292620357590' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5101186261789138201/posts/default/2165954292620357590'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5101186261789138201/posts/default/2165954292620357590'/><link rel='alternate' type='text/html' href='http://softwaredesigns.blogspot.com/2008/01/naming-patterns.html' title='Naming patterns'/><author><name>Rabeeh Abla</name><uri>http://www.blogger.com/profile/13861386414274784680</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5101186261789138201.post-6091887865254731314</id><published>2008-01-15T00:06:00.000-08:00</published><updated>2008-01-15T01:05:48.366-08:00</updated><title type='text'>Documentation</title><content type='html'>&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="justify"&gt;Documentation is very important, there is an old famous saying "The computers will always understand the code, but humans will not" writing for yourself and others.&lt;br /&gt;&lt;br /&gt;Documenting function parameters and return values.&lt;br /&gt;&lt;br /&gt;Using friendly names that reflects the algorithm flow and motive.&lt;br /&gt;&lt;br /&gt;Practice documentation at programming-time, document the function role and motive, if the function impacts on shared or global data it is important to write the pre and post states that should happen and will occur.&lt;br /&gt;&lt;br /&gt;Documentation should be at all levels from class responsibilities and role, global variables, methods their parameters, and complicated instructions.&lt;br /&gt;&lt;br /&gt;Documenting class relations, using UML (Unified modeling language) to display the architecture used, and help with extension of the code.&lt;br /&gt;&lt;br /&gt;Documenting the whole software cycle from requirement phase to developing phase will enable later the maintenance at minimum cost.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5101186261789138201-6091887865254731314?l=softwaredesigns.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://softwaredesigns.blogspot.com/feeds/6091887865254731314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5101186261789138201&amp;postID=6091887865254731314' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5101186261789138201/posts/default/6091887865254731314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5101186261789138201/posts/default/6091887865254731314'/><link rel='alternate' type='text/html' href='http://softwaredesigns.blogspot.com/2008/01/documentation.html' title='Documentation'/><author><name>Rabeeh Abla</name><uri>http://www.blogger.com/profile/13861386414274784680</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
