Friday, April 14, 2023

What is software?

Software, on the other hand, refers to the non-physical instructions and programs that tell the computer hardware what to do. Software is intangible and cannot be touched or seen. Examples of software include operating systems, word processors, web browsers, and video editing programs. Software is designed to perform specific tasks and provides instructions to the hardware on how to accomplish them. Without software, the hardware of a computer would be useless.

What is called hardware?

Hardware refers to the physical components of a computer system that can be touched, seen and interacted with. This includes devices such as the central processing unit (CPU), memory, hard drive, monitor, keyboard, mouse, printer, and other peripheral devices. Hardware components work together to enable the computer to perform various tasks and execute software programs

Block diagram of computer

┌─────────────┐      ┌──────────────┐
│ Input Devices ─────►│ Central       │
│ (Keyboard,    │      │ Processing    │
│ Mouse, etc.)  │      │ Unit (CPU)    │
└─────────────┘      └──────────────┘
                        │ Memory    │ROM
                        │ (RAM)     │
                        │ Output    │
                        │ Devices   │
                        │ (Monitor, │
                        │ Printer,  │
                        │ etc.)     │

The input devices, such as the keyboard and mouse, allow users to interact with the computer and provide it with data and instructions. This input is then processed by the central processing unit (CPU), which performs calculations, executes programs, and manages the flow of data within the computer.

The CPU communicates with memory, which temporarily stores data and instructions that the CPU needs to access quickly. This memory is typically volatile, meaning that it loses its contents when the computer is turned off.

Finally, the output devices, such as the monitor and printer, allow the computer to communicate with the user by displaying information or producing physical output.

Wednesday, March 28, 2007

Collection framework in Java

  • Group of objects are handled using collection framework.
  • It allows different type of collections (dynamic arryas, Linked List, Trees and hash tables) to work in a similar manner with interoperability.
  • Some partial implementations are provided to create own collection.
  • Several implementations (such as LinkedList, HashSet and TreeSet) are provided to use.
  • Mechanisms were added that allow the integration of standard arrays into the collection framework.

  • A interface Iterator is created by collection framework which provides a means of enumerating the contents of collection.
  • Since each collection implements Iterator, the elements of collection class can be accessed through the methods defined by Iterator.
  • In addition to collections, the framework defines several Map interfaces and classes.
  • Maps store key/value pairs.
  • Maps are not collection but a collection-view of a map can be obtained and thus contents of a map can be accessed as collection.

The collection framework defines following Interfaces:

  1. Collection Top of the collection hierarchy.
  2. List Extends Collection to handle sequnces (lists of objects)
  3. Set Extends Collection to handle sets (contain unique elements)
  4. SortedSet Extends Set to handle sorted sets.
  • Collections that supports the methods which enable to modify the contents of it are called modifiable otherwise unmodifiable.
  • If such method is applied to unmodifiable collection, an UnsupportedOperationException is thrown.
  • All the build-in collections are modifiable.
  • If a collection can't be modified then UnsupportedOperationException is thrown and a ClassCastException is generated when one object is incompatible object to a collection.

Friday, November 03, 2006

Client Server System

Client/server describes the relationship between two computer programs in which one program, the client, makes a service request from another program, the server, which fulfills the request. Although the client/server idea can be used by programs within a single computer, it is a more important idea in a network. In a network, the client/server model provides a convenient way to interconnect programs that are distributed efficiently across different locations. Computer transactions using the client/server model are very common. For example, to check your bank account from your computer, a client program in your computer forwards your request to a server program at the bank. That program may in turn forward the request to its own client program that sends a request to a database server at another bank computer to retrieve your account balance. The balance is returned back to the bank data client, which in turn serves it back to the client in your personal computer, which displays the information for you.
The client/server model has become one of the central ideas of network computing. Most business applications being written today use the client/server model. So does the Internet's main program, TCP/IP. In marketing, the term has been used to distinguish distributed computing by smaller dispersed computers from the "monolithic" centralized computing of mainframe computers. But this distinction has largely disappeared as mainframes and their applications have also turned to the client/server model and become part of network computing.
In the usual client/server model, one server, sometimes called a daemon, is activated and awaits client requests. Typically, multiple client programs share the services of a common server program. Both client programs and server programs are often part of a larger program or application. Relative to the Internet, your Web browser is a client program that requests services (the sending of Web pages or files) from a Web server (which technically is called a Hypertext Transport Protocol or HTTP server) in another computer somewhere on the Internet. Similarly, your computer with TCP/IP installed allows you to make client requests for files from File Transfer Protocol (FTP) servers in other computers on the Internet. Other program relationship models included master/slave, with one program being in charge of all other programs, and peer-to-peer, with either of two programs able to initiate a transaction.