<?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:blogger='http://schemas.google.com/blogger/2008' 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-8156933787798242641</id><updated>2026-10-10T02:31:50.852-07:00</updated><title type='text'>Learn About Computers and Programming</title><subtitle type='html'>Get information about computers hardware and  programming like java C++ JSP HTML C# JS Css and different frame works.Increase your knowledge about software design and architecture by reading software constructs like what is object what is class .Lean different MVC frame works and apply in your fields </subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://pakitgroup.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://pakitgroup.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>42</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8156933787798242641.post-1245704259249796636</id><published>2013-12-29T01:13:00.002-08:00</published><updated>2013-12-29T01:13:51.771-08:00</updated><title type='text'>How to Connect Java With Mysql in eclipse</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Step 1: Download mysql Connector from the link Below.&lt;br /&gt;
&lt;br /&gt;
http://mirrors.ibiblio.org/pub/mirrors/maven2/mysql/mysql-connector-java/5.0.8/mysql-connector-java-5.0.8.jar&lt;br /&gt;
&lt;br /&gt;
Step2: Right Click on project name select properties, then select java Build Path and go to Libraries tab.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr_uaeT2PeMhyBsJqXtktLBX_8jagCDiTH5q2Jdxk2A392aBKRxn3YADkGI1XJA54LfaOQ0fp_Aq0N4HD63Goa8Pj_pbKWVdRLDjfZeS9VYx_lLiDU-3pHk8FyojH2COym0KSBopsy3dqC/s1600/step+2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr_uaeT2PeMhyBsJqXtktLBX_8jagCDiTH5q2Jdxk2A392aBKRxn3YADkGI1XJA54LfaOQ0fp_Aq0N4HD63Goa8Pj_pbKWVdRLDjfZeS9VYx_lLiDU-3pHk8FyojH2COym0KSBopsy3dqC/s400/step+2.png&quot; width=&quot;327&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Step 3: Click &amp;nbsp;on add External jar browse to the downloaded mysql-connector jar file then Click ok.&lt;br /&gt;
Step 4: &amp;nbsp;write the following code.&lt;br /&gt;
&lt;br /&gt;
import java.sql.*;&lt;br /&gt;
&lt;br /&gt;
public class ConnectToMySql {&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public static void main(String[] args) throws Exception {&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Class.forName(&quot;com.mysql.jdbc.Driver&quot;); //checking for drivers&lt;br /&gt;
//DriverManager.getConnection(&quot;jdbc:mysql://servername/database&quot;,&quot;username&quot;,&quot;password&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Connection con = &amp;nbsp;DriverManager.getConnection(&quot;jdbc:mysql://localhost/test&quot;,&quot;root&quot;,&quot;&quot;);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Statement st=con.createStatement();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.out.println(&quot;Connected To MySql 5.0&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ResultSet rs=st.executeQuery(&quot;SELECT * FROM users&quot;); //users table name&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;while ( rs.next()) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.out.println( rs.getString(&quot;username&quot;) + &quot;:&quot; + rs.getString(&quot;password&quot;));//username and password are the fields of users table&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;con.close();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://pakitgroup.blogspot.com/feeds/1245704259249796636/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/how-to-connect-java-with-mysql-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/1245704259249796636'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/1245704259249796636'/><link rel='alternate' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/how-to-connect-java-with-mysql-in.html' title='How to Connect Java With Mysql in eclipse'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr_uaeT2PeMhyBsJqXtktLBX_8jagCDiTH5q2Jdxk2A392aBKRxn3YADkGI1XJA54LfaOQ0fp_Aq0N4HD63Goa8Pj_pbKWVdRLDjfZeS9VYx_lLiDU-3pHk8FyojH2COym0KSBopsy3dqC/s72-c/step+2.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8156933787798242641.post-2002055030119609972</id><published>2013-12-24T06:49:00.001-08:00</published><updated>2013-12-24T06:49:21.875-08:00</updated><title type='text'>Creating a Client Proxy in Java</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;@WebServiceClient(name = &quot;CalculatorWSService&quot;,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;targetNamespace = &quot;http://calculator.me.org/&quot;,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;wsdlLocation = &quot;http://localhost:4933/CalculatorApp/CalculatorWSService?wsdl&quot;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;public class CalculatorWSService extends Service { //...&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;@WebEndpoint(name = &quot;CalculatorWSPort&quot;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;public CalculatorWS getCalculatorWSPort() {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;return super.getPort(new QName(&quot;http://calculator.me.org/&quot;,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&quot;CalculatorWSPort&quot;), CalculatorWS.class);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Here &amp;nbsp;the &amp;nbsp;getCalculatorWSPort method &amp;nbsp;returns &amp;nbsp;an &amp;nbsp;object &amp;nbsp;that &amp;nbsp;implements &amp;nbsp;the&lt;br /&gt;
CalculatorWSinterface, which is discussed next. The no-arg &amp;nbsp;getPortmethod can be&lt;br /&gt;
used &amp;nbsp;in &amp;nbsp;general; &amp;nbsp;the &amp;nbsp;second &amp;nbsp;getPort method &amp;nbsp;accepts &amp;nbsp;a &amp;nbsp;variable-length &amp;nbsp;array &amp;nbsp;of&lt;br /&gt;
javax.xml.ws.WebServiceFeatureobjects that can be used by clients to configure certain&lt;br /&gt;
aspects of the invocation, such as whether to enable MTOM or WS-Addressing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;In the calculator example, the port has one method, to match the single addoperation&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;defined in the WSDL. Let’s take a step back and unpack this for a moment, as there’s&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;a lot going on here:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;@WebMethod&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;@WebResult(targetNamespace = &quot;&quot;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;@RequestWrapper(localName = &quot;add&quot;,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;targetNamespace = &quot;http://calculator.me.org/&quot;,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;className = &quot;org.me.calculator.Add&quot;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;@ResponseWrapper(localName = &quot;addResponse&quot;,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;targetNamespace = &quot;http://calculator.me.org/&quot;,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;className = &quot;org.me.calculator.AddResponse&quot;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;public int add(&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;@WebParam(name = &quot;i&quot;, targetNamespace = &quot;&quot;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;int i,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;@WebParam(name = &quot;j&quot;, targetNamespace = &quot;&quot;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;int j);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
As you can see, your seemingly simple, innocuous addmethod suddenly has a variety&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
of annotations adorning it. We’ll account for these one by one.&lt;br /&gt;
First, your WSDL specifies the following in the messages section:&lt;br /&gt;
&amp;lt;message name=&quot;add&quot;&amp;gt; &amp;lt;part name=&quot;parameters&quot; element=&quot;tns:add&quot;&amp;gt;&amp;lt;/part&amp;gt; &amp;lt;/message&amp;gt;&lt;br /&gt;
So the SEI needs to account for this message, and creates an annotation indicating that&lt;br /&gt;
the runtime will create a message with a QNamethat contains a local part of add, in the&lt;br /&gt;
specified &amp;nbsp;namespace. That message is derived from the Java class that is also generated,&lt;br /&gt;
org.me.calculator.Add, which looks like this:&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;@XmlAccessorType(XmlAccessType.FIELD)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;@XmlType(name = &quot;add&quot;, propOrder = {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&quot;i&quot;,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&quot;j&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;})&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;public class Add {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;protected int i;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;protected int j;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;//getters and setters omitted&lt;/span&gt;&lt;br /&gt;
That class acts as the wrapper for each of the integers that will be sent in the request.&lt;br /&gt;
The @Xml annotations on this class come from JAXB. They indicate how JAXB should&lt;br /&gt;
marshal and unmarshal instances of this class to and from XML. The @XmlTypeannotation is used to specify that this &amp;nbsp;Addclass matches a top-level complex type (or an&lt;br /&gt;
enum) within an XML schema, and the “name” property is specified as “add” in it, to&lt;br /&gt;
match the item’s name within the schema. If you look at the schema that your WSDL&lt;br /&gt;
refers to, you see the following complex type, which matches your Addclass:&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&amp;lt;xs:complexType name=&quot;add&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&amp;lt;xs:sequence&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&amp;lt;xs:element name=&quot;i&quot; type=&quot;xs:int&quot;&amp;gt;&amp;lt;/xs:element&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&amp;lt;xs:element name=&quot;j&quot; type=&quot;xs:int&quot;&amp;gt;&amp;lt;/xs:element&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&amp;lt;/xs:sequence&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&amp;lt;/xs:complexType&amp;gt;&lt;/span&gt;&lt;br /&gt;
But why does this type get created for you? Integers are defined as basic types provided&lt;br /&gt;
with XML Schema; they are not custom types that you have written that require something special. The complex type that wraps these two integers is created in order to&lt;br /&gt;
match your WSDL, which uses the document/literal style. Here is the portion of the&lt;br /&gt;
WSDL that tells you this:&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&amp;lt;soap:binding transport=&quot;http://schemas.xmlsoap.org/soap/http&quot;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;style=&quot;document&quot;&amp;gt;&amp;lt;/soap:binding&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&amp;lt;operation name=&quot;add&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&amp;lt;soap:operation soapAction=&quot;&quot;&amp;gt;&amp;lt;/soap:operation&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&amp;lt;input&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&amp;lt;soap:body use=&quot;literal&quot;&amp;gt;&amp;lt;/soap:body&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&amp;lt;/input&amp;gt;&lt;/span&gt;&lt;br /&gt;
Had you been using RPC and not document, the values would have been passed separately to the operation invocation just like method parameters.&lt;br /&gt;&lt;br /&gt;
The &amp;nbsp;@RequestWrapperand &amp;nbsp;@ResponseWrapperannotations capture information that JAXB&lt;br /&gt;
needs to perform the marshaling and unmarshaling operations. If your service is defined&lt;br /&gt;
as using document/literal mode, as ours is, this annotation also serves to resolve overloading conflicts.&lt;br /&gt;
Now, let’s write a quick program to invoke the generated client code and get a result&lt;br /&gt;
from your service. Here are the steps in their simplest form, stripped of any unnecessary&lt;br /&gt;
items so you can get the clearest picture.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;import org.me.calculator.*;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;public class CalculatorInvoker {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;public static void main(String... arg) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;CalculatorWSService service = new CalculatorWSService();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;CalculatorWS port = service.getCalculatorWSPort();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;int result = port.add(2, 3);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;System.out.println(&quot;Result: &quot; + result);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Then you can run it:&lt;br /&gt;
&amp;gt;java -cp . CalculatorInvoker&lt;br /&gt;
Result: 5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://pakitgroup.blogspot.com/feeds/2002055030119609972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/creating-client-proxy-in-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/2002055030119609972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/2002055030119609972'/><link rel='alternate' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/creating-client-proxy-in-java.html' title='Creating a Client Proxy in Java'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8156933787798242641.post-1384165801204288001</id><published>2013-12-24T06:44:00.001-08:00</published><updated>2013-12-24T06:44:26.470-08:00</updated><title type='text'>Invoking the Simplest Web Service In Java</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;import java.net.URL;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;import java.util.Iterator;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;import javax.xml.namespace.QName;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;import javax.xml.ws.Service;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;public class HelloClient {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;public static void main(String[] args) throws Exception {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;//Specify the WSDL&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;//Create a Qualified Name that represents the&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;//namespace and local part of the service&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;QName serviceName = new QName(&quot;http://ch03.soacookbook.com/&quot;,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&quot;HelloWSService&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;//Create a proxy to get a port stub from&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;Service service = Service.create(wsdlLocation, serviceName);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;// Return a list of QNames of ports&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;System.out.println(&quot;QNames of service endpoints:&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;Iterator&amp;lt;QName&amp;gt; it = service.getPorts();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;QName lastEndpoint = null;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;while (it.hasNext()) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;lastEndpoint = it.next();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;System.out.println(&quot;Name: &quot; + lastEndpoint);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;//prints: Name: {http://ch03.soacookbook.com/}HelloWSPort&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;// Get the Hello stub&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;Hello hello = service.getPort(lastEndpoint, Hello.class);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;//Invoke the business method&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;String result = hello.sayHello(&quot;Duke&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;System.out.println(&quot;\nResponse: &quot; + result);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://pakitgroup.blogspot.com/feeds/1384165801204288001/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/invoking-simplest-web-service-in-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/1384165801204288001'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/1384165801204288001'/><link rel='alternate' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/invoking-simplest-web-service-in-java.html' title='Invoking the Simplest Web Service In Java'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8156933787798242641.post-6164177976519592451</id><published>2013-12-24T06:40:00.002-08:00</published><updated>2013-12-24T06:40:49.223-08:00</updated><title type='text'>ITERATORS in C++</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Iterators are similar to pointers in that they point to elements in a container. Iterators&lt;br /&gt;
are commonly used in C++ and are very important when using the STL.&lt;br /&gt;
&amp;nbsp;A number of functions dealt with iterators, and in the following section we will&lt;br /&gt;
take a closer look at them and how they relate to the vector template class.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;#include&amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;#include&amp;lt;vector&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;#include&amp;lt;algorithm&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;#include&amp;lt;numeric&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;using namespace std;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;void PrintVector(vector&amp;lt;int&amp;gt; &amp;amp;array)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;cout &amp;lt;&amp;lt; &quot;Contents (&quot; &amp;lt;&amp;lt; &quot;Size: &quot; &amp;lt;&amp;lt; (int)array.size() &amp;lt;&amp;lt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&quot; Max: &quot; &amp;lt;&amp;lt; (int)array.capacity() &amp;lt;&amp;lt; &quot;) - &quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;ostream_iterator&amp;lt;int&amp;gt; output(cout, &quot; &quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;copy(array.begin(), array.end(), output);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;cout &amp;lt;&amp;lt; endl;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;int main(int args, char **argc)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;cout &amp;lt;&amp;lt; &quot;STL Vector Example 2: Iterators&quot; &amp;lt;&amp;lt; endl;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;cout &amp;lt;&amp;lt; &quot;Data Structures for Game Developers&quot; &amp;lt;&amp;lt; endl;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;cout &amp;lt;&amp;lt; &quot;Allen Sherrod&quot; &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; endl;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;vector&amp;lt;int&amp;gt; array;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;array.reserve(5);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;// Add items then print.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;array.push_back(10);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;array.push_back(20);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;array.push_back(30);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;array.push_back(40);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;array.push_back(50);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;// Calling the copy algorithm.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;vector&amp;lt;int&amp;gt; array2;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;for(int i = 0; i &amp;lt; 5; i++)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;array2.push_back(0);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;copy(array.begin(), array.end(), array2.begin());&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;cout &amp;lt;&amp;lt; &quot; Inserted into vector: &quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;PrintVector(array);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;// Run the accumulate algorithm.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;cout &amp;lt;&amp;lt; &quot; Accumulate: &quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&amp;lt;&amp;lt; accumulate(array.begin(), array.end(), 0)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&amp;lt;&amp;lt; endl;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;// Pop off the container.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;array.pop_back();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;array.pop_back();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;cout &amp;lt;&amp;lt; &quot;Popped two from vector: &quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;PrintVector(array);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;// Clear the container.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;array.clear();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;cout &amp;lt;&amp;lt; &quot; Cleared vector: &quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;PrintVector(array);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;cout &amp;lt;&amp;lt; endl;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;// Test if the container is empty.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;if(array.empty() == true)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;cout &amp;lt;&amp;lt; &quot;Vector is empty.&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;else&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;cout &amp;lt;&amp;lt; &quot;Vector is NOT empty.&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;cout &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; endl;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;return 1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
the demo application stlvector in Listing &amp;nbsp;&lt;a href=&quot;http://pakitgroup.blogspot.com/2013/12/c-vector-demo.html&quot;&gt;Vector Demo&lt;/a&gt; by creating an integer container and&lt;br /&gt;
filling it with elements. Once the container is filled, the STL copy algorithm is used&lt;br /&gt;
to copy the first container into another. Before the copying, a loop is used to create&lt;br /&gt;
the element space in the second container because to copy the first container into&lt;br /&gt;
the second, the second must have at least the number of elements required by the&lt;br /&gt;
range, which is specified by the iterators begin(first element or [0]) and end(last&lt;br /&gt;
element or [4]in this case).&lt;br /&gt;
After the copy algorithm is performed and the container is displayed, the&lt;br /&gt;
accumulate STL algorithm is performed to demonstrate that to get the sum of all&lt;br /&gt;
the elements, a few pop()calls are performed, the container is cleared, and it is&lt;br /&gt;
tested for emptiness. Inside the function used to print the container is new code&lt;br /&gt;
that replaces the forloop in the first vectordemo application stlvector. In this&lt;br /&gt;
function an output iterator is created and the STL copy algorithm is called. The call&lt;br /&gt;
states that the range of elements from the first parameter (the beginning of the container in this case) to the second parameter (the end of the container in this case)&lt;br /&gt;
should be copied to the output iterator. The output iterator for this demo application is set up to point to the C++ STD count object. This is an example of how to use&lt;br /&gt;
algorithms and iterators together to perform fast tasks in C++ code. Using a for&lt;br /&gt;
loop is one option, which was seen in the first &lt;a href=&quot;http://pakitgroup.blogspot.com/2013/12/c-vector-demo.html&quot;&gt;stl vector demo&lt;/a&gt;, but it is slower than&lt;br /&gt;
using STL algorithms. Whenever possible use STL algorithms for traditional arrays&lt;br /&gt;
and containers because the performance is efficient. The output iterator that is set&lt;br /&gt;
up in points to the coutobject and appends a &quot;&quot;character to every&lt;br /&gt;
element that is passed to it. This is what gives the output a space between each&lt;br /&gt;
element that is printed&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://pakitgroup.blogspot.com/feeds/6164177976519592451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/iterators-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/6164177976519592451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/6164177976519592451'/><link rel='alternate' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/iterators-in-c.html' title='ITERATORS in C++'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8156933787798242641.post-3826792673867469627</id><published>2013-12-24T06:34:00.006-08:00</published><updated>2013-12-24T06:34:49.095-08:00</updated><title type='text'>C++ Vector Demo</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;#include&amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;#include&amp;lt;vector&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;iostream&gt;&lt;vector&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;
using namespace std;&lt;br /&gt;
void PrintVector(vector&lt;/span&gt;&lt;int&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt; &amp;amp;array)&lt;br /&gt;
{&lt;br /&gt;
cout &amp;lt;&amp;lt; &quot;Contents (&quot; &amp;lt;&amp;lt; &quot;Size: &quot; &amp;lt;&amp;lt; (int)array.size() &amp;lt;&amp;lt;&lt;br /&gt;
&quot; Max: &quot; &amp;lt;&amp;lt; (int)array.capacity() &amp;lt;&amp;lt; &quot;) - &quot;;&lt;br /&gt;
for(int i = 0; i &amp;lt; (int)array.size(); i++)&lt;br /&gt;
{&lt;br /&gt;
cout &amp;lt;&amp;lt; array[i] &amp;lt;&amp;lt; &quot; &quot;;&lt;br /&gt;
}&lt;br /&gt;
cout &amp;lt;&amp;lt; endl;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int args, char **argc)&lt;br /&gt;
{&lt;br /&gt;
cout &amp;lt;&amp;lt; &quot;STL Vector Example&quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
cout &amp;lt;&amp;lt; &quot;Data Structures for Game Developers&quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
cout &amp;lt;&amp;lt; &quot;Allen Sherrod&quot; &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; endl;&lt;br /&gt;
vector&lt;/span&gt;&lt;int&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt; array;&lt;br /&gt;
array.reserve(5);&lt;br /&gt;
array.push_back(10);&lt;br /&gt;
array.push_back(20);&lt;br /&gt;
array.push_back(30);&lt;br /&gt;
array.push_back(40);&lt;br /&gt;
cout &amp;lt;&amp;lt; &quot; Inserted into vector. &quot;;&lt;br /&gt;
PrintVector(array);&lt;br /&gt;
array.pop_back();&lt;br /&gt;
array.pop_back();&lt;br /&gt;
cout &amp;lt;&amp;lt; &quot;Popped two from vector. &quot;;&lt;br /&gt;
PrintVector(array);&lt;br /&gt;
array.clear();&lt;br /&gt;
cout &amp;lt;&amp;lt; &quot; Cleared vector. &quot;;&lt;br /&gt;
PrintVector(array);&lt;br /&gt;
cout &amp;lt;&amp;lt; endl;&lt;br /&gt;
if(array.empty() == true)&lt;br /&gt;
cout &amp;lt;&amp;lt; &quot;Vector is empty.&quot;;&lt;br /&gt;
else&lt;br /&gt;
cout &amp;lt;&amp;lt; &quot;Vector is NOT empty.&quot;;&lt;br /&gt;
cout &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; endl;&lt;br /&gt;
return 1;&lt;br /&gt;
}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
the demo application creates an integer array and populates it with data using the push_back()method . The container is empty until items are pushed onto it. Once on the list, the array []&amp;nbsp;operators can be used to access the element by reading or writing to it. In the&amp;nbsp;example code  four items are pushed onto the list before popping &amp;nbsp;(removal) of the last two and displaying the contents of the container.&lt;br /&gt;
The container is cleared, displayed again, and tested to see if it is empty. Inside&lt;br /&gt;
the function used to print a container, the code uses size()to determine how many&lt;br /&gt;
valid elements are currently pushed onto the container while capacity()is used to&lt;br /&gt;
determine how much space the container can hold without being resized. To access&lt;br /&gt;
the elements, we use the array operators [] for convenience.&lt;/int&gt;&lt;/int&gt;&lt;/vector&gt;&lt;/iostream&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://pakitgroup.blogspot.com/feeds/3826792673867469627/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/c-vector-demo.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/3826792673867469627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/3826792673867469627'/><link rel='alternate' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/c-vector-demo.html' title='C++ Vector Demo'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8156933787798242641.post-4689465915101723720</id><published>2013-12-24T06:29:00.000-08:00</published><updated>2013-12-24T06:29:00.351-08:00</updated><title type='text'>The Entire Ordered and Unordered Array Classes</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;template&amp;lt;class T&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;class UnorderedArray&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;public:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;UnorderedArray(int size, int growBy = 1) :&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;m_array(NULL), m_maxSize(0),&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;m_growSize(0), m_numElements(0)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;if(size)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;m_maxSize = size;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;m_array = new T[m_maxSize];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;memset(m_array, 0, sizeof(T) * m_maxSize);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;m_growSize = ((growBy &amp;gt; 0) ? growBy : 0);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;virtual ~UnorderedArray()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;if(m_array != NULL)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;delete[] m_array;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;m_array = NULL;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;virtual void push(T val)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;assert(m_array != NULL);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;if(m_numElements &amp;gt;= m_maxSize)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;Expand();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;m_array[m_numElements] = val;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;m_numElements++;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;void pop()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;if(m_numElements &amp;gt; 0)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;m_numElements—;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;void remove(int index)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;assert(m_array != NULL);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;if(index &amp;gt;= m_maxSize)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;return;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;for(int k = index; k &amp;lt; m_maxSize - 1; k++)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;m_array[k] = m_array[k + 1];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;m_maxSize—;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;if(m_numElements &amp;gt;= m_maxSize)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;m_numElements = m_maxSize - 1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;virtual T&amp;amp; operator[](int index)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;assert(m_array != NULL &amp;amp;&amp;amp; index &amp;lt;= m_numElements);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;return m_array[index];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;virtual int search(T val)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;assert(m_array != NULL);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;for(int i = 0; i &amp;lt; m_numElements; i++)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;if(m_array[i] == val)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;return i;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;return -1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;void clear() { m_numElements = 0; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;int GetSize() { return m_numElements; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;int GetMaxSize() { return m_maxSize; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;int GetGrowSize() { return m_growSize; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;void SetGrowSize(int val)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;assert(val &amp;gt;= 0);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;m_growSize = val;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;private:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;bool Expand()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;if(m_growSize &amp;lt;= 0)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;return false;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;T *temp = new T[m_maxSize + m_growSize];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;assert(temp != NULL);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;memcpy(temp, m_array, sizeof(T) * m_maxSize);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;delete[] m_array;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;m_array = temp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;m_maxSize += m_growSize;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;return true;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;private:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;T *m_array;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;int m_maxSize;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;int m_growSize;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;int m_numElements;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;};&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Ordered&amp;nbsp;Array Class&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
&lt;b&gt;&lt;u&gt;template &amp;lt;class T&amp;gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;class OrderedArray&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;public:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;OrderedArray(int size, int growBy = 1) :&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;m_array(NULL), m_maxSize(0),&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;m_growSize(0), m_numElements(0)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;if(size)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;m_maxSize = size;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;m_array = new T[m_maxSize];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;memset(m_array, 0, sizeof(T) * m_maxSize);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;m_growSize = ((growBy &amp;gt; 0) ? growBy : 0);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;virtual ~OrderedArray()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;if(m_array != NULL)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;delete[] m_array;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;m_array = NULL;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;void push(T val)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;assert(m_array != NULL);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;if(m_numElements &amp;gt;= m_maxSize)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;Expand();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;for(int i = 0; i &amp;lt; m_numElements; i++)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;if(m_array[i] &amp;gt; val)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;break;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;for(int k = m_numElements; k &amp;gt; i; k—)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;m_array[k] = m_array[k - 1];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;m_array[i] = val;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;m_numElements++;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;void pop()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;if(m_numElements &amp;gt; 0)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;m_numElements—;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;void remove(int index)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;assert(m_array != NULL);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;if(index &amp;gt;= m_maxSize)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;return;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;for(int k = index; k &amp;lt; m_maxSize - 1; k++)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;m_array[k] = m_array[k + 1];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;m_maxSize—;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;if(m_numElements &amp;gt;= m_maxSize)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;m_numElements = m_maxSize - 1;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;// Making this const allows for reading but not writing.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;virtual const T&amp;amp; operator[](int index)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;assert(m_array != NULL &amp;amp;&amp;amp; index &amp;lt;= m_numElements);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;return m_array[index];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;int search(T searchKey)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;if(!m_array)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;return -1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;int lowerBound = 0;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;int upperBound = m_numElements - 1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;int current = 0;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;while(1)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;current = (lowerBound + upperBound) &amp;gt;&amp;gt; 1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;if(m_array[current] == searchKey)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;return current;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;else if(lowerBound &amp;gt; upperBound)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;return -1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;else&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;if(m_array[current] &amp;lt; searchKey)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;lowerBound = current + 1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;else&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;upperBound = current - 1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;return -1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;void clear() { m_numElements = 0; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;int GetSize() { return m_numElements; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;int GetMaxSize() { return m_maxSize; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;int GetGrowSize() { return m_growSize; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;void SetGrowSize(int val)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;assert(val &amp;gt;= 0);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;m_growSize = val;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;private:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;bool Expand()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;if(m_growSize &amp;lt;= 0)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;return false;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;T *temp = new T[m_maxSize + m_growSize];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;assert(temp != NULL);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;memcpy(temp, m_array, sizeof(T) * m_maxSize);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;delete[] m_array;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;m_array = temp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;m_maxSize += m_growSize;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;return true;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;private:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;T *m_array;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;int m_maxSize;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;int m_growSize;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;int m_numElements;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;};&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://pakitgroup.blogspot.com/feeds/4689465915101723720/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/the-entire-ordered-and-unordered-array.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/4689465915101723720'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/4689465915101723720'/><link rel='alternate' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/the-entire-ordered-and-unordered-array.html' title='The Entire Ordered and Unordered Array Classes'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8156933787798242641.post-1983087621751350126</id><published>2013-12-24T06:21:00.001-08:00</published><updated>2013-12-24T06:21:10.198-08:00</updated><title type='text'>BINARY SEARCHES</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
A binary search can be performed on an ordered array. It works by taking a value&lt;br /&gt;
that is being searched for and testing it by the element in the middle of the array. If&lt;br /&gt;
the value being searched for is lower than the item in the middle of the ordered&lt;br /&gt;
array, it can be determined that if the value exists, it is in the first half of the array.&lt;br /&gt;
If the value is larger than the element in the middle, the value might exist in the&lt;br /&gt;
upper half. Once the direction is known, half of that new section is tested to further&lt;br /&gt;
narrow down where the value can be. This is repeated until the value is found or&lt;br /&gt;
until there are no more elements left. The binary search gets its name from the fact&lt;br /&gt;
that the remaining elements are always split in half (binary equals 2). Because a binary search requires the elements to be in order, this algorithm cannot work for an unordered array since the&lt;br /&gt;
unordered array can be unpredictable in terms of item positions.&lt;br /&gt;
The binary search can eliminate large sections of an array in an effort to narrow&lt;br /&gt;
down the list to find the value, assuming it exits. When compared to the linear&lt;br /&gt;
search, this can result in a huge difference in performance as Ngrows larger. For example, an array being searched with a linear algorithm that is made up of 1 million&lt;br /&gt;
elements will take on average 500,000 steps for items that exist, which can mean&lt;br /&gt;
that some checks can go up to the whole million depending on the item. Using a&lt;br /&gt;
binary search on an ordered array with that same number of elements will take&lt;br /&gt;
20 comparisons. To go from an average of 500,000 comparisons to just 20 is a huge&lt;br /&gt;
difference. To go from 1 million comparisons to 20 with items that are not found&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #999999;&quot;&gt;while(1)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999;&quot;&gt;current = (lowerBound + upperBound) &amp;gt;&amp;gt; 1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999;&quot;&gt;if(m_array[current] == searchKey)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999;&quot;&gt;return current;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999;&quot;&gt;else if(lowerBound &amp;gt; upperBound)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999;&quot;&gt;return -1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999;&quot;&gt;else&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999;&quot;&gt;if(m_array[current] &amp;lt; searchKey)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999;&quot;&gt;lowerBound = current + 1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999;&quot;&gt;else&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999;&quot;&gt;upperBound = current - 1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999;&quot;&gt;return -1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999;&quot;&gt;};&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: #999999;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
The binary search &amp;nbsp;starts off by defining the bounds that make up&lt;br /&gt;
the search range, which is initially set to the entire array. Once the range is set, the&lt;br /&gt;
middle of the range is determined and the element at the position is tested. If the&lt;br /&gt;
item is found, the index is returned; if the lower bound’s value becomes higher than&lt;br /&gt;
the upper bound’s value (which will happen when the search has stepped through&lt;br /&gt;
the entire array), then the value is not found. If neither of these two cases are true,&lt;br /&gt;
the lower bound, which is the minimum search range position, is adjusted if&lt;br /&gt;
the item is greater than the item in the middle, or else the upper bound is adjusted.&lt;br /&gt;
Adjusting the range values will quickly shrink the search range until the value is&lt;br /&gt;
found or until there are no more elements to check this&lt;br /&gt;
&lt;span style=&quot;background-color: #999999;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
operation is pretty fast as N grows larger.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://pakitgroup.blogspot.com/feeds/1983087621751350126/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/binary-searches.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/1983087621751350126'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/1983087621751350126'/><link rel='alternate' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/binary-searches.html' title='BINARY SEARCHES'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8156933787798242641.post-5803239074319752680</id><published>2013-12-24T06:17:00.002-08:00</published><updated>2013-12-24T06:17:36.375-08:00</updated><title type='text'>BASICSEARCHES</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
When we are looking for a value in an unordered array, our main option is the&lt;br /&gt;
linear search. The linear search is a brute-force-style search. The algorithm works&lt;br /&gt;
by stepping through each element of the array, starting with the first element, and&lt;br /&gt;
checking to see if the value of that element matches the value of what is being&lt;br /&gt;
searched for. If it is found, then the algorithm can report that the item exists in&lt;br /&gt;
some meaningful fashion, and it can also report where in the array the item is&lt;br /&gt;
positioned.&lt;br /&gt;
During a linear search the algorithm can find the first occurrence or all occurrences of a value. If duplicates are allowed in the array, then more than one value&lt;br /&gt;
can exist. In this chapter we’ll discuss finding the first occurrence. If there are times&lt;br /&gt;
when you know you need to know how many occurrences there are, or even how&lt;br /&gt;
many and where they are, then the searching function of the unordered array class&lt;br /&gt;
can be expanded to accommodate those needs. Searching beyond the first occurrence can be a waste of CPU time if there is no need to look for duplicates.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;template&amp;lt;class T&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;class UnorderedArray&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;public:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;virtual int search(T val)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;assert(m_array != NULL);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;for(int i = 0; i &amp;lt; m_numElements; i++)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;if(m_array[i] == val)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;return i;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;return -1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;};&lt;/span&gt;&lt;br /&gt;
A linear search can become slow for arrays with large numbers of items. On&lt;br /&gt;
average, the algorithm requires half the total number of items to find a value. If&lt;br /&gt;
there were 100 items in a list, then the average would be 50. Because the linear&lt;br /&gt;
search’s performance is based on the number of items in the array, it has a big-O of&lt;br /&gt;
O(N). The linear search is the most basic, yet slowest, search because it must check&lt;br /&gt;
potentially every item (half on average) before finding a value, assuming the value&lt;br /&gt;
even exists in the array. If the value does not exist, the search would have checked&lt;br /&gt;
every element in the array and come up with nothing.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://pakitgroup.blogspot.com/feeds/5803239074319752680/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/basicsearches.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/5803239074319752680'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/5803239074319752680'/><link rel='alternate' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/basicsearches.html' title='BASICSEARCHES'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8156933787798242641.post-1774122831938704403</id><published>2013-12-24T06:13:00.003-08:00</published><updated>2013-12-24T06:13:54.146-08:00</updated><title type='text'>The Ordered Array Class that Differs from the Unordered Array</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
template &amp;lt;class T&amp;gt;&lt;br /&gt;
class OrderedArray&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
int push(T val)&lt;br /&gt;
{&lt;br /&gt;
assert(m_array != NULL);&lt;br /&gt;
if(m_numElements &amp;gt;= m_maxSize)&lt;br /&gt;
{&lt;br /&gt;
Expand();&lt;br /&gt;
}&lt;br /&gt;
for(int i = 0; i &amp;lt; m_numElements; i++)&lt;br /&gt;
{&lt;br /&gt;
if(m_array[i] &amp;gt; val)&lt;br /&gt;
break;&lt;br /&gt;
}&lt;br /&gt;
for(int k = m_numElements; k &amp;gt; i; k—)&lt;br /&gt;
{&lt;br /&gt;
m_array[k] = m_array[k - 1];&lt;br /&gt;
}&lt;br /&gt;
m_array[i] = val;&lt;br /&gt;
m_numElements++;&lt;br /&gt;
return i;&lt;br /&gt;
}&lt;br /&gt;
};&lt;br /&gt;
Another option for inserting an item into an ordered array is to use a modified binary search to find the index closest to where the item would need to be inserted&lt;br /&gt;
and start the stepping from that point.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://pakitgroup.blogspot.com/feeds/1774122831938704403/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/the-ordered-array-class-that-differs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/1774122831938704403'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/1774122831938704403'/><link rel='alternate' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/the-ordered-array-class-that-differs.html' title='The Ordered Array Class that Differs from the Unordered Array'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8156933787798242641.post-2145177140294880363</id><published>2013-12-24T06:12:00.000-08:00</published><updated>2013-12-24T06:12:12.646-08:00</updated><title type='text'>Removing Items from the Unordered Array</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;background-color: #999999; color: yellow;&quot;&gt;template&amp;lt;class T&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999; color: yellow;&quot;&gt;class UnorderedArray&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999; color: yellow;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999; color: yellow;&quot;&gt;public:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999; color: yellow;&quot;&gt;void pop()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999; color: yellow;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999; color: yellow;&quot;&gt;if(m_numElements &amp;gt; 0)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999; color: yellow;&quot;&gt;m_numElements—;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999; color: yellow;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999; color: yellow;&quot;&gt;void remove(int index)a&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999; color: yellow;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999; color: yellow;&quot;&gt;assert(m_array != NULL);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999; color: yellow;&quot;&gt;if(index &amp;gt;= m_maxSize)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999; color: yellow;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999; color: yellow;&quot;&gt;return;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999; color: yellow;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999; color: yellow;&quot;&gt;for(int k = index; k &amp;lt; m_maxSize - 1; k++)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999; color: yellow;&quot;&gt;m_array[k] = m_array[k + 1];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999; color: yellow;&quot;&gt;m_maxSize—;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999; color: yellow;&quot;&gt;if(m_numElements &amp;gt;= m_maxSize)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999; color: yellow;&quot;&gt;m_numElements = m_maxSize - 1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999; color: yellow;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #999999; color: yellow;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://pakitgroup.blogspot.com/feeds/2145177140294880363/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/removing-items-from-unordered-array.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/2145177140294880363'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/2145177140294880363'/><link rel='alternate' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/removing-items-from-unordered-array.html' title='Removing Items from the Unordered Array'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8156933787798242641.post-4692613678498726178</id><published>2013-12-23T08:41:00.001-08:00</published><updated>2013-12-23T08:41:11.012-08:00</updated><title type='text'>Using JDBC with Spring</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
There are many persistence technologies out there. Hibernate, iBATIS, and JPAare&lt;br /&gt;
just a few. Despite this, a good number of applications are writing Java objects to a&lt;br /&gt;
database the old-fashioned way: they earn it. No, wait—that’s how people make&lt;br /&gt;
money. The tried-and-true method for persisting data is with good old JDBC.&lt;br /&gt;
And why not? JDBCdoesn’t require mastering another framework’s query language. It’s built on top of SQL, which is the data access language. Plus, you can more&lt;br /&gt;
finely tune the performance of your data access when you use JDBCthan with practically any other technology. And JDBCallows you to take advantage of your database’s&lt;br /&gt;
proprietary features, where other frameworks may discourage or flat-out prohibit this.&lt;br /&gt;
What’s more, JDBClets you work with data at a much lower level than the persistence frameworks, allowing you to access and manipulate individual columns in a&lt;br /&gt;
database. This fine-grained approach to data access comes in handy in applications,&lt;br /&gt;
such as reporting applications, where it doesn’t make sense to organize the data into&lt;br /&gt;
objects, just to then unwind it back into raw data.&lt;br /&gt;
But all is not sunny in the world of JDBC. With its power, flexibility, and other niceties also come some not-so-niceties.&lt;br /&gt;
&lt;b&gt;Tackling runaway JDBC code&lt;/b&gt;&lt;br /&gt;
Though JDBCgives you an APIthat works closely with yourdatabase, you’re responsible for handling everything related to accessing the database. This includes managing&lt;br /&gt;
database resources and handling exceptions.&lt;br /&gt;
If you’ve ever written JDBCthat inserts data into the database, the following&lt;br /&gt;
shouldn’t be too alien to you.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;private static final String SQL_INSERT_SPITTER =&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;&quot;insert into spitter (username, password, fullname) values (?, ?, ?)&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;private DataSource dataSource;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;public void addSpitter(Spitter spitter) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;Connection conn = null;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;PreparedStatement stmt = null;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;try {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;conn = dataSource.getConnection();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;stmt = conn.prepareStatement(SQL_INSERT_SPITTER);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;stmt.setString(1, spitter.getUsername());&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;stmt.setString(2, spitter.getPassword());&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;stmt.setString(3, spitter.getFullName());&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;stmt.execute();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;} catch (SQLException e) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;// do something...not sure what, though&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;} finally {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;try {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;if (stmt != null) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;stmt.close();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;if (conn != null) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;conn.close();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;} catch (SQLException e) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;// I&#39;m even less sure about what to do here&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;private static final String SQL_UPDATE_SPITTER =&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;&quot;update spitter set username = ?, password = ?, fullname = ?&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;+ &quot;where id = ?&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;public void saveSpitter(Spitter spitter) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;Connection conn = null;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;PreparedStatement stmt = null;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;try {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;conn = dataSource.getConnection();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;stmt = conn.prepareStatement(SQL_UPDATE_SPITTER);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;stmt.setString(1, spitter.getUsername());&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;stmt.setString(2, spitter.getPassword());&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;stmt.setString(3, spitter.getFullName());&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;stmt.setLong(4, spitter.getId());&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;stmt.execute();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;} catch (SQLException e) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;// Still not sure what I&#39;m supposed to do here&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;} finally {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;try {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;if (stmt != null) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;stmt.close();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;if (conn != null) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;conn.close();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;} catch (SQLException e) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;// or here&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;private static final String SQL_SELECT_SPITTER =&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;&quot;select id, username, fullname from spitter where id = ?&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;public Spitter getSpitterById(long id) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;Connection conn = null;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;PreparedStatement stmt = null;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;ResultSet rs = null;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;try {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;conn = dataSource.getConnection();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;stmt = conn.prepareStatement(SQL_SELECT_SPITTER);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;stmt.setLong(1, id);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;rs = stmt.executeQuery();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;Spitter spitter = null;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;if (rs.next()) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;spitter = new Spitter();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;spitter.setId(rs.getLong(&quot;id&quot;));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;spitter.setUsername(rs.getString(&quot;username&quot;));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;spitter.setPassword(rs.getString(&quot;password&quot;));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;spitter.setFullName(rs.getString(&quot;fullname&quot;));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;return spitter;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;} catch (SQLException e) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;} finally {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;if(rs != null) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;try {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;rs.close();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;} catch(SQLException e) {}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;if(stmt != null) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;try {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;stmt.close();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;} catch(SQLException e) {}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;if(conn != null) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;try {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;conn.close();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;} catch(SQLException e) {}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;return null;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Working with JDBC templates&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
Spring’s JDBC framework will clean up your JDBCcode by shouldering the burden of&lt;br /&gt;
resource management and exception handling. This leaves you free to write only the&lt;br /&gt;
&lt;br /&gt;
code necessary to move data to and from the database.&lt;br /&gt;
All that a SimpleJdbcTemplateneeds to do its work is a DataSource. This makes it easy&lt;br /&gt;
enough to configure a SimpleJdbcTemplatebean in Spring with the following XML:&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;&amp;lt;bean id=&quot;jdbcTemplate&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;class=&quot;org.springframework.jdbc.core.simple.SimpleJdbcTemplate&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;&amp;lt;constructor-arg ref=&quot;dataSource&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;&amp;lt;/bean&amp;gt;&lt;/span&gt;&lt;br /&gt;
The actual DataSourcebeing referred to by the dataSourceproperty can be any&lt;br /&gt;
implementation of javax.sql.DataSource, including those we created in section 5.2.&lt;br /&gt;
Now we can wire the jdbcTemplatebean into our DAOand use it to access the database. For example, suppose that the Spitter DAOis written to use SimpleJdbcTemplate:&lt;br /&gt;
public class JdbcSpitterDAO implements&lt;br /&gt;
&lt;span style=&quot;background-color: #f3f3f3;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;SpitterDAO {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f3f3f3;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;...&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f3f3f3;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;private SimpleJdbcTemplate jdbcTemplate;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f3f3f3;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public void setJdbcTemplate(SimpleJdbcTemplate jdbcTemplate) {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f3f3f3;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;this.jdbcTemplate = jdbcTemplate;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f3f3f3;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f3f3f3;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f3f3f3;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;You’d then wire the jdbcTemplateproperty of JdbcSpitterDAOas follows:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f3f3f3;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;bean id=&quot;spitterDao&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f3f3f3;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;class=&quot;com.habuma.spitter.persistence.SimpleJdbcTemplateSpitterDao&quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f3f3f3;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;property name=&quot;jdbcTemplate&quot; ref=&quot;jdbcTemplate&quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f3f3f3;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/bean&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
With a SimpleJdbcTemplateat our DAO’s disposal, we can greatly simplify the&lt;br /&gt;
addSpitter()method from listing The new SimpleJdbcTemplate-based&lt;br /&gt;
&lt;br /&gt;
addSpitter()method is shown next.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;public void addSpitter(Spitter spitter) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;jdbcTemplate.update(SQL_INSERT_SPITTER,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;spitter.getUsername(),&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;spitter.getPassword(),&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;spitter.getFullName(),&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;spitter.getEmail(),&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;spitter.isUpdateByEmail());&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;spitter.setId(queryForIdentity());&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Querying for a Spitterusing SimpleJdbcTemplate&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public Spitter getSpitterById(long id) {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;return jdbcTemplate.queryForObject(&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;SQL_SELECT_SPITTER_BY_ID,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;new ParameterizedRowMapper&amp;lt;Spitter&amp;gt;() {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public Spitter mapRow(ResultSet rs, int rowNum)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;throws SQLException {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Spitter spitter = new Spitter();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;spitter.setId(rs.getLong(1));&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;spitter.setUsername(rs.getString(2));&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;spitter.setPassword(rs.getString(3));&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;spitter.setFullName(rs.getString(4));&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;return spitter;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;id&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Using named parameters with Spring JDBC templates&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;public void addSpitter(Spitter spitter) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;Map&amp;lt;String, Object&amp;gt; params = new HashMap&amp;lt;String, Object&amp;gt;();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;params.put(&quot;username&quot;, spitter.getUsername());&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;params.put(&quot;password&quot;, spitter.getPassword());&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;params.put(&quot;fullname&quot;, spitter.getFullName());&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;jdbcTemplate.update(SQL_INSERT_SPITTER, params);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;spitter.setId(queryForIdentity());&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;u&gt;USING SPRING’S DAO SUPPORT CLASSES FOR JDBC&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;public class JdbcSpitterDao extends SimpleJdbcDaoSupport&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;implements SpitterDao {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;...&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;public void addSpitter(Spitter spitter) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;getSimpleJdbcTemplate().update(SQL_INSERT_SPITTER,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;spitter.getUsername(),&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;spitter.getPassword(),&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;spitter.getFullName(),&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;spitter.getEmail(),&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;spitter.isUpdateByEmail());&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;spitter.setId(queryForIdentity());&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
When configuring your DAOclass in Spring, you could directly wire a SimpleJdbcTemplatebean into its &lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;jdbcTemplateproperty as follows:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;&amp;lt;bean id=&quot;spitterDao&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;&amp;nbsp;class=&quot;com.habuma.spitter.persistence.JdbcSpitterDao&quot;&amp;gt; &amp;lt;property name=&quot;jdbcTemplate&quot; ref=&quot;jdbcTemplate&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;&amp;lt;/bean&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
This will work,&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc; color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://pakitgroup.blogspot.com/feeds/4692613678498726178/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/using-jdbc-with-spring.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/4692613678498726178'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/4692613678498726178'/><link rel='alternate' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/using-jdbc-with-spring.html' title='Using JDBC with Spring'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8156933787798242641.post-3931286552005749948</id><published>2013-12-18T08:48:00.001-08:00</published><updated>2013-12-18T08:48:45.784-08:00</updated><title type='text'>Cascading in JPA</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
To begin, let’s consider the changes required to make the persist()operation cascade from Employee&lt;br /&gt;
to Address. In the definition of the Employeeclass, there is a @ManyToOne annotation defined for the&lt;br /&gt;
address relationship. To enable the cascade, we must add the PERSISToperation to the list of cascading&lt;br /&gt;
operations for this relationship of the Employee entity that&lt;br /&gt;
demonstrates this change.&lt;br /&gt;
.Enabling Cascade Persist&lt;br /&gt;
@Entity&lt;br /&gt;
public class Employee {&lt;br /&gt;
// ...&lt;br /&gt;
@ManyToOne(cascade=CascadeType.PERSIST)&lt;br /&gt;
Address address;&lt;br /&gt;
// ...&lt;br /&gt;
}&lt;br /&gt;
To leverage this change, we need only ensure that the Add ressentity has been set on the Employee&lt;br /&gt;
instance before invoking persist()on it. As the entity manager encounters the Employee instance and&lt;br /&gt;
adds it to the persistence context, it will navigate across the address relationship looking for a new&lt;br /&gt;
Address entity to manage as well. In comparison with the approach in Listing&lt;br /&gt;
Cascade settings are unidirectional. This means that they must be explicitly set on both sides of a&lt;br /&gt;
relationship if the same behavior is intended for both situations. For example, in Listing, we only&lt;br /&gt;
added the cascade setting to the address relationship in the Employee entity. If Listing were&lt;br /&gt;
changed to persist only the Address entity, not the Employee entity, the Employee entity would not&lt;br /&gt;
become managed because the entity manager has not been instructed to navigate out from any&lt;br /&gt;
relationships defined on the Address entity.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://pakitgroup.blogspot.com/feeds/3931286552005749948/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/cascading-in-jpa.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/3931286552005749948'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/3931286552005749948'/><link rel='alternate' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/cascading-in-jpa.html' title='Cascading in JPA'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8156933787798242641.post-9180990336991616547</id><published>2013-12-07T08:40:00.002-08:00</published><updated>2013-12-07T08:40:51.542-08:00</updated><title type='text'>The Database Life Cycle</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;
&lt;img src=&quot;data:image/jpeg;base64,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&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;
Before getting into the development of any system, you need to have strong a life-cycle model to follow. The model must have all the phases defined in the proper sequence, which will help the development team build the system with fewer problems and full functionality as expected.&lt;br /&gt;
The database life cycle consists of the following stages, from the basic steps involved in designing a global schema of the database to database implementation and maintenance:&lt;br /&gt;
• &amp;nbsp;&lt;b&gt;Requirements analysis:&lt;/b&gt; Requirements need to be determined before you can begin design and implementation. The requirements can be gathered by interviewing&lt;br /&gt;
both the producer and the user of the data; this process helps in creating a formal requirement specification.&lt;br /&gt;
• &amp;nbsp;&lt;b&gt;Logical design&lt;/b&gt;: After requirements gathering, data and relationships need to be&lt;br /&gt;
defined using a conceptual data modeling technique such as an entityrelationship (ER) diagram. This diagram shows how one object will connect to the other one and by what relationship (one-one or one-many). Relationships are.&lt;br /&gt;
• &amp;nbsp;Physical design: Once the logical design is in place,the next step is to produce the&lt;br /&gt;
physical structure for the database. The physical design phase involves creating&lt;br /&gt;
tables and selecting indexes.but an index is basically like an index of a book, which allows you to jump to a&lt;br /&gt;
particular page based on the topic of your choice and helps you avoid shuffling all&lt;br /&gt;
the pages of the book to reach the page of interest. Database indexes do&lt;br /&gt;
something similar; they manage and maintain the order of rows when inserted&lt;br /&gt;
into the table, which helps &lt;i&gt;SQL&lt;/i&gt; queries pull data fast based on a provided value for&lt;br /&gt;
the index column.&lt;br /&gt;
&lt;b&gt;Database implementation&lt;/b&gt;: Once the design is completed, the database can be&lt;br /&gt;
created through the implementation of formal schema using the data definition&lt;br /&gt;
language (&lt;i&gt;DDL&lt;/i&gt;) of the &lt;i&gt;RDBMS&lt;/i&gt;. The DDL consists of the statements that play key&lt;br /&gt;
roles in creating, modifying, and deleting the database or database objects. &lt;u&gt;CREATE&lt;/u&gt;,&lt;br /&gt;
&lt;u&gt;ALTER&lt;/u&gt;, and &lt;u&gt;DROP &lt;/u&gt;are prime examples of a &lt;b&gt;DDL&lt;/b&gt;.&lt;br /&gt;
Data modification: A data modification language (&lt;i&gt;DML&lt;/i&gt;) can be used to query and&lt;br /&gt;
update the database as well as set up indexes and establish constraints such as referential integrity. A &lt;b&gt;DML &lt;/b&gt;consists of the statements that play key roles in inserting,&lt;br /&gt;
updating and deleting the data from database tables. &lt;u&gt;INSERT&lt;/u&gt;, &lt;b&gt;UPDATE&lt;/b&gt;, and &lt;b&gt;DELETE&lt;/b&gt;&lt;br /&gt;
are prime examples of a &lt;i&gt;DDL&lt;/i&gt;.&lt;br /&gt;
• &amp;nbsp;&lt;b&gt;Database monitoring: &lt;/b&gt;As the database begins operation, monitoring indicates&lt;br /&gt;
whether performance requirements are being met; if they are not, modifications&lt;br /&gt;
should be made to improve database performance. Thus, the database life cycle&lt;br /&gt;
continues with monitoring, redesign, and modification.&amp;nbsp;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://pakitgroup.blogspot.com/feeds/9180990336991616547/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/the-database-life-cycle.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/9180990336991616547'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/9180990336991616547'/><link rel='alternate' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/the-database-life-cycle.html' title='The Database Life Cycle'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8156933787798242641.post-7625200008177439891</id><published>2013-12-07T08:32:00.000-08:00</published><updated>2013-12-07T08:32:01.625-08:00</updated><title type='text'>Why Use a Database?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
The following are some of the reasons why you would use databases:&lt;br /&gt;
• &amp;nbsp;&lt;b&gt;Compactness&lt;/b&gt;: Databases help you maintain large amounts of data and thus completely replace voluminous paper files.&lt;br /&gt;
• &amp;nbsp;&lt;b&gt;Speed&lt;/b&gt;: Searches for a particular piece of data or information in a database are&lt;br /&gt;
much faster than sorting through piles of paper.&lt;br /&gt;
&lt;img src=&quot;https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcTgmmPhN5ue9MPSWPuduHAIL5ZgSjID667iC9Z2AMpGtT8tl0_Q8g&quot; style=&quot;float: right;&quot; /&gt;&lt;br /&gt;
• &lt;b&gt;&amp;nbsp;Less drudgery:&lt;/b&gt; It is a dull work to maintain files by hand; using a database completely eliminates such maintenance.&lt;br /&gt;
• &amp;nbsp;&lt;b&gt;Currency&lt;/b&gt;: Database systems can easily be updated and so provide accurate information all the time and on demand.&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Benefits of Using a RelationalDatabase Management System&amp;nbsp;&lt;/h3&gt;
RDBMSs offer various benefits by controlling the following:&lt;br /&gt;
• &amp;nbsp;&lt;b&gt;Redundancy&lt;/b&gt;: RDBMSs prevent you from having duplicate copies of the same data,&lt;br /&gt;
which takes up disk space unnecessarily.&lt;br /&gt;
• &amp;nbsp;&lt;b&gt;Inconsistency&lt;/b&gt;: Each redundant set of data may no longer agree with other sets of&lt;br /&gt;
the same data. When an RDBMS removes redundancy, inconsistency cannot&lt;br /&gt;
occur.&lt;br /&gt;
• &amp;nbsp;&lt;b&gt;Data integrity&lt;/b&gt;: Data values stored in the database must satisfy certain types of&lt;br /&gt;
consistency constraints.&lt;br /&gt;
• &amp;nbsp;&lt;b&gt;Data atomicity&lt;/b&gt;: In event of a failure, data is restored to the consistent state it&lt;br /&gt;
existed in prior to the failure. For example, fund transfer activity must be atomic. &lt;br /&gt;
• &amp;nbsp;&lt;b&gt;Access anomalies: &lt;/b&gt;RDBMSs prevent more than one user from updating the same&lt;br /&gt;
data simultaneously; such concurrent updates may result in inconsistent data.&lt;br /&gt;
• &lt;b&gt;&amp;nbsp;Data security&lt;/b&gt;: Not every user of the database system should be able to access all&lt;br /&gt;
the data. Security refers to the protection of data against any unauthorized access.&lt;br /&gt;
• &amp;nbsp;&lt;b&gt;Transaction processing:&amp;nbsp;&lt;/b&gt;A transaction is a sequence of database operations that&lt;br /&gt;
represents a logical unit of work. In RDBMSs, a transaction either commits all the&lt;br /&gt;
changes or rolls back all the actions performed until the point at which the failure&lt;br /&gt;
occurred.&lt;br /&gt;
• &amp;nbsp;&lt;b&gt;Recovery&lt;/b&gt;: Recovery features ensure that data is reorganized into a consistent state&lt;br /&gt;
after a transaction fails.&lt;br /&gt;
• &amp;nbsp;&lt;b&gt;Storage management:&lt;/b&gt; RDBMSs provide a mechanism for data storage&lt;br /&gt;
management. The internal schema defines how data should be stored.&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;Comparing Desktop and Server RDBMS Systems&lt;/b&gt;&amp;nbsp;&lt;/h3&gt;
In the industry today, you’ll mainly work with two types of databases: desktop databases and server&lt;br /&gt;
databases&lt;br /&gt;
&lt;b&gt;Desktop Databases&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
Desktop databases are designed to serve a limited number of users and run on desktop PCs, and they&lt;br /&gt;
offer a less-expansive solution wherever a database is required. Chances are you have worked with a&lt;br /&gt;
desktop database program; Microsoft SQL Server Express, Microsoft Access, Microsoft FoxPro,&lt;br /&gt;
FileMaker Pro, Paradox, and Lotus are all desktop database solutions.&lt;br /&gt;
&lt;u&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;Desktop databases differ from server databases in the following ways:&amp;nbsp;&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;
• &amp;nbsp;&lt;b&gt;Less expensive&lt;/b&gt;: Most desktop solutions are available for just a few hundred dollars.&lt;br /&gt;
In fact, if you own a licensed version of Microsoft Office Professional, you’re&lt;br /&gt;
already a licensed owner of Microsoft Access, which is one of the most commonly&lt;br /&gt;
and widely used desktop database programs around.&lt;br /&gt;
• &amp;nbsp;&lt;b&gt;User friendly&lt;/b&gt;: Desktop databases are quite user friendly and easy to work with,&lt;br /&gt;
because they do not require complex SQL queries to perform database operations&lt;br /&gt;
(although some desktop databases also support SQL syntax if you want to write&lt;br /&gt;
code). Desktop databases generally offer an easy-to-use graphical user interface.&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Server Databases&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Server databases are specifically designed to serve multiple users at a time and offer features that allow&lt;br /&gt;
you to manage large amounts of data very efficiently by serving multiple user requests simultaneously.&lt;br /&gt;
Well-known examples of server databases include Microsoft SQL Server, Oracle, Sybase, and DB2.&lt;br /&gt;
The following are some other characteristics that differentiate server databases from their desktop&lt;br /&gt;
counterparts:&lt;br /&gt;
• &amp;nbsp;&lt;b&gt;Flexibility&lt;/b&gt;: Server databases are designed to be very flexible and support multiple&lt;br /&gt;
platforms, respond to requests coming from multiple database users, and perform&lt;br /&gt;
any database management task with optimum speed.&lt;br /&gt;
• &amp;nbsp;&lt;b&gt;Availability&lt;/b&gt;: Server databases are intended for enterprises, so they need to be&lt;br /&gt;
available 24/7. To be available all the time, server databases come with some highavailability features, such as mirroring and log shipping.&lt;br /&gt;
• &amp;nbsp;&lt;b&gt;Performance&lt;/b&gt;: Server databases usually have huge hardware support, so servers&lt;br /&gt;
running these databases have large amountsof RAM and multiple CPUs. This is&lt;br /&gt;
why server databases support rich infrastructure and give optimum performance.&lt;br /&gt;
• &amp;nbsp;&lt;b&gt;Scalability&lt;/b&gt;: This property allows a server database to expand its ability to process&lt;br /&gt;
and store records even if it has grown tremendously.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://pakitgroup.blogspot.com/feeds/7625200008177439891/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/why-use-database.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/7625200008177439891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/7625200008177439891'/><link rel='alternate' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/why-use-database.html' title='Why Use a Database?'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8156933787798242641.post-7575810354967599063</id><published>2013-12-07T07:43:00.001-08:00</published><updated>2013-12-07T07:43:06.936-08:00</updated><title type='text'>Using Layout Controls</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Although you can use fixed positioning to place controls on a WPF window, it’s&lt;br /&gt;
positioning usually works well for a fixed resolution size but it doesn’t scale we&lt;br /&gt;
To overcome the limitations of fixed positioning, WPF offers several layout con&lt;br /&gt;
position other controls within it using a relative positioning format. One of the&lt;br /&gt;
other controls is the Grid. As seen previous post, a Grid control contains columns&lt;br /&gt;
its child controls. The height and width of the columns and rows can be set to a&lt;br /&gt;
takes up as much space as needed by the contained control. The *setting take&lt;br /&gt;
The Grid control is often used to lay out data entry forms. The following code l&lt;br /&gt;
collect user information. The resulting form (in the Visual Studio designer) is s&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;Grid&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;Grid.RowDefinitions&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;RowDefinition Height=&quot;Auto&quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;RowDefinition Height=&quot;Auto&quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;RowDefinition Height=&quot;Auto&quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;RowDefinition Height=&quot;Auto&quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;RowDefinition Height=&quot;28&quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;RowDefinition Height=&quot;*&quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/Grid.RowDefinitions&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;Grid.ColumnDefinitions&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;ColumnDefinition Width=&quot;Auto&quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;ColumnDefinition Width=&quot;200&quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;ColumnDefinition Width=&quot;*&quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/Grid.ColumnDefinitions&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;Label Grid.Row=&quot;0&quot; Grid.Column=&quot;0&quot; Content=&quot;Name:&quot;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;Label Grid.Row=&quot;1&quot; Grid.Column=&quot;0&quot; Content=&quot;Old Password:&quot;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;Label Grid.Row=&quot;2&quot; Grid.Column=&quot;0&quot; Content=&quot;New Password:&quot;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;Label Grid.Row=&quot;3&quot; Grid.Column=&quot;0&quot; Content=&quot;Confirm Password:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;TextBox Grid.Column=&quot;1&quot; Grid.Row=&quot;0&quot; Margin=&quot;3&quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;TextBox Grid.Column=&quot;1&quot; Grid.Row=&quot;1&quot; Margin=&quot;3&quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;TextBox Grid.Column=&quot;1&quot; Grid.Row=&quot;2&quot; Margin=&quot;3&quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;TextBox Grid.Column=&quot;1&quot; Grid.Row=&quot;3&quot; Margin=&quot;3&quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;Button Grid.Column=&quot;1&quot; Grid.Row=&quot;4&quot; HorizontalAlignment=&quot;Righ&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;MinWidth=&quot;80&quot; Margin=&quot;0,0,0,8&quot; Content=&quot;Submit&quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/Grid&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;img alt=&quot;Photo&quot; src=&quot;https://lh4.googleusercontent.com/vFN0WHi_aPMoi_gU5S5CsLydcx_A6V50noXP-q_u3Pc=w444-h207-p-no&quot; /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://pakitgroup.blogspot.com/feeds/7575810354967599063/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/using-layout-controls.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/7575810354967599063'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/7575810354967599063'/><link rel='alternate' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/using-layout-controls.html' title='Using Layout Controls'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://lh4.googleusercontent.com/vFN0WHi_aPMoi_gU5S5CsLydcx_A6V50noXP-q_u3Pc=s72-w444-h207-c-p-no" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8156933787798242641.post-8883493046554777423</id><published>2013-12-07T07:36:00.001-08:00</published><updated>2013-12-07T07:36:59.002-08:00</updated><title type='text'>XAML</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;&lt;a href=&quot;http://pakitgroup.blogspot.com/&quot;&gt;WPF&lt;/a&gt; &lt;/b&gt;user interfaces are built using a declarative markup language called XAML. XAML declares the controls that will&lt;br /&gt;
make up the interface. An opening angle bracket (&amp;lt;) followed by the name of the control type and a closing bracket&lt;br /&gt;
define the control. For example, the following markup defines a button control inside a Grid.&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;Grid&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;Button/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/Grid&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
Notice the Grid needs a formal closing tag because it contains the Button control. Since the Button control does not contain any other elements, you can use a forward slash (/) in front of the end bracket to close it&lt;br /&gt;
The next step is to define the properties of the controls. For example, you may want to set the background colour of the button to red and write some text on it. The properties of the control are set by using attribute syntax, which consists of the property name followed by an equal sign and the attribute value in quotation marks. The following mark-up shows the Button control with some attributes added:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;Grid&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;Button Content=&quot;Click Me&quot; Background=&quot;Red&quot;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/Grid&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
For some properties of an object element a syntax known as property element syntax is used. The syntax for the property element start tag is &amp;lt;typeName.propertyName&amp;gt;. For example, you can create rows and columns in the layout grid to control placement of controls in the grid, as shown:&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;Grid.ColumnDefinitions&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;ColumnDefinition Width=&quot;100&quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;ColumnDefinition Width=&quot;*&quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/Grid.ColumnDefinitions&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;Grid.RowDefinitions&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;RowDefinition Height=&quot;25&quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;RowDefinition Height=&quot;25&quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;RowDefinition Height=&quot;25&quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/Grid.RowDefinitions&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Controls are positioned in the grid by including a Grid.Rowand Grid.Columnattribute, as shown:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;Label Grid.Column=&quot;0&quot; Grid.Row=&quot;0&quot; Content=&quot;Name:&quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;Label Grid.Column=&quot;0&quot; Grid.Row=&quot;1&quot; Content=&quot;Password:&quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;TextBox Name=&quot;txtName&quot; Grid.Column=&quot;1&quot; Grid.Row=&quot;0&quot;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;TextBox Name=&quot;txtPassword&quot; Grid.Column=&quot;1&quot; Grid.Row=&quot;1&quot;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;Button Grid.Column=&quot;1&quot; Grid.Row=&quot;3&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Content=&quot;Click Me&quot; HorizontalAlignment=&quot;Right&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;MinWidth=&quot;80&quot; Background=&quot;Red&quot;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Photo&quot; src=&quot;https://lh5.googleusercontent.com/BamDrZQlxVrjktyf6OKNaGB--9DnrEwOeR4Nk5EFPiA=w446-h207-p-no&quot; /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://pakitgroup.blogspot.com/feeds/8883493046554777423/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/xaml.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/8883493046554777423'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/8883493046554777423'/><link rel='alternate' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/xaml.html' title='XAML'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://lh5.googleusercontent.com/BamDrZQlxVrjktyf6OKNaGB--9DnrEwOeR4Nk5EFPiA=s72-w446-h207-c-p-no" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8156933787798242641.post-8910734149503175416</id><published>2013-12-06T05:40:00.001-08:00</published><updated>2013-12-06T05:40:15.232-08:00</updated><title type='text'>WHAT IS A CASE STUDY?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
The term “case study” appears every now and then in the title of software engineering&lt;br /&gt;
research papers. These papers have in common that they study a specific case, in&lt;br /&gt;
contrast to a sample from a specified population. However, the presented studies&lt;br /&gt;
range from very ambitious and well-organized studies in the field of operations&lt;br /&gt;
(in vivo) to small toy examples in a university lab (in vitro) that claim to be case&lt;br /&gt;
studies. This variation creates confusion, which should be addressed by increased&lt;br /&gt;
knowledge about case study methodology.&lt;br /&gt;
Case study is a commonly used research strategy in areas such as psychology,&lt;br /&gt;
sociology, political science, social work, business, and community planning&lt;br /&gt;
In these areas, case studies are conducted with the objectives of not only increasing knowledge (e.g., knowledge about individuals, groups,&lt;br /&gt;
and organizations and about social, political, and related phenomena) but also bringing about change in the phenomenon being studied (e.g. improving education or social&lt;br /&gt;
care). Software engineering research has similar high-level objectives, that is, to better understand how and why software engineering should be undertaken and, with&lt;br /&gt;
this knowledge, to seek to improve the software engineering process and the resultant&lt;br /&gt;
software products.&lt;br /&gt;
There are different taxonomies used to classify research in software engineering.&lt;br /&gt;
The term case study is used in parallel with terms like field study and observational&lt;br /&gt;
study, each focusing on a particular aspect of the research methodology. For example,&lt;br /&gt;
Case studies offer an approach that does not require a strict boundary between the&lt;br /&gt;
object of study and its environment. Case studies do not generate the same results&lt;br /&gt;
on, for example, causal relationships, as controlled experiments do, but they provide&lt;br /&gt;
a deeper understanding of the phenomena under study. As they are different from&lt;br /&gt;
analytical and controlled empirical studies, case studies have been criticized for being&lt;br /&gt;
of less value, being impossible to generalize from, being biased by researchers, and so&lt;br /&gt;
on. This critique can be met by applying proper research methodology practices and&lt;br /&gt;
by reconsidering that knowledge is more than statistical significance.&lt;br /&gt;
However, the research community has to learn more about the case study methodology&lt;br /&gt;
in order to conduct, report, review, and judge it properly.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;HISTORY:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
The term case study first appeared in software engineering journal papers in the&lt;br /&gt;
late 1970s. At that time, a case study was typically a demonstration case, that&lt;br /&gt;
is, a case that demonstrated the implementation of some software technology or&lt;br /&gt;
programming concept.&lt;br /&gt;
In the mid- to late-1980s, papers started to report case studies of a broader range&lt;br /&gt;
of software development phenomena, for example, Alexander and Potter’study&lt;br /&gt;
of formal specifications and rapid prototying. For these types of papers, the term case&lt;br /&gt;
study refers to a self-experienced and self-reported investigation. Throughout the&lt;br /&gt;
1990s the scale of these “self investigations” increased and there were, for example, a&lt;br /&gt;
series of papers reporting case studies of software process improvement in large and&lt;br /&gt;
multinational organizations such as Boeing, Hughes, Motorola, NASA, and Siemens.&lt;br /&gt;
Case studies based on the external and independent observation of a software&lt;br /&gt;
engineering activity first appeared in the late 1980s, for example, Boehm and&lt;br /&gt;
Ross’s “extensive case study” of the introduction of new information&lt;br /&gt;
systems into a large industrial corporation in an emerging nation. These case studies,&lt;br /&gt;
however, did not direct attention at case study methodology that is, at the design,&lt;br /&gt;
&lt;br /&gt;
conduct, and reporting of the case study&lt;br /&gt;
The first case study papers that explicitly report the study methodology were&lt;br /&gt;
published in 1988: Curtis et al.’s [37] field study of software design activities and&lt;br /&gt;
Swanson and Beath’s [199] multiple case study of software maintenance. Given the&lt;br /&gt;
status of case study research in software engineering at the time, it is not surprising that Swanson and Beath were actually researchers in a school of management&lt;br /&gt;
in the United States, and were not software engineering researchers. Swanson and&lt;br /&gt;
Beath use their multiple case studies to illustrate a number of challenges that arise&lt;br /&gt;
when conducting case studies research, and they also present methodological lessons.&lt;br /&gt;
Their paper therefore appears to be the first of its kind in the software engineering&lt;br /&gt;
research community that explicitly discusses the challenge of designing, conducting,&lt;br /&gt;
and reporting case study research.&lt;br /&gt;
During the 1990s, both demonstration studies and genuine case studies (as we&lt;br /&gt;
define them here) were published, although only in small numbers. Glass et al.&lt;br /&gt;
analyzed software engineering publications in six major software engineering journals&lt;br /&gt;
for the period 1995–1999 and found that only 2.2% of these publications reported case&lt;br /&gt;
studies .Much more recently, a sample of papers from Sjøberg et al.’s large systematic review of experimental studies in software engineering &amp;nbsp;were analysed&lt;br /&gt;
by Holt .She classified 12% of the sample as case studies. This compares to&lt;br /&gt;
1.9% of papers classified as formal experiments in the Sjøberg study. But differences&lt;br /&gt;
in the design of these reviews make it hard to properly compare the reviews and draw&lt;br /&gt;
firm conclusions.&lt;br /&gt;
The first recommendations, by software engineering researchers, regarding case&lt;br /&gt;
study methodology were published in the mid-1990s . However, these recommendations focus primarily on the use of quantitative data. In the late 1990s, Seaman&lt;br /&gt;
published guidelines on qualitative research . Then, in the early twenty-first&lt;br /&gt;
&lt;br /&gt;
century, a broader set of guidelines on empirical research were published by Kitchen ham et al. Sim et al. arranged a workshop on the topic, which was summarized&lt;br /&gt;
in Empirical Software Engineering, Wohlin et al. provided a brief introduction&lt;br /&gt;
to case studies among other empirical methods , and Dittrich et al. edited a special issue of Information and Software Technology on qualitative software engineering&lt;br /&gt;
There is a very wide range of activities in software engineering, such as development, operation, and maintenance of software and related artifacts as well as the&lt;br /&gt;
management of these activities. A frequent aim of software engineering research is to&lt;br /&gt;
investigate how this development, operation, and maintenance is conducted, and also&lt;br /&gt;
managed, by software engineers and other stakeholders under different conditions.&lt;br /&gt;
With such a wide range of activities, and a wide range of software products being&lt;br /&gt;
developed, there is a very diverse range of skills and experience needed by the actors&lt;br /&gt;
undertaking these activities.&lt;br /&gt;
Software engineering is also distinctive in the combination of diverse topics that&lt;br /&gt;
make up the discipline&lt;br /&gt;
Many of the interim products are produced either intentionally by the actors (e.g.,&lt;br /&gt;
the minutes of meetings) or automatically by technology (e.g., updates to a version&lt;br /&gt;
of control system). Therefore, one of the distinctive aspects of software engineering&lt;br /&gt;
is the raw data that are naturally, and often automatically, generated by the activities&lt;br /&gt;
and technologies.&lt;br /&gt;
There are clear overlaps with other disciplines, such as psychology, management,&lt;br /&gt;
business, and engineering, but software engineering brings these other disciplines&lt;br /&gt;
together in a unique way, a way that needs to be studied with research methods&lt;br /&gt;
tailored to the specifics of the discipline&lt;br /&gt;
Case studies investigate phenomena in their real-world settings, for example, new&lt;br /&gt;
technologies, communication in global software development, project risk and failure&lt;br /&gt;
factors, and so on. Hence, the researcher needs to consider not only the practical&lt;br /&gt;
requirements and constraints from the researcher’s perspective, but also the objectives&lt;br /&gt;
and resource commitments of the stakeholders who are likely to be participating in,&lt;br /&gt;
or supporting, the case study. Also, practitioners may want to intervene in future&lt;br /&gt;
projects – that is, change the way things are done in future projects – on the basis&lt;br /&gt;
of the outcomes from the case studies, and often software engineering managers&lt;br /&gt;
are interested in technology interventions, such as adopting a new technology&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;the above content is taken from&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;a href=&quot;http://books.google.com.pk/books?id=T7rXoaxqPIAC&amp;amp;printsec=frontcover&amp;amp;dq=software+research&amp;amp;hl=en&amp;amp;sa=X&amp;amp;ei=zM2hUsy0C8-AhAe34IGwDw&amp;amp;redir_esc=y#v=onepage&amp;amp;q=software%20research&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;&quot;&amp;nbsp;&lt;span style=&quot;background-color: white; color: #333333; font-family: Arial, sans-serif;&quot;&gt;Case Study Research in Software Engineering: Guidelines and Examples&amp;nbsp;&lt;/span&gt;&quot;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://pakitgroup.blogspot.com/feeds/8910734149503175416/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/what-is-case-study.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/8910734149503175416'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/8910734149503175416'/><link rel='alternate' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/what-is-case-study.html' title='WHAT IS A CASE STUDY?'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8156933787798242641.post-6037782531339770425</id><published>2013-12-06T05:05:00.001-08:00</published><updated>2013-12-06T05:05:12.062-08:00</updated><title type='text'>Constructors in Object Oriented Programming</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Constructors may be a new concept for structured programmers. Although constructors are not&lt;br /&gt;
normally used in non-OO languages such as COBOL, C, and Basic, the struct , which is part of&lt;br /&gt;
C/C++, does include constructors.In some OO languages, such as Java and C#, constructors are&lt;br /&gt;
methods that share the same name as the class. Visual Basic .NET uses the designation New&lt;br /&gt;
and Objective-C uses the init keyword.&lt;br /&gt;
&amp;nbsp;For example, a constructor for the Cabbie class &amp;nbsp;would look like this:&lt;br /&gt;
&amp;nbsp;public Cabbie(){&lt;br /&gt;
&amp;nbsp;/* code to construct the object */&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;The compiler will recognize that the method name is identical to the class name and consider&lt;br /&gt;
the method a constructor.&lt;br /&gt;
&amp;nbsp;Note that in this Java code (as with C# and C++), a constructor does not have a return value. If&lt;br /&gt;
you provide a return value, the compiler will not treat the method as a constructor.&lt;br /&gt;
&amp;nbsp;For example, if you include the following code in the class, the compiler will not consider this&lt;br /&gt;
a constructor because it has a return value—in this case, an integer:&lt;br /&gt;
&amp;nbsp;public int Cabbie(){&lt;br /&gt;
&amp;nbsp;/* code to construct the object */&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;This syntax requirement can cause problems because this code will compile but will not behave&lt;br /&gt;
as expected.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
Constructors may be a new concept for structured programmers. Although constructors are not&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
normally used in non-OO languages such as COBOL, C, and Basic, the struct , which is part of&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
C/C++, does include constructors. In the first two chapters, we alluded to these special methods&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
that are used to construct objects. In some OO languages, such as Java and C#, constructors are&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
methods that share the same name as the class. Visual Basic .NET uses the designation New&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
and Objective-C uses the init keyword. As usual, we will focus on the concepts of constructors&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
and not cover the specific syntax of all the languages. Let’s take a look at some Java code that&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
implements a constructor.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;For example, a constructor for the Cabbie class we covered in Chapter 2 would look like this:&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;public Cabbie(){&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;/* code to construct the object */&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;}&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;The compiler will recognize that the method name is identical to the class name and consider&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
the method a constructor. 54 Chapter 3 Advanced Object-Oriented Concepts&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;Caution&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;Note that in this Java code (as with C# and C++), a constructor does not have a return value. If&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
you provide a return value, the compiler will not treat the method as a constructor.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;For example, if you include the following code in the class, the compiler will not consider this&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
a constructor because it has a return value—in this case, an integer:&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;public int Cabbie(){&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;/* code to construct the object */&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;}&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;This syntax requirement can cause problems because this code will compile but will not behave&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
as expected.&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
Constructors may be a new concept for structured programmers. Although constructors are not&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
normally used in non-OO languages such as COBOL, C, and Basic, the struct , which is part of&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
C/C++, does include constructors. In the first two chapters, we alluded to these special methods&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
that are used to construct objects. In some OO languages, such as Java and C#, constructors are&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
methods that share the same name as the class. Visual Basic .NET uses the designation New&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
and Objective-C uses the init keyword. As usual, we will focus on the concepts of constructors&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
and not cover the specific syntax of all the languages. Let’s take a look at some Java code that&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
implements a constructor.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;For example, a constructor for the Cabbie class we covered in Chapter 2 would look like this:&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;public Cabbie(){&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;/* code to construct the object */&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;}&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;The compiler will recognize that the method name is identical to the class name and consider&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
the method a constructor. 54 Chapter 3 Advanced Object-Oriented Concepts&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;Caution&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;Note that in this Java code (as with C# and C++), a constructor does not have a return value. If&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
you provide a return value, the compiler will not treat the method as a constructor.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;For example, if you include the following code in the class, the compiler will not consider this&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
a constructor because it has a return value—in this case, an integer:&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;public int Cabbie(){&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;/* code to construct the object */&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;}&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;This syntax requirement can cause problems because this code will compile but will not behave&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
as expected.&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;b&gt;When Is a Constructor Called?&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;When a new object is created, one of the first things that happens is that the constructor is&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
called. Check out the following code:&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;Cabbie myCabbie = new Cabbie();&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;The new keyword creates a new instance of the Cabbie class, thus allocating the required&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
memory. Then the constructor itself is called, passing the arguments in the parameter list. The&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
constructor provides the developer the opportunity to attend to the appropriate initialization.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;Thus, the code new Cabbie() will instantiate a Cabbie object and call the Cabbie method,&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
which is the constructor.&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;What’s Inside a Constructor?&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
Perhaps the most important function of a constructor is to initialize the memory allocated&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
when the new keyword is encountered. In short, code included inside a constructor should set&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
the newly created object to its initial, stable, safe state.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;For example, if you have a counter object with an attribute called count , you need to set count&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
to zero in the constructor:&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;count = 0;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font-weight: bold;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;b&gt;The Default Constructor&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;If you write a class and do not include a constructor, the class will still compile, and you can&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
still use it. If the class provides no explicit constructor, a default constructor will be provided.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
It is important to understand that at least one constructor always exists, regardless of whether&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
you write a constructor yourself. If you do not provide a constructor, the system will provide a&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
default constructor for you.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;Besides the creation of the object itself, the only action that a default constructor takes is to&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
call the constructor of its superclass. In many cases, the superclass will be part of the language&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
framework, like the Object class in Java. For example, if a constructor is not provided for the&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
public Cabbie(){&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;super();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;}&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
If you were to decompile the bytecode produced by the compiler, you would see this code. The&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
compiler actually inserts it.&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Using Multiple Constructors&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;b&gt;public class Count&lt;/b&gt; {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;int count;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
public Count()&lt;/div&gt;
&lt;div&gt;
{&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;count = 0;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;}&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;}&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&amp;nbsp;On the one hand, we want to initialize the attribute count to count to zero: We can easily&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
accomplish this by having a constructor initialize count to zero as follows:&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;public Count()&lt;/div&gt;
&lt;div&gt;
{&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;count = 0;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;}&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
On the other hand, we might want to pass an initialization parameter that allows count to be&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
set to various numbers:&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;public Count (int number){&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;count = number;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;}&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
the above content is taken from the&amp;nbsp;&lt;a href=&quot;http://books.google.com.pk/books?id=QveDqVtLFIcC&amp;amp;printsec=frontcover&amp;amp;dq=object+oriented&amp;amp;hl=en&amp;amp;sa=X&amp;amp;ei=GcihUuHxJ9GIhQf79IDIAQ&amp;amp;redir_esc=y#v=onepage&amp;amp;q=object%20oriented&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;The Object-oriented Thought Process&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://pakitgroup.blogspot.com/feeds/6037782531339770425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/constructors-in-object-oriented.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/6037782531339770425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/6037782531339770425'/><link rel='alternate' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/constructors-in-object-oriented.html' title='Constructors in Object Oriented Programming'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8156933787798242641.post-1600902265031175249</id><published>2013-12-05T10:18:00.000-08:00</published><updated>2013-12-05T10:18:25.403-08:00</updated><title type='text'> Links and Associations</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
A link is a physical or conceptual connection between object instances. In&lt;br /&gt;
OMT&amp;nbsp;link is represented by a line labeled with its name as shown in Figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;img height=&quot;153&quot; src=&quot;https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcQcGwGzieURNOtMo5aiPj-YKzpH1Vr-2rjf0-iTdkDDZyu8drmHjQ&quot; width=&quot;320&quot; /&gt;&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
association&lt;/h2&gt;
&lt;div&gt;
&lt;div&gt;
An association describes a group of links with common structure and common&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
semantics between two or more classes. Association is represented by a line&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
labeled with the association name&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
Associations can have role names associated each class connection.Associations can also have qualifiers on the class connections. qualifiers are special attributes that reduce the effective multiplicity&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://pakitgroup.blogspot.com/feeds/1600902265031175249/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/links-and-associations.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/1600902265031175249'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/1600902265031175249'/><link rel='alternate' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/links-and-associations.html' title=' Links and Associations'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8156933787798242641.post-4690084124388179505</id><published>2013-12-05T09:48:00.000-08:00</published><updated>2013-12-05T09:48:44.511-08:00</updated><title type='text'>OBJECT MODEL COMPONENTS PART 2</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;u&gt;Attribute&lt;/u&gt;:&lt;/b&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;div&gt;
An attribute is a data value held by objects in a class. Each attribute has a&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
value for each object instance. This value should be a pure data value, not an&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
object. Attributes are listed in the second part of the class box. Attributes may&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
or may not be shown; it depends on the level of detail desired. Each attribute&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
name may be followed by the optional details such as type and default value.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
An object model should generally distinguish independent base attributes&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
from dependent derived attributes. A derived attribute is that which is derived&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
from other attributes. For example, age is a derived attribute, as it can be&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
derived from date-of-birth and current-date attributes.&amp;nbsp;&lt;/div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;u&gt;operation&lt;/u&gt;&lt;/b&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
An operation is a function or transformation that may be applied to or by&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
objects in a class. Operations are listed in the third part of the class box.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
Operations may or may not be shown; it depends on the level of detail&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
desired. Each operation may be followed by optional details such as argument&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
list and result type. The name and type of each argument may be given. An&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
empty argument list in parentheses shows explicitly that there are no&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
arguments. All objects in a class share the same operations. Each operation&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
has a target object as an implicit argument. An operation may have&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
arguments in addition to its target object, which parameterize the operation.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
The behavior of the operation depends on the class of its target.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
The same operation may be defined for several different classes. However, the&lt;/div&gt;
&lt;div&gt;
signature (i.e. output type and formal parameter list) must be the same&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;polymorphism&amp;nbsp;&lt;/b&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;div&gt;
An operation may be polymorphic in nature. A polymorphic operation means&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
that the same operation takes on different forms in different/same classes.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
Overloading of operators, overloading of functions and overriding of functions&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
provided by object-oriented programming languages are all examples of&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
polymorphic operations. A method is the implementation of an operation for a&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
class. The method depends only on the class of the target object.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font-weight: bold;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-weight: bold; text-decoration: underline;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://pakitgroup.blogspot.com/feeds/4690084124388179505/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/object-model-components-part-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/4690084124388179505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/4690084124388179505'/><link rel='alternate' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/object-model-components-part-2.html' title='OBJECT MODEL COMPONENTS PART 2'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8156933787798242641.post-6144641599414933137</id><published>2013-12-05T08:57:00.001-08:00</published><updated>2013-12-05T09:54:40.660-08:00</updated><title type='text'>Object model components part 1</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Object:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
An object is a concept, abstraction, or thing with crisp boundaries and meaning for the&lt;br /&gt;
problem at hand. All objects have identity and are distinguishable&lt;br /&gt;
&lt;b&gt;Objects&lt;/b&gt;&amp;nbsp;are the physical and conceptual things we find in the universe around us. Hardware, software, documents, human beings, and even concepts are all examples of objects. For purposes of modeling his or her company, a chief executive officer could view employees, buildings, divisions, documents, and benefits packages as objects. An automotive engineer would see tires, doors, engines, top speed, and the current fuel level as objects. Atoms, molecules, volumes, and temperatures would all be objects a chemist might consider in creating an object-oriented simulation of a chemical reaction. Finally, a software engineer would consider stacks, queues, windows, and check boxes as objects.&lt;br /&gt;
Objects are thought of as having state. The&amp;nbsp;&lt;b&gt;state&lt;/b&gt;&amp;nbsp;of an object is the condition of the object, or a set of circumstances describing the object. It is not uncommon to hear people talk about the &quot;state information&quot; associated with a particular object. For example, the state of a bank account object would include the current balance, the state of a clock object would be the current time, the state of an electric light bulb would be &quot;on&quot; or &quot;off.&quot; For complex objects like a human being or an automobile, a complete description of the state might be very complex. Fortunately, when we use objects to model real world or imagined situations, we typically restrict the possible states of the objects to only those that are relevant to our models.&lt;br /&gt;
Objects are thought of as having state. The&amp;nbsp;&lt;b&gt;state&lt;/b&gt;&amp;nbsp;of an object is the condition of the object, or a set of circumstances describing the object. It is not uncommon to hear people talk about the &quot;state information&quot; associated with a particular object. For example, the state of a bank account object would include the current balance, the state of a clock object would be the current time, the state of an electric light bulb would be &quot;on&quot; or &quot;off.&quot; For complex objects like a human being or an automobile, a complete description of the state might be very complex. Fortunately, when we use objects to model real world or imagined situations, we typically restrict the possible states of the objects to only those that are relevant to our models.&lt;br /&gt;
We also think of the state of an object as something that is internal to an object. For example, if we place a message in a mailbox, the (internal) state of the mailbox object is changed, whereas the (internal) state of the message object remains unchanged.&lt;br /&gt;
An object&lt;br /&gt;
has the following four main characteristics:&lt;br /&gt;
&lt;br /&gt;
• Unique identification&lt;br /&gt;
• Set of attributes&lt;br /&gt;
• Set of states&lt;br /&gt;
• Set of operations (behavior)&lt;br /&gt;
&lt;div&gt;
&lt;div&gt;
Unique identification, we mean every object has a unique name by which it is&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
identified in the system. Set of attributes, we mean every object has a set of&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
properties in which we are interested in. Set of states we mean values of&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
attributes of an object constitute the state of the object. Every object will have&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
a number of states but at a given time it can be in one of those states. Set of&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
operations we mean externally visible actions an object can perform. When an&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
operation is performed, the state of the object may change.&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
The box may/may not be divided in&lt;br /&gt;
particular regions. Object instances can be used in instance diagrams, which&lt;br /&gt;
are useful for documenting test cases and discussing examples.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;img src=&quot;https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRTLnW4vQXD6Ug9SpcGnhtbU_nfUQ4GCo-JRVRy7KCzuGJ1_TLURQ&quot; /&gt;&lt;/div&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Class:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
A class describes a group of objects with similar properties (attributes), common behavior&lt;br /&gt;
(operations), common relationships to other objects, and common semantics&lt;br /&gt;
A class describes a collection of similar objects. It is a template where certain&lt;br /&gt;
basic characteristics of a set of objects are defined. A class defines the basic&lt;br /&gt;
attributes and the operations of the objects of that type. Defining a class does&lt;br /&gt;
not define any object, but it only creates a template. For objects to be actually&lt;br /&gt;
created, instances of the class are to be created as per the requirement of the&lt;br /&gt;
case.&lt;br /&gt;
Classes are built on the basis of abstraction, where a set of similar objects is&lt;br /&gt;
observed and their common characteristics are listed. Of all these, the&lt;br /&gt;
characteristics of concern to the system under observation are taken and the&lt;br /&gt;
class definition is made. The attributes of no concern to the system are left&lt;br /&gt;
out. This is known as abstraction. So, the abstraction is the process of hiding&lt;br /&gt;
superfluous details and highlighting pertinent details in respect to the system&lt;br /&gt;
under development.&lt;br /&gt;
&lt;div&gt;
&lt;div&gt;
It should be noted that the abstraction of an object varies according to its&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
application. For instance, while defining a pen class for a stationery shop, the&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
attributes of concern might be the pen color, ink color, pen type etc., whereas&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
a pen class for a manufacturing firm would be containing the other dimensions&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
of the pen like its diameter, its shape and size etc.&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
Each application-domain concept from the real world that is important to the&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
application should be modeled as an object class. Classes are arranged into&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
hierarchies sharing common structure and behavior and are associated with&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
other classes. This gives rise to the concept of&lt;b&gt; &lt;u&gt;inheritance&lt;/u&gt;.&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
Through inheritance, a new type of class can be defined using a similar&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
existing class with a few new features. For instance, a class vehicle can be&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
defined with the basic functionality of any vehicle and a new class called car&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
can be derived out of it with a few modifications. This would save the&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
developers time and effort as the classes already existing are reused without&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
much change.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font-weight: bold;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://pakitgroup.blogspot.com/feeds/6144641599414933137/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/object-model-components-part-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/6144641599414933137'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/6144641599414933137'/><link rel='alternate' type='text/html' href='http://pakitgroup.blogspot.com/2013/12/object-model-components-part-1.html' title='Object model components part 1'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8156933787798242641.post-7848402058722681500</id><published>2011-11-18T08:36:00.000-08:00</published><updated>2011-11-18T08:36:17.855-08:00</updated><title type='text'>ISDN</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Calibri, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px;&quot;&gt;ISDN (Integrated Services Digital Network) is a set of CCITT/ITU standards for digital transmission over ordinary telephone copper wire as well as over other media. Home and business users who install an ISDN&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://searchcio-midmarket.techtarget.com/definition/adapter&quot; style=&quot;background-color: white; color: #003399; font-family: Calibri, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; outline-color: initial; outline-style: initial; outline-width: 0px; text-align: -webkit-auto; text-decoration: none;&quot;&gt;adapter&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Calibri, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; text-align: -webkit-auto;&quot;&gt;&amp;nbsp;(in place of a telephone&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://searchmobilecomputing.techtarget.com/definition/modem&quot; style=&quot;background-color: white; color: #003399; font-family: Calibri, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; outline-color: initial; outline-style: initial; outline-width: 0px; text-align: -webkit-auto; text-decoration: none;&quot;&gt;modem&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Calibri, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; text-align: -webkit-auto;&quot;&gt;) receive Web pages at up to 128&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://searchnetworking.techtarget.com/definition/Kbps&quot; style=&quot;background-color: white; color: #003399; font-family: Calibri, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; outline-color: initial; outline-style: initial; outline-width: 0px; text-align: -webkit-auto; text-decoration: none;&quot;&gt;Kbps&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Calibri, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; text-align: -webkit-auto;&quot;&gt;&amp;nbsp;compared with the maximum 56 Kbps rate of a modem connection. ISDN requires adapters at both ends of the transmission so your access provider also needs an ISDN adapter. ISDN is generally available from your phone company in most urban areas in the United States and Europe. In many areas where DSL and&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://searchsecurity.techtarget.com/sDefinition/0,,sid14_gci211726,00.html&quot; style=&quot;background-color: white; color: #003399; font-family: Calibri, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; outline-color: initial; outline-style: initial; outline-width: 0px; text-align: -webkit-auto; text-decoration: none;&quot;&gt;cable modem&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Calibri, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; text-align: -webkit-auto;&quot;&gt;&amp;nbsp;service are now offered, ISDN is no longer as popular an option as it was formerly.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Calibri, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; text-align: -webkit-auto;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pakitgroup.blogspot.com/feeds/7848402058722681500/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pakitgroup.blogspot.com/2011/11/isdn.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/7848402058722681500'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/7848402058722681500'/><link rel='alternate' type='text/html' href='http://pakitgroup.blogspot.com/2011/11/isdn.html' title='ISDN'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8156933787798242641.post-666058253672328795</id><published>2011-10-27T00:02:00.000-07:00</published><updated>2011-10-27T00:02:41.971-07:00</updated><title type='text'>Attenuation of Digital Signals</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
Signal strength falls off with distance&lt;br /&gt;
• Depends on medium&lt;br /&gt;
• Received signal strength:&lt;br /&gt;
— must be enough to be detected&lt;br /&gt;
— must be sufficiently higher than noise to be received&lt;br /&gt;
without error&lt;br /&gt;
• Attenuation is an increasing function of&lt;br /&gt;
frequency&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Delay Distortion&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
• Only in guided media&lt;br /&gt;
• Propagation velocity varies with frequency&lt;br /&gt;
&lt;b&gt;Noise&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
• Additional signals inserted between transmitter&lt;br /&gt;
and receiver&lt;br /&gt;
&lt;div style=&quot;font-weight: bold;&quot;&gt;• Thermal&lt;/div&gt;— Due to thermal agitation of electrons&lt;br /&gt;
— Uniformly distributed&lt;br /&gt;
&lt;div style=&quot;font-weight: bold;&quot;&gt;— White noise&lt;/div&gt;&lt;div style=&quot;font-weight: bold;&quot;&gt;• Intermodulation&lt;/div&gt;— Signals that are the sum and difference of original&lt;br /&gt;
frequencies sharing a medium&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;• Crosstalk&lt;/b&gt;&lt;br /&gt;
— A signal from one line is picked up by another&lt;br /&gt;
&lt;b&gt;• Impulse&lt;/b&gt;&lt;br /&gt;
— Irregular pulses or spikes&lt;br /&gt;
— e.g. External electromagnetic interference&lt;br /&gt;
— Short duration&lt;br /&gt;
— High amplitude&lt;br /&gt;
&lt;b&gt;Channel Capacity&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Data rate&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #660000;&quot;&gt;In bits per second, bps (not Bps)&lt;/div&gt;&lt;div style=&quot;color: #660000;&quot;&gt;— Rate at which data can be communicated&lt;/div&gt;&lt;br /&gt;
&lt;b&gt;Bandwidth&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: #660000;&quot;&gt;— In cycles per second of Hertz, Hz&lt;/div&gt;&lt;div style=&quot;color: #660000;&quot;&gt;— Constrained by transmitter and medium&lt;/div&gt;&lt;b&gt;• Convention: not all k’s are equal&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: #660000;&quot;&gt;— data rates are given as power of 10&lt;/div&gt;&lt;div style=&quot;color: #660000;&quot;&gt;• e.g., kHz is 1000Hz&lt;/div&gt;&lt;div style=&quot;color: #660000;&quot;&gt;— data is given in terms of power of 2&lt;/div&gt;&lt;div style=&quot;color: #660000;&quot;&gt;• e.g., KByte is 1024 Bytes&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nyquist Bandwidth&lt;br /&gt;
&lt;br /&gt;
• If rate of signal transmission is 2B&lt;br /&gt;
then a signal with frequencies no&lt;br /&gt;
greater than B is sufficient to carry&lt;br /&gt;
the signal rate.&lt;br /&gt;
— Why? Assume we have a square wave&lt;br /&gt;
of repeating 101010. If a positive pulse&lt;br /&gt;
is a 1 and a negative pulse is 0, then&lt;br /&gt;
each pulse lasts 1/2 T1 (T1 = 1/f1) and&lt;br /&gt;
the data rate is 2f1 bits per second.&lt;br /&gt;
&lt;br /&gt;
• If we limit the components to a maximum&lt;br /&gt;
frequency (restrict the bandwidth) we need to&lt;br /&gt;
make sure the signal is accurately represented.&lt;br /&gt;
• Based on the accuracy we require, the&lt;br /&gt;
bandwidth can carry a particular data rate. The&lt;br /&gt;
theoretical maximum communication limit is&lt;br /&gt;
given by the Nyquist formula:&lt;br /&gt;
C= 2B log2M&lt;br /&gt;
C = capacity or data transfer rate in bps&lt;br /&gt;
B = bandwidth (in hertz)&lt;br /&gt;
M = number of possible signaling levels&lt;br /&gt;
&lt;b&gt;Signal Strength&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
— An important parameter in communication is the strength&lt;br /&gt;
of the signal transmitted. Even more important is the&lt;br /&gt;
strength being received.&lt;br /&gt;
— As signal propagates it will be attenuated (decreased)&lt;br /&gt;
— Amplifiers are inserted to increase signal strength&lt;br /&gt;
— Gains, losses and relative levels of signals are expressed in&lt;br /&gt;
decibels&lt;br /&gt;
• This is a logarithmic scale, but strength usually falls logarithmically&lt;br /&gt;
• Calculation of gains and losses involves simple addition and&lt;br /&gt;
subtraction&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Delay Distortion&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
— Different frequency components of a signal&lt;br /&gt;
• are attenuated differently, and&lt;br /&gt;
• travel at different speeds through guided&lt;br /&gt;
media&lt;br /&gt;
— This may lead to delay distortion&lt;br /&gt;
&lt;i&gt;&lt;u&gt;&lt;b&gt;Shannon capacity&lt;/b&gt;&lt;/u&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
— A transmission line may experience interference&lt;br /&gt;
from a number of sources, called noise. Noise is&lt;br /&gt;
measured in terms of signal to noise power ratio,&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEju9GyudT6MzZSN85OobeXZed8QipqNOZ3DkMBvaSHIfrJP_feuULBjTU1-pUxrE4tagUW4t3jf8scIQOlTflDUJz6k5Sdn067h3qjfdbNlZZK2vz49tpBJUp2e3_J47SMuf5aF1EhyphenhyphenxUwr/s1600/formula.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;250&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEju9GyudT6MzZSN85OobeXZed8QipqNOZ3DkMBvaSHIfrJP_feuULBjTU1-pUxrE4tagUW4t3jf8scIQOlTflDUJz6k5Sdn067h3qjfdbNlZZK2vz49tpBJUp2e3_J47SMuf5aF1EhyphenhyphenxUwr/s320/formula.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;expressed in decibels:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Cross Talk&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
— near-end crosstalk (NEXT), cross talk of strong&lt;br /&gt;
transmit (output) signal to weak receive (input)&lt;br /&gt;
signal.&lt;br /&gt;
— adaptive NEXT canceling using op-amp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Noise&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;• Impulse Noise&lt;/b&gt;&lt;br /&gt;
— impulse caused by switching, lightning etc.&lt;br /&gt;
&lt;b&gt;• Thermal Noise&lt;/b&gt;&lt;br /&gt;
— present irrespective of any external effects&lt;br /&gt;
— caused by thermal agitation of electrons&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-weight: bold;&quot;&gt;• White Noise&lt;/div&gt;&lt;b&gt;—&lt;/b&gt; random noise – entire spectrum&lt;br /&gt;
— listen:&lt;br /&gt;
• http://www.burninwave.com/download/whitenoise.wav&lt;br /&gt;
&lt;b&gt;• Pink Noise&lt;/b&gt;&lt;br /&gt;
— “realistic spectrum”&lt;br /&gt;
— the power spectral density is inversely proportional&lt;br /&gt;
to the frequency&lt;br /&gt;
— listen:&lt;br /&gt;
• http://www.burninwave.com/download/pinknoise.wav&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;REFERENCE:-)&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;h1&gt;CS 420/520&lt;/h1&gt;&lt;/span&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-style: italic; font-weight: bold; text-decoration: underline;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pakitgroup.blogspot.com/feeds/666058253672328795/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pakitgroup.blogspot.com/2011/10/attenuation-of-digital-signals.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/666058253672328795'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/666058253672328795'/><link rel='alternate' type='text/html' href='http://pakitgroup.blogspot.com/2011/10/attenuation-of-digital-signals.html' title='Attenuation of Digital Signals'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEju9GyudT6MzZSN85OobeXZed8QipqNOZ3DkMBvaSHIfrJP_feuULBjTU1-pUxrE4tagUW4t3jf8scIQOlTflDUJz6k5Sdn067h3qjfdbNlZZK2vz49tpBJUp2e3_J47SMuf5aF1EhyphenhyphenxUwr/s72-c/formula.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8156933787798242641.post-9079325317224075926</id><published>2011-10-26T23:43:00.000-07:00</published><updated>2011-10-26T23:43:18.807-07:00</updated><title type='text'>DATA COMMUNICATION   Terminology</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;b&gt;Simplex&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;—&lt;/b&gt; One direction&lt;br /&gt;
• e.g. Television&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Half duplex&lt;/b&gt;&lt;br /&gt;
— Either direction, but only one way at a time&lt;br /&gt;
• e.g. police radio&lt;br /&gt;
&lt;b&gt;• Full duplex&lt;/b&gt;&lt;br /&gt;
— Both directions at the same time&lt;br /&gt;
• e.g. telephone&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Frequency, Spectrum and&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Bandwidth&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Time domain concepts&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: magenta;&quot;&gt;Analog signal&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: magenta;&quot;&gt;• Varies in a smooth way over time&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: magenta;&quot;&gt;— Digital signal&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: magenta;&quot;&gt;• Maintains a constant level then changes to another constant&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: magenta;&quot;&gt;level&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: magenta;&quot;&gt;— Periodic signal&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: magenta;&quot;&gt;• Pattern repeated over time&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: magenta;&quot;&gt;— Aperiodic signal&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: magenta;&quot;&gt;• Pattern not repeated over time&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;b&gt;Analogue &amp;amp; Digital Signals&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhawK4ApgmhIsJNoJqMG03UqYub_DKULWNvF5ooIKrMBL9nq848j2v9S01MkMAtVNJBsHihoNVyQQboW1a17p26GK96FmjaSY8HdTyF3CxyLcUuDDMh4cRjqlb55yW1KGgc-dSlDX5QtO71/s1600/f12xx05.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;315&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhawK4ApgmhIsJNoJqMG03UqYub_DKULWNvF5ooIKrMBL9nq848j2v9S01MkMAtVNJBsHihoNVyQQboW1a17p26GK96FmjaSY8HdTyF3CxyLcUuDDMh4cRjqlb55yW1KGgc-dSlDX5QtO71/s320/f12xx05.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;color: red; font-weight: bold;&quot;&gt;Periodic&lt;/div&gt;&lt;div style=&quot;color: red; font-weight: bold;&quot;&gt;Signals&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; color: red; font-weight: bold; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNN3nbSCv_wF6TV-C1FwCOFU4ChR3skNvlVriSiziCJObSh222JxT-4T58k0rspQ9C8OoTMPKT523KlMZxV8xbuSTws5dKvO2X2yrr9sa9CnFjQlOe-5Ir1SPgM0PTdQLU01aAqgnkSc-U/s1600/400px-Waveforms.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;237&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNN3nbSCv_wF6TV-C1FwCOFU4ChR3skNvlVriSiziCJObSh222JxT-4T58k0rspQ9C8OoTMPKT523KlMZxV8xbuSTws5dKvO2X2yrr9sa9CnFjQlOe-5Ir1SPgM0PTdQLU01aAqgnkSc-U/s320/400px-Waveforms.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;color: red; font-weight: bold;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: red; font-weight: bold;&quot;&gt;&lt;u&gt;Frequency Domain Concepts&lt;/u&gt;&lt;/div&gt;&lt;div style=&quot;color: red; font-weight: bold;&quot;&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/div&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;Signal is usually made up of many frequencies&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;• Components are sine waves&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;• It can be shown (Fourier analysis) that any&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;signal is made up of component sine waves&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;• One can plot frequency domain functions&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bf9000;&quot;&gt;Data Rate and Bandwidth&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;• Any transmission system has a limited band of&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;frequencies&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;• This limits the data rate that can be carried&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Reference&amp;nbsp;:-&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;h1&gt;Data Communication&lt;/h1&gt;&lt;/span&gt;&lt;b&gt;&lt;div style=&quot;color: #cccccc;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: yellow;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: red; font-weight: bold;&quot;&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pakitgroup.blogspot.com/feeds/9079325317224075926/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pakitgroup.blogspot.com/2011/10/data-communication-terminology.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/9079325317224075926'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/9079325317224075926'/><link rel='alternate' type='text/html' href='http://pakitgroup.blogspot.com/2011/10/data-communication-terminology.html' title='DATA COMMUNICATION   Terminology'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhawK4ApgmhIsJNoJqMG03UqYub_DKULWNvF5ooIKrMBL9nq848j2v9S01MkMAtVNJBsHihoNVyQQboW1a17p26GK96FmjaSY8HdTyF3CxyLcUuDDMh4cRjqlb55yW1KGgc-dSlDX5QtO71/s72-c/f12xx05.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8156933787798242641.post-5031281753281949891</id><published>2011-10-26T23:24:00.000-07:00</published><updated>2011-10-26T23:24:46.952-07:00</updated><title type='text'></title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Simplified File Transfer&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Architecture:-&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;A Three Layer Model&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-weight: bold;&quot;&gt;1• Network Access Layer&lt;/div&gt;&lt;div style=&quot;font-weight: bold;&quot;&gt;2• Transport Layer&lt;/div&gt;&lt;div style=&quot;font-weight: bold;&quot;&gt;3• Application Layer&lt;/div&gt;&lt;div style=&quot;font-weight: bold;&quot;&gt;&lt;u&gt;Network Access Layer&lt;/u&gt;&lt;/div&gt;&lt;br /&gt;
• Exchange of data between the computer and&lt;br /&gt;
the network&lt;br /&gt;
• Sending computer provides address of&lt;br /&gt;
destination&lt;br /&gt;
• May invoke levels of service&lt;br /&gt;
• Dependent on type of network used (LAN,&lt;br /&gt;
packet switched etc.)&lt;br /&gt;
&lt;u&gt;&lt;b&gt;Transport Layer&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
• Reliable data exchange&lt;br /&gt;
• Independent of network being used&lt;br /&gt;
• Independent of application&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;u&gt;Application Layer&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;font-style: italic; text-decoration: underline;&quot;&gt;•&lt;/b&gt; Support for different user applications&lt;br /&gt;
• e.g. e-mail, file transfer&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: orange;&quot;&gt;&lt;b&gt;&lt;u&gt;Protocol Architectures and&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: orange;&quot;&gt;&lt;b&gt;&lt;u&gt;Networks&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;Addressing Requirements&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
• Two levels of addressing required&lt;br /&gt;
• Each computer needs unique network address&lt;br /&gt;
• Each application on a (multi-tasking) computer&lt;br /&gt;
needs a unique address within the computer&lt;br /&gt;
— The service access point or SAP&lt;br /&gt;
— The port on TCP/IP stacks&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;OSI Layers&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
•&lt;b&gt;&lt;u&gt; Network&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
— Transport of information&lt;br /&gt;
— Higher layers do not need to know about underlying technology&lt;br /&gt;
— Not needed on direct links&lt;br /&gt;
&lt;b&gt;&lt;u&gt;• Transport&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
— Exchange of data between end systems&lt;br /&gt;
— Error free&lt;br /&gt;
— In sequence&lt;br /&gt;
— No losses&lt;br /&gt;
— No duplicates&lt;br /&gt;
— Quality of service&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-weight: bold; text-decoration: underline;&quot;&gt;• Session&lt;/div&gt;— Control of dialogues between applications&lt;br /&gt;
— Dialogue discipline&lt;br /&gt;
— Grouping&lt;br /&gt;
— Recovery&lt;br /&gt;
&lt;div style=&quot;font-weight: bold; text-decoration: underline;&quot;&gt;• Presentation&lt;/div&gt;— Data formats and coding&lt;br /&gt;
— Data compression&lt;br /&gt;
— Encryption&lt;br /&gt;
•&lt;b&gt;&lt;u&gt; Application&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
— Means for applications to access OSI environment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;• Physical&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
— Physical interface between devices&lt;br /&gt;
• Mechanical&lt;br /&gt;
• Electrical&lt;br /&gt;
• Functional&lt;br /&gt;
• Procedural&lt;br /&gt;
&lt;b&gt;&lt;u&gt;• Data Link&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
— Means of activating, maintaining and deactivating a&lt;br /&gt;
reliable link&lt;br /&gt;
— Error detection and control&lt;br /&gt;
— Higher layers may assume error free transmission&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pakitgroup.blogspot.com/feeds/5031281753281949891/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pakitgroup.blogspot.com/2011/10/simplified-file-transfer-architecture.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/5031281753281949891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8156933787798242641/posts/default/5031281753281949891'/><link rel='alternate' type='text/html' href='http://pakitgroup.blogspot.com/2011/10/simplified-file-transfer-architecture.html' title=''/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>