- Coupling
- among classes
- among subsystems, modules
- related classes knowing the internal details of each other
- when one is changed, other has to be changed
- makes the system difficult to understand
- no possibility of reuse of the entwined code
- Cohesion
- inside the class, among the class attributes and behavior
- well defined roles for the classes within the system
- the data is closely related with the functions which the class is providing
- Law of Demeter (more specific case of "low coupling", LoD)
- motto is "only talk to your immediate friends"
- each unit should have only limited knowledge about other units "closely" related to the current unit (method/function "f")
- in context of OOD, closely related
- are the functions of the class in which unit (function "f") exists
- other argument classes of unit (function "f")
- functions of immediate part classes (computed and stored) of class of unit (function "f")
- computed classes are the classes that are the return type of functions of this class
- stored classes are the classes of the data members of this class
- basic functions of SIP (HTTP like request/response transaction model)
- Location of an endpoint
- signal of a desire to communicate
- negotiation of session parameters for the session
- teardown of session once established
- Request handling in SIP is often classified as either INVITE or non-INVITE (an ACK is only sent in response to a response for an INVITE request,INVITE/200/ACK)
- SIP messages are text-encoded
INVITE message example, with header fields (minimum required set)
- INVITE sip:bob@biloxi.com SIP/2.0
- Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds
- Max-Forwards: 70
- To: Bob <sip:bob@biloxi.com>
- From: Alice <sip:alice@atlanta.com>;tag=1928301774
- Call-ID: a84b4c76e66710@pc33.atlanta.com
- CSeq: 314159 INVITE
- Contact: <sip:alice@pc33.atlanta.com>
- Content-Type: application/sdp
- Content-Length: 142
- (*ptoStruct).member; is same as ptoStruct->member
- char name[40] = “mithun”, allocate 40 bytes on static memory block, and occupy the first 7 bytes (6 + ‘\0’), and “name” is a array constant, un modifiable lvalue
- char name[] = “mithun” , count number of chars, allocate memory for count+1 on static memory block, and “name” is a array constant un modifiable lvalue
- char* name = “mithun” , allocate the memory for number of characters + 1 for nul, and also 4 bytes for the pointer variable “name”, and “name” is a variable
- in the array notation name is the address of the first element i.e. &name[0], and will always point to the same location (a constant).
- An application layer control protocol (works with both IPv4 and IPv6), that can
- establish modify and terminate multimedia sessions (conferences), such as IP telephony calls
- invite participants to existing sessions (like multicast conferences)
- existing sessions can be modified by adding/removing media from an existing session
- transparently supports name mapping and redirection services (support to personal mobility)
- a single externally visible ID can be maintained regardless of the network location (SIP URI)
Symptoms
- difficult to change
- every change cascades changes in other dependent modules
- software break in many places, with every change
- inability to reuse from other projects or from the same project
- design preserving changes are harder than hacks
Causes
- changing requirements
- improper dependencies between the modules
UNIX process
process is a running instance of a program,identified with "pid"
process consist of
- allocated system resources
- a section of memory
- security attributes (like its owner and set of permissions)
- the process state(running,blocked,waiting)
- process can also be called as execution context of a running program in the current time slice, which is given by the OS as part of scheduling the processes running in the CPU
- process can also be defined in terms of data structure which stores the information about the process
- new process is created by "fork" command in Unix
- program is an executable file in binary format that can be read by the CPU, and process is a program in action (execution)
process control system provides services for
- process scheduling, giving cpu time(divided into time slice) to each process, context switch(when time slice ends or the process waiting for a resource) from one process to other when execution context changes
- context is the contents of the CPU register and the program counter
- when context switch occur
- when scheduling multiple tasks(from one process or thread to another), handling the hardware interrupt,user and kernel mode switching
Unix filesystem
- Unix has only files (directory,special file or device file) and processes
- Tree like structure (hierarchy)
- root node topmost (only one root)
- all data in files is a stream of bytes, for the kernel
- files dynamically grow
Internal View
- made up of blocks (eg 512 or 1024 bytes blocks)
- block 0 is boot block (used for booting)
- block 1 is super block (store info about file system, like type,free and used space)
- then comes the i-list blocks (contains the i-node blocks for all the files in the system)
- then comes the data block (storing the actual data)