Showing posts with label .Net Question And Answer. Show all posts
Showing posts with label .Net Question And Answer. Show all posts

Wednesday, June 20, 2012

Describe the difference between Interface-oriented Object-oriented and Aspect-oriented programming?


(Excerpt from FrazzledDad blog @ http://frazzleddad.blogspot.com)


Aspect-Oriented


Aspect-oriented programming looks at how many components or pieces of a system might need to interact. The intersections of these pieces are what are important in AOP. "Crosscutting" is a slice across several units, all of which interact during some operation. The article Discussing aspects of AOP in Communications of the ACM, Volume 44, Number 10 (2001) shows an example of a drawing editor with point and line elements. If the drawing is moved, both point and line elements need to update. A crosscut hits these elements for this event. Other examples might include logging or exception handling which hit several different layers in a system. (Viji Sarathy, Aspect Orienting .NET Components )


Interface-Oriented


Interface-oriented programming is a contract-based approach. Nether side of the interface cares how the other does its work, only that the two sides can communicate via an agreed-upon contract. WSDL-based web services are the prime example of this.


Object-Oriented


Object-Oriented programming is based on abstraction, encapsulation (data hiding), polymorphism and inheritance. Classes implement these concepts to build objects controlling or implementing a system.


Abstraction allows loose coupling between components by providing a layer between objects so that one object isn't concerned with how the other implements its business rules. (Interfaces, layers) Great stuff when you want to isolate parts of the system so they can be swapped out without killing the rest of the sytsem.


Encapsulation allows abstraction to work by hiding details of a class's implementation from calling classes. (Public vs. private fields)


Inheritance enables base (parent) classes to have common functionality defined in it and passed down to child classes. A Shape class might have a field for color which is inherited by child classes of Square or Circle type.


Polymorphism enables implementation of same-named public fields, allowing different classes to perform different actions on the same call - rendering a Square or Circle object differently in a graphic program, even though they might both be subclassed from a base Shape class. (Overriding)

Describe the difference between a Thread and a Process?


Process
Each process provides the resources needed to execute a program. A process has a virtual address space, executable code, open handles to system objects, a security context, a unique process identifier, environment variables, a priority class, minimum and maximum working set sizes, and at least one thread of execution. Each process is started with a single thread, often called the primary thread, but can create additional threads from any of its threads.
Thread
A thread is the entity within a process that can be scheduled for execution. All threads of a process share its virtual address space and system resources. In addition, each thread maintains exception handlers, a scheduling priority, thread local storage, a unique thread identifier, and a set of structures the system will use to save the thread context until it is scheduled. The thread context includes the thread's set of machine registers, the kernel stack, a thread environment block, and a user stack in the address space of the thread's process. Threads can also have their own security context, which can be used for impersonating clients

How does a 3 tier application differ from a 2 tier one

alt text

5 Strategies for Getting More Work Done in Less Time

Summary.    You’ve got more to do than could possibly get done with your current work style. You’ve prioritized. You’ve planned. You’ve dele...