Monday, June 1, 2009

Exercise # 24

Virtual Business Worlds and Cyberagents:

There are several sites which makes use of "Software Agents" for business. One example of such a site is "http://ebay.com". At the bottom of the page for the transaction of the product, there are always suggestions of the other products which some other customers have also bought and which are similar to the one, the customer had looked at or bought.

1: There are different types of software agents.Some examples are as under:

i: Cooperative agents: They communicate with other agents and act according to the results of that communication.
ii: Proactive agents: These agents initiate actions without user prompting.
iii: Adaptive agents: These agents learn from past, change, how they behave in given situation.
iv: Personal agents: They are proactive and serve individual users.
v: Collaborative agents: These agents are proactive and cooperate with other agents. 1

2: There are many software agents in action which make use of Artificial Intelligence in their operation. Artificial Intelligence Agent is defined as an agent which has got some intelligence, e.g. autonomous programs used for operator assistance programs or data mining are also "intelligent Agents". There are other ways as well where AI is used in software agents. Some examples are:
i: Simple reflex agents: They function on the "condition-action" rule, if condition then action rule.
ii: Model-based reflex agents: This agent keeps track of the current state of the world using an internal model. It then chooses an action in the same way as the reflex agent.
There are other examples as well:
a: Goal based agents
b: Utility based agents.
c: Learning agents.
d: Decision agents.
e: Input Agents.
f: Processing Agents etc. 2

Statistical techniques are being used to develop software agents which can take certain decision on the basis of data analysis available to them. There is research and to some extent success in building software agents with natural language capabilities. These take decisions on the analysis of data put to them through natural language and then reacting in natural language as well. They are also being developed to balance a network's throughput.

3: Software agents are being used in various activities in e-commerce. They are used to offer customers relative products to their searches like e-bay, amazon and many other websites do. These are also used to collect data from the customer of a website or visitors to analyse their behaviours of purchases or searches and to offer them more relevant products in future.

References:

1: Intelligent software agents-an overview accessed on May 28, 2009 at http://www.peterindia.net/SoftwareAgentsView.html
2: Intelligent agents accessed May 28, 2009 at http://en.wikipedia.org/wiki/Intelligent_agent.


Exercise # 23

Searching Mechanisms

1: Spider:

A web spider is a computer program that browses the worldwide web in a methodical automated manner. Other terms for web spider are ants, automatic indexers, bots, and worms or web crawlers, web robots etc. Many sites, especially search engines like Google, Yahoo, Livesearch etc use spidering as a means of providing up to date data. 1

2: Metasearch Engine:

A metasearch engine queries several search engines simultaneously (such as Google, Yahoo, MSN etc) and displays the relevant results from the various search engines all on one page.
Following are some examples of meta search engines:

i: http://www.mamma.com
ii: http://www.scour.com
iii: http://www.digforit.com
iv: http://www.kartoo.com
v: http://www.surfwax.com

3: Search engine Optimization:

There are different ways getting one's website listed on the major search engines like Google, MSN, Yahoo etc. There are three ways of getting listed as well as paid methods. With Goolge, getting a free listing is a bit tricky. One need to have links form other sites to their site so that crawler of the search engine lists the site. The same is the case with Yahoo. But Yahoo has also got a free form for listing a website in its search results. MSN uses its own MSN BOT to crawl the web and will include a website if it has links through other websites. In order to improve ranking of a website, one needs to be extra sensitive and detailed to the content of the website. Secondly, meta tags are very important because the search engine robots look for those meta tags. So, put them on every page for some search engines. Always use heading tags, bolding and Italicizing in the content, but don't overdo it. Try to get good sites linking to your website. The more links you can get, the higher ranking will be achieved in major search engines. Search engines can't read images so use "alt" text descriptive in your code. These are some important strategies to improve ranking on any search engine. 2

References:

1: Web crawler, accessed on May 28, 2009 at http://en.wikipedia.org/wiki/web-spider.
2: Search engine optimization and submission strategies-a beginner's guide, accessed on May 28, 2009 at http://www.tamingthebeast.net/articles2/search-engine-optimization.htm

Exercise # 22

Differentiation between CRM, B2B e-commerce programmes and Supply Chain Management (SCM) Software:

CRM software help organizations implement effective customer relationship management. CRM itself is not a software application, but is instead a strategy for doing business. CRM methodologies are focused on building individual customer relationships for the purpose of creating and maintaining a loyal customer base. CRM software woks across all corporate departments to help harmonise customer-centric thinking in the entire organization. This interdepartmental cooperation also reduces cost, increase efficiency, and improves customer satisfaction. 1
B2B (Business to Business) describes any business that sells products or provides to another business. B2B software enables companies to manage the integration and automation of business processes with key suppliers-partners, and customers via the internet. 2
And, Lastly, Supply Chain Management Software (SCMS) is a business term which refers to a range of software tools or modules used in executing supply chain transactions, managing supplier relationships and controlling associated business processes. While functionality in such systems can be broad-it commonly includes:
1: Customer requirement processing.
2: Purchase order processing.
3: Inventory Management.
4: Goods receipt and warehouse management.
5: Supplier management/sourcing. 3

References:

1: What is CRM Software? Accessed May 28, 2009 at http://www.tech-faq.com/crm-software.shtml
2: B2B-Business to Business integration Software, accessed May 28, 2009, at http://www.iwaysoftware.com/b2b-business-to-business-software.html
3: Supply Chain Management Software accessed May 28, 2009 at http://en.wikipedia.org/wiki/Supply_chain_management_software

Exercise # 21

Shopping Cart Specification

Exercise # 20

(1): Use Case Diagrams in UML:

UML uses the case diagrams to overview the requirements for the system. They are useful for presentation to management and/or Project stakeholders. Use case diagram depict:
i: Use cases=a use case describes a sequence of actions that provides something of measurable value to an actor and is drawn as a horizontal ellipse.
ii: Actors= an actor is a person, organization or external system that plays a role in one or more interactions with your system. Actors are drawn as stick figures.
iii: Associations= associations between actors and use cases are drawn by solid lines.
iv: System boundary boxes= A rectangle can be drawn around the use cases called the system boundary box, to indicate the scope of the system.
v: Packages= Packages are UML constructs that enable to organize model elements (such as use cases) into groups. 1






(2): Class Diagrams in UML:

Class diagrams are widely used to describe the type of objects in a system and their relationships. Class diagrams model class structure and contents using design elements such as classes, packages and objects. Class diagrams describe three different perspectives when designing a system, conceptual, specification and implementation. Classes are composed of three things: a name, attributes and operations.



Class diagrams also display relationships such as containment, inheritance, associations and others



Another relationship in class diagram is generalization. A generalization is used when two classes are similar, but have some differences. 2



(3): Sequence Diagrams in UML:

A sequence diagram is made up of objects and messages. Objects are represented exactly as rectangles with the underlined class name within the rectangle.. The primary element involved in a sequence diagram is an object-instance of a class A sequence diagram consists of sequences of interaction among different objects over a period of time. The other object in sequence diagram is represented as message. A message is denoted by a directed arrow. 3



(4): Collaboration Diagrams in UML:

The elements of a collaboration (Communication Diagram in UML 2.0) are essentially the same as that of a sequence diagram. A sophisticated modelling tool can easily convert a collaboration diagram into sequence diagram and vice versa. There are following elements in the collaboration diagram:
i: Objects: Objects interact with each other in the system. Depicted by a rectangle with the name of the object in it preceded by a colon and underlined.
ii: Relation/Association: A link connecting the associating objects.
iii: Messages: An arrow pointing from the commencing object to the destination object shows the interaction between the objects. 4



(5): State Chart Diagrams in UML:

A UML state chart diagrams depict the various states that a class can be in and the transaction between those states. Not each class can have state chart diagrams but only classes with three or more potential states can be modelled. 5



(6): Activity Diagrams in UML:
Activity diagrams represent the business and operational workflow of a system. An activity diagram is a dynamic diagram that shows the activity and the event that causes the object to eb in the particular state. An activity diagram consists of the following behavioural elements.
i: Initial activity.
ii: Activity.
iii: Decisions.
iv: Signal.
v: Concurrent activities.
vi: Final activity. 6



(7): Component Diagrams in UML:

The main purpose of component diagram is to show the structural relationships between the components of a system. Component diagrams offer system architect a natural format to begin medalling a solution. Component diagrams allow an architect to verify that a syatem's functionality is being implemented by components. In addition, component diagrams are useful communication tool for presentation to key project stakeholders. 7




(8): Deployment Diagrams in UML:

The deployment diagram shows how a system will be physically deployed in the hardware environment. Its purpose is to show where the different components of the system will physically run and how they will communicate with each other. 8
A deployment diagram consists of the following elements:
i: Node=The element that provides the execution environment for the components of the system. They are depicted by the queue with the name of the object in it, preceded by a colon and an underline.
ii: Connection= They define the interconnection between the nodes e.g. arrows and lines. 9




References:

1: UML 2 case diagrams accessed on May 28, 2009 at http://www.agilemodeling.com/artifacts/useCaseDiagrams.htm
2: Class diagrams, accessed on May 28, 2009 from http://atlas.kennesaw.edu/~dbraun/csis4650/A&B/UML_tutorial/class.htm
3: http://www.developer.com/design/article.php/3080941
4: Collaboration diagrams in UML, accessed on May 28, 2009 from http://developer.com/design/article.php/10925_3102981
5: UML basics an introduction to the unified modelling language_state chart diagram accessed on May 28, 2009 from http://www.ibm.com/developerworks/rational/library/769.html
6: Activity diagram in UML accessed on May 28, 2009 at http://www.developer.com/design/article/php/10925_2247041
7: UML basics-componet diagram, accessed on May 28, 2009 at http://www.ibm.com/developerworks/rational/library/dec04/bell/
8: UML basics: an introduction to the unified modelling language, accessed May 28, 2009 at http://www.ibm.com/developerworks/rational/library/769.html
9: Deploment diagram in UML, accessed on May 28, 2009 at http://www.developer.com/design/article.php/3291941

Exercise # 19

TP Monitors and Transaction Protocols

(1): ACID Properties of a Transaction:

ACID is an acronym for a set of properties of a transaction. This set of properties is Atomicity, consistency, Isolation and Durability. These ACID properties guarantee that a transaction is completed reliably. Atomicity in this regard makes sure that modification of the databaseduring a transaction is as whole of DBMS and none of it. Consistency refers to the fact that only valid data is written in database otherwise all of the transaction will be rolled back and database will be restored to a consistent state. Isolation is responsible to make sure that multiple transactions do not impact eachother. Durability is the characteristic which makes the transaction permanent and is not lost because of any failure of software and hardware.

(2): TP Monitor:

TP Monitor is a control program that manages the transfer of data between multiple local and remote terminals and application programs that serve them. It may also include programs that format the terminal screens and validate the data entered. TP Monitor stand for teleprocessing monitor or transaction processing monitor. 1
It prevents an operating system from overwhelming. TP Monitor through following steps used to balance the load between the clients and various application servers and database servers. It can be placed on a separate machine. TP Monitor load balances in a system by forwarding a transaction to any of the several servers.

(3): Load Balancing Differences Between MOM, RPC, Conversations:

MOM stands for Message Oriented Middleware. MOM load balances by supporting client/server. Processes using asynchronous, peer to peer messages. A MOM does not require continuous active communication between the client and the server. A client sends the message and does not wait for a response. If a server is busy or unavailable, received messages Wait in a queue until they are satisfied. MOM solutions are well suited for events driven and object oriented applications. 2
In traditional MOM, the request by the calling object and the response from the receiving object based middleware. In contrast transactional messaging used are process for sending the message and a separate process for receiving a response to the message. 3
RPC stands for Remote Procedure Cell. It supports synchronous, call/wait process to process communications. In using RPC a client requests a service and then waits for a response. As a result, an RPC requires continuous, active participation form the server and the client. Each RRC request is a synchronous interaction between exactly one client and one server. This is called Request-Response Messaging (RRC). In a synchronous RPC, the system is almost the same except that a synchronous uses two calls to complete the request response as oppose to two messages in request response RPC. 4

(4): Two-Phase Commit Protocol vs One-Phase Atomic Commit Protocol:

The two phase commit protocol is better from one phase atomic commit protocol in that. two phase protocol allows all nodes in a distributed system to agree to commit to a transaction. two phase CP results in either all nodes committing the transaction or aborting, even if the network or node fails. in one phase Atomic Commit Protocol, No one server can decide to abort a transaction will fail if one server discovers a deadlock or it is crashed. 5
References:
1: TP Monitor, accessed by me on May 208, 2009 at http://www.pcmag.com/encyclopedia_term/o_2542_t=TP+monitor&i=53022,00.asp
2: The internet encyclopedia-volume 1, Hossein Bidgoli, John Wiley & sons, November 2003, Page 198.
3 & 4: Business Process Management-Strategy and Implementation, James F.Chang, Auerbach Publications, 2006, Page 89 & 92.
5: http://www.cse.chalmers.se/edu/course/TDA297/2008/slides/DistributedTransactions-Lec5.ppt

Exercise # 18

Threading Demonstration in Python

My understanding of this code and output is as follows. This code runs different tasks. These tasks are kept tacked with the variable "running" which starts from 1 to 9. At one time only 3 tasks run concurrently which are managed by the "Semaphore" with the value of 3. Mutex is responsible for creating a buffer so that there is no deadlock during execution of the code. The time function makes a task run for a certain length of time and then the next task start executing. So in this code, all 10 tasks complete one after the other