Friday, February 19, 2010

11 Little-Known Ways to Advance Your Career

The employment situation today has workers feeling a little uneasy.

As the unemployment rate soared to 8.5 percent in March -- its highest rate since 1983 -- and the number of unemployed people increased to 13.2 million, according to the Bureau of Labor Statistics, the lucky people who are still employed are probably looking for a little job security.

Although nothing guarantees that your job is 100 percent secure, it doesn't hurt to implement "the little things" to increase your visibility and help you advance professionally.

Here are 11 simple, yet often overlooked, ways to advance your career in tough economic times:

1. Request the help of well-known professionals in your community
When she was starting out, Karen Fuqua, president of Fuqua Consulting Group, she wrote to the top 50 business women listed in Fortune magazine and asked if they would be willing to mentor a new professional; if not, did they have any advice?

"I had no idea what I would get back. The letters I received were fabulous," Fuqua recalls. "Top C-level women wrote back to me with encouragement, tips and advice as to what to do and not to do as a woman in business. It was easy to do and surprisingly effective."

2. Learn your work products
Try to get quality examples of the products your bosses are working on so that you know what quality output is, says Sean Ebner, regional vice president for Technisource, an IT recruiting and solutions company. When your boss gets sick or goes on vacation, volunteer to create the work product. This will help your boss and distinguish you above your peers.

3. Volunteer for the little things
Volunteer for a prominent role in community outreach activities, Ebner suggests. By doing so, you are more likely to get exposure to senior management.

Ebner gives the example of an old co-worker who had not done particularly well in college. His academics barred him from joining the firm as a consultant, so he joined the HR group in an administrative role.

"This gentleman gold plated everything that was asked of him and sought ways to help the office managing partner with personal items such as remembering birthdays and getting things for his wife," he says. "After about a year, this person was elevated to the consulting practice at a level higher than he would have entered directly from college. It was the relationships he had fostered and the focus on the little details of what he did that made the difference."

4. Stay on top of your industry
"Attend industry-related conferences or network with people in your industry online. Also, keep interacting with potential clients that aren't necessarily in your arena -- they may lead to a big sale in the future," says Kristen Fischer, author of "Ramen Noodles, Rent and Résumés." "You never know where a contact will take you."

5. Hone your public speaking and presentation skills
Most people hate any form of public speaking but it is one of the most potent publicity and marketing vehicles available to you, says Laurent Duperval, president of Duperval Consulting.

"Volunteer for any and every speaking opportunity that presents itself. You will be seen as a knowledgeable and competent individual," he says. "Since you are most likely the most visible person to boot, your name will be first on the list when promotion time comes around."

6. Be nice
It seems obvious, but in a marketplace where jobs are scarce and uncertainty is rampant, nerves get frayed easily, Duperval says.

"Step above the heap and be nice to people around you, especially when things go bad. In pressure situations, those who can keep their cool, their calm and still keep on smiling and laughing stand out," he says. "Those are the qualities you want in your leaders."

7. State your opinion even if it goes against the crowd
Be logical and strategic about stating your opinion. The idea is not to be against every idea or suggestion offered by other employees, Duperval says.

"If you feel strongly against an issue, learn to present and argue the facts compellingly. Doing so logically, while appealing to everyone's self-interest as well as the best interests of the company, is an uncommon skill, one that has tremendous value for any corporation."

8. Befriend your company's PR person
By getting quoted in articles or appearing on air as an "expert source," you are attracting attention to your firm and yourself, says Sammie Becker, CEO and founder of TigressPR.

"Volunteer to be speaker at a conference, an industry panel or even webinar," she says. "Something that your new best friend -- the public relations person -- can help you do or navigate."

9. Know the company
Study the company, the way it does business and its products, regardless of whether the information is relevant to your job or not, says Judi Perkins, a career coach.

"Know the trends in your industry and what your competitors are doing. For a VP, this is expected. For a customer service person, this sets you apart and marks you as someone to watch."

10. Notice other people's efforts
If your company has a newsletter, read it. Give kudos to people whether you know them or not, Perkins says. Don't forget to say thank you to those who offer their assistance to you in any way.


11. Get to know your boss, but don't curry favor
Know what the boss values in his staff. If he wants people to think through a problem before coming for help with a solution, don't go running to his office at the first hint of difficulty, Perkins says.

7 Signs That Your Job Could Be in Jeopardy

Recent economic news is enough to make even the most assured professional feel unsettled about his or her job. It's only natural to question your own career prospects when confronted with headlines about the rising unemployment rate and companies' plans to reduce staff levels in the coming year.

While it does no good to worry unnecessarily, there are ways to determine if your role is in real danger. Following are seven possible signs:

1. Your workload becomes much lighter. If you've noticed a considerable drop in the amount of work you've been assigned, or you just finished a large project and nothing else appears to be coming your way, there could be cause for concern. A dwindling workload may indicate reduced business and, consequently, less need for your services. Similarly, if you're not being included in key projects that you were in the past -- or tasks you typically handle are being assigned to others -- there's a chance your position may be eliminated.

2. Your work is cyclical in nature. Companies that are looking to trim personnel expenses often focus on departments or positions in which the work is cyclical, and the day-to-day workload could be supported with fewer people.

3. Your position isn't viewed as a revenue-generator. When budgets are reduced, priority is given to employees who are inextricably attached to profit-producing projects. How pivotal is your role in generating revenue or reducing expenses? If you contribute directly to these efforts, you may be in a fairly safe position. If, on the other hand, your role is viewed more as a "nice to have" than "need to have," you could be on shakier ground.

4. You're not being kept in the loop. This is one of the biggest signs that your job is in jeopardy. If you discover decisions about your immediate work activities or projects are being made without you, you have cause for concern.

5. Corporate belt-tightening. A sharp change in the company's attitude toward basic expenses could be a tip-off that personnel levels also are being considered. Implementing one or two cost-cutting measures might simply be good fiscal policy, but several can signal more widespread cutbacks. It's important to note, however, that many companies that are belt-tightening aren't necessarily looking to reduce head count. They may be taking these steps to avoid letting people go.

6. You're being asked to document everything. When management shows an increased interest in the status of your projects and the procedures for completing them, it could be because they want to get a better sense of how things are done and what still requires attention should your tasks need to be reassigned.

7. Your sector is struggling. If your company competes in an industry that is experiencing a down cycle, layoffs may be inevitable. If your firm is affected significantly, it may reduce the size of its work force to deal with the economic realities it faces.

Spotting one or two of these signs may not be cause for alarm. In fact, it could be a signal that you need to step up your game. If you enjoy your job and want to stay, continue to focus on producing high-quality work and demonstrating your value to the organization.

That said, it never hurts to have a backup plan just in case you find yourself suddenly in the job market. Make sure your résumé is up-to-date and reconnect with members of your professional network. Also consider enlisting the help of a recruiter who specializes in your industry. These professionals can provide you with valuable career advice and, because of their deep networks within the local business community, can alert you to promising employment opportunities. Layoffs can sometimes occur with little warning, and the more prepared you are for a job search, the more quickly you'll be back on your feet and working again.

C# Interview Questions

This is a list of questions I have gathered from other sources and created myself over a period of time from my experience, many of which I felt where incomplete or simply wrong. I have finally taken the time to go through each question and correct them to the best of my ability. However, please feel free to post feedback to challenge, improve, or suggest new questions. I want to thank those of you that have contributed quality questions and corrections thus far.
There are some question in this list that I do not consider to be good questions for an interview. However, they do exist on other lists available on the Internet so I felt compelled to keep them easy access.
General Questions
1. Does C# support multiple-inheritance?
No.

2. Who is a protected class-level variable available to?
It is available to any sub-class (a class inheriting this class).

3. Are private class-level variables inherited?
Yes, but they are not accessible. Although they are not visible or accessible via the class interface, they are inherited.

4. Describe the accessibility modifier “protected internal”.
It is available to classes that are within the same assembly and derived from the specified base class.

5. What’s the top .NET class that everything is derived from?
System.Object.

6. What does the term immutable mean?
The data value may not be changed. Note: The variable value may be changed, but the original immutable data value was discarded and a new data value was created in memory.

7. What’s the difference between System.String and System.Text.StringBuilder classes?
System.String is immutable. System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed.

8. What’s the advantage of using System.Text.StringBuilder over System.String?
StringBuilder is more efficient in cases where there is a large amount of string manipulation. Strings are immutable, so each time a string is changed, a new instance in memory is created.

9. Can you store multiple data types in System.Array?
No.

10. What’s the difference between the System.Array.CopyTo() and System.Array.Clone()?
The Clone() method returns a new array (a shallow copy) object containing all the elements in the original array. The CopyTo() method copies the elements into another existing array. Both perform a shallow copy. A shallow copy means the contents (each array element) contains references to the same object as the elements in the original array. A deep copy (which neither of these methods performs) would create a new instance of each element's object, resulting in a different, yet identacle object.

11. How can you sort the elements of the array in descending order?
By calling Sort() and then Reverse() methods.

12. What’s the .NET collection class that allows an element to be accessed using a unique key?
HashTable.

13. What class is underneath the SortedList class?
A sorted HashTable.

14. Will the finally block get executed if an exception has not occurred?¬
Yes.

15. What’s the C# syntax to catch any possible exception?
A catch block that catches the exception of type System.Exception. You can also omit the parameter data type in this case and just write catch {}.

16. Can multiple catch blocks be executed for a single try statement?
No. Once the proper catch block processed, control is transferred to the finally block (if there are any).

17. Explain the three services model commonly know as a three-tier application.
Presentation (UI), Business (logic and underlying code) and Data (from storage or other sources).

Class Questions
1. What is the syntax to inherit from a class in C#?
Place a colon and then the name of the base class.
Example: class MyNewClass : MyBaseClass

2. Can you prevent your class from being inherited by another class?
Yes. The keyword “sealed” will prevent the class from being inherited.

3. Can you allow a class to be inherited, but prevent the method from being over-ridden?
Yes. Just leave the class public and make the method sealed.

4. What’s an abstract class?
A class that cannot be instantiated. An abstract class is a class that must be inherited and have the methods overridden. An abstract class is essentially a blueprint for a class without any implementation.

5. When do you absolutely have to declare a class as abstract?
1. When the class itself is inherited from an abstract class, but not all base abstract methods have been overridden.
2. When at least one of the methods in the class is abstract.

6. What is an interface class?
Interfaces, like classes, define a set of properties, methods, and events. But unlike classes, interfaces do not provide implementation. They are implemented by classes, and defined as separate entities from classes.

7. Why can’t you specify the accessibility modifier for methods inside the interface?
They all must be public, and are therefore public by default.

8. Can you inherit multiple interfaces?
Yes. .NET does support multiple interfaces.

9. What happens if you inherit multiple interfaces and they have conflicting method names?
It’s up to you to implement the method inside your own class, so implementation is left entirely up to you. This might cause a problem on a higher-level scale if similarly named methods from different interfaces expect different data, but as far as compiler cares you’re okay.
To Do: Investigate

10. What’s the difference between an interface and abstract class?
In an interface class, all methods are abstract - there is no implementation. In an abstract class some methods can be concrete. In an interface class, no accessibility modifiers are allowed. An abstract class may have accessibility modifiers.

11. What is the difference between a Struct and a Class?
Structs are value-type variables and are thus saved on the stack, additional overhead but faster retrieval. Another difference is that structs cannot inherit.

Method and Property Questions
1. What’s the implicit name of the parameter that gets passed into the set method/property of a class?
Value. The data type of the value parameter is defined by whatever data type the property is declared as.

2. What does the keyword “virtual” declare for a method or property?
The method or property can be overridden.

3. How is method overriding different from method overloading?
When overriding a method, you change the behavior of the method for the derived class. Overloading a method simply involves having another method with the same name within the class.

4. Can you declare an override method to be static if the original method is not static?
No. The signature of the virtual method must remain the same. (Note: Only the keyword virtual is changed to keyword override)

5. What are the different ways a method can be overloaded?
Different parameter data types, different number of parameters, different order of parameters.

6. If a base class has a number of overloaded constructors, and an inheriting class has a number of overloaded constructors; can you enforce a call from an inherited constructor to a specific base constructor?
Yes, just place a colon, and then keyword base (parameter list to invoke the appropriate constructor) in the overloaded constructor definition inside the inherited class.

Events and Delegates
1. What’s a delegate?
A delegate object encapsulates a reference to a method.

2. What’s a multicast delegate?
A delegate that has multiple handlers assigned to it. Each assigned handler (method) is called.

XML Documentation Questions
1. Is XML case-sensitive?
Yes.

2. What’s the difference between // comments, /* */ comments and /// comments?
Single-line comments, multi-line comments, and XML documentation comments.

3. How do you generate documentation from the C# file commented properly with a command-line compiler?
Compile it with the /doc switch.

Debugging and Testing Questions
1. What debugging tools come with the .NET SDK?
1. CorDBG – command-line debugger. To use CorDbg, you must compile the original C# file using the /debug switch.
2. DbgCLR – graphic debugger. Visual Studio .NET uses the DbgCLR.

2. What does assert() method do?
In debug compilation, assert takes in a Boolean condition as a parameter, and shows the error dialog if the condition is false. The program proceeds without any interruption if the condition is true.

3. What’s the difference between the Debug class and Trace class?
Documentation looks the same. Use Debug class for debug builds, use Trace class for both debug and release builds.

4. Why are there five tracing levels in System.Diagnostics.TraceSwitcher?
The tracing dumps can be quite verbose. For applications that are constantly running you run the risk of overloading the machine and the hard drive. Five levels range from None to Verbose, allowing you to fine-tune the tracing activities.

5. Where is the output of TextWriterTraceListener redirected?
To the Console or a text file depending on the parameter passed to the constructor.

6. How do you debug an ASP.NET Web application?
Attach the aspnet_wp.exe process to the DbgClr debugger.

7. What are three test cases you should go through in unit testing?
1. Positive test cases (correct data, correct output).
2. Negative test cases (broken or missing data, proper handling).
3. Exception test cases (exceptions are thrown and caught properly).

8. Can you change the value of a variable while debugging a C# application?
Yes. If you are debugging via Visual Studio.NET, just go to Immediate window.

ADO.NET and Database Questions
1. What is the role of the DataReader class in ADO.NET connections?
It returns a read-only, forward-only rowset from the data source. A DataReader provides fast access when a forward-only sequential read is needed.

2. What are advantages and disadvantages of Microsoft-provided data provider classes in ADO.NET?
SQLServer.NET data provider is high-speed and robust, but requires SQL Server license purchased from Microsoft. OLE-DB.NET is universal for accessing other sources, like Oracle, DB2, Microsoft Access and Informix. OLE-DB.NET is a .NET layer on top of the OLE layer, so it’s not as fastest and efficient as SqlServer.NET.

3. What is the wildcard character in SQL?
Let’s say you want to query database with LIKE for all employees whose name starts with La. The wildcard character is %, the proper query with LIKE would involve ‘La%’.

4. Explain ACID rule of thumb for transactions.
A transaction must be:
1. Atomic - it is one unit of work and does not dependent on previous and following transactions.
2. Consistent - data is either committed or roll back, no “in-between” case where something has been updated and something hasn’t.
3. Isolated - no transaction sees the intermediate results of the current transaction).
4. Durable - the values persist if the data had been committed even if the system crashes right after.

5. What connections does Microsoft SQL Server support?
Windows Authentication (via Active Directory) and SQL Server authentication (via Microsoft SQL Server username and password).

6. Between Windows Authentication and SQL Server Authentication, which one is trusted and which one is untrusted?
Windows Authentication is trusted because the username and password are checked with the Active Directory, the SQL Server authentication is untrusted, since SQL Server is the only verifier participating in the transaction.

7. What does the Initial Catalog parameter define in the connection string?
The database name to connect to.

8. What does the Dispose method do with the connection object?
Deletes it from the memory.
To Do: answer better. The current answer is not entirely correct.

9. What is a pre-requisite for connection pooling?
Multiple processes must agree that they will share the same connection, where every parameter is the same, including the security settings. The connection string must be identical.

Assembly Questions
1. How is the DLL Hell problem solved in .NET?
Assembly versioning allows the application to specify not only the library it needs to run (which was available under Win32), but also the version of the assembly.

2. What are the ways to deploy an assembly?
An MSI installer, a CAB archive, and XCOPY command.

3. What is a satellite assembly?
When you write a multilingual or multi-cultural application in .NET, and want to distribute the core application separately from the localized modules, the localized assemblies that modify the core application are called satellite assemblies.

4. What namespaces are necessary to create a localized application?
System.Globalization and System.Resources.

5. What is the smallest unit of execution in .NET?
an Assembly.

6. When should you call the garbage collector in .NET?
As a good rule, you should not call the garbage collector. However, you could call the garbage collector when you are done using a large object (or set of objects) to force the garbage collector to dispose of those very large objects from memory. However, this is usually not a good practice.

7. How do you convert a value-type to a reference-type?
Use Boxing.

8. What happens in memory when you Box and Unbox a value-type?
Boxing converts a value-type to a reference-type, thus storing the object on the heap. Unboxing converts a reference-type to a value-type, thus storing the value on the stack.
ASP.NET Interview Questions
This is a list of questions I have gathered and created over a period of time from my experience, many of which I felt where incomplete or simply wrong. I have finally taken the time to go through each question and correct them to the best of my ability. However, please feel free to post feedback to challenge, improve, or suggest new questions. I want to thank those of you that have contributed quality questions and corrections thus far.
There are some questions in this list that I do not consider to be good questions for an interview. However, they do exist on other lists available on the Internet so I felt compelled to keep them here for easy access.
1. Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process.
inetinfo.exe is theMicrosoft IIS server running, handling ASP.NET requests among other things.When an ASP.NET request is received (usually a file with .aspx extension), the ISAPI filter aspnet_isapi.dll takes care of it by passing the request tothe actual worker process aspnet_wp.exe.

2. What’s the difference between Response.Write() andResponse.Output.Write()?
Response.Output.Write() allows you to write formatted output.

3. What methods are fired during the page load?
Init() - when the page is instantiated
Load() - when the page is loaded into server memory
PreRender() - the brief moment before the page is displayed to the user as HTML
Unload() - when page finishes loading.

4. When during the page processing cycle is ViewState available?
After the Init() and before the Page_Load(), or OnLoad() for a control.

5. What namespace does the Web page belong in the .NET Framework class hierarchy?
System.Web.UI.Page

6. Where do you store the information about the user’s locale?
System.Web.UI.Page.Culture

7. What’s the difference between Codebehind="MyCode.aspx.cs" andSrc="MyCode.aspx.cs"?
CodeBehind is relevant to Visual Studio.NET only.

8. What’s a bubbled event?
When you have a complex control, like DataGrid, writing an event processing routine for each object (cell, button, row, etc.) is quite tedious. The controls can bubble up their eventhandlers, allowing the main DataGrid event handler to take care of its constituents.

9. Suppose you want a certain ASP.NET function executed on MouseOver for a certain button. Where do you add an event handler?
Add an OnMouseOver attribute to the button. Example: btnSubmit.Attributes.Add("onmouseover","someClientCodeHere();");

10. What data types do the RangeValidator control support?
Integer, String, and Date.

11. Explain the differences between Server-side and Client-side code?
Server-side code executes on the server. Client-side code executes in the client's browser.

12. What type of code (server or client) is found in a Code-Behind class?
The answer is server-side code since code-behind is executed on the server. However, during the code-behind's execution on the server, it can render client-side code such as JavaScript to be processed in the clients browser. But just to be clear, code-behind executes on the server, thus making it server-side code.

13. Should user input data validation occur server-side or client-side? Why?
All user input data validation should occur on the server at a minimum. Additionally, client-side validation can be performed where deemed appropriate and feasable to provide a richer, more responsive experience for the user.

14. What is the difference between Server.Transfer and Response.Redirect? Why would I choose one over the other?
Server.Transfer transfers page processing from one page directly to the next page without making a round-trip back to the client's browser. This provides a faster response with a little less overhead on the server. Server.Transfer does not update the clients url history list or current url. Response.Redirect is used to redirect the user's browser to another page or site. This performas a trip back to the client where the client's browser is redirected to the new page. The user's browser history list is updated to reflect the new address.

15. Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?
Valid answers are:
• A DataSet can represent an entire relational database in memory, complete with tables, relations, and views.
• A DataSet is designed to work without any continuing connection to the original data source.
• Data in a DataSet is bulk-loaded, rather than being loaded on demand.
• There's no concept of cursor types in a DataSet.
• DataSets have no current record pointer You can use For Each loops to move through the data.
• You can store many edits in a DataSet, and write them to the original data source in a single operation.
• Though the DataSet is universal, other objects in ADO.NET come in different versions for different data sources.

16. What is the Global.asax used for?
The Global.asax (including the Global.asax.cs file) is used to implement application and session level events.

17. What are the Application_Start and Session_Start subroutines used for?
This is where you can set the specific variables for the Application and Session objects.

18. Can you explain what inheritance is and an example of when you might use it?
When you want to inherit (use the functionality of) another class. Example: With a base class named Employee, a Manager class could be derived from the Employee base class.

19. Whats an assembly?
Assemblies are the building blocks of the .NET framework. Overview of assemblies from MSDN

20. Describe the difference between inline and code behind.
Inline code written along side the html in a page. Code-behind is code written in a separate file and referenced by the .aspx page.

21. Explain what a diffgram is, and a good use for one?
The DiffGram is one of the two XML formats that you can use to render DataSet object contents to XML. A good use is reading database data to an XML file to be sent to a Web Service.

22. Whats MSIL, and why should my developers need an appreciation of it if at all?
MSIL is the Microsoft Intermediate Language. All .NET compatible languages will get converted to MSIL. MSIL also allows the .NET Framework to JIT compile the assembly on the installed computer.

23. Which method do you invoke on the DataAdapter control to load your generated dataset with data?
The Fill() method.

24. Can you edit data in the Repeater control?
No, it just reads the information from its data source.

25. Which template must you provide, in order to display data in a Repeater control?
ItemTemplate.

26. How can you provide an alternating color scheme in a Repeater control?
Use the AlternatingItemTemplate.

27. What property must you set, and what method must you call in your code, in order to bind the data from a data source to the Repeater control?
You must set the DataSource property and call the DataBind method.

28. What base class do all Web Forms inherit from?
The Page class.

29. Name two properties common in every validation control?
ControlToValidate property and Text property.

30. Which property on a Combo Box do you set with a column name, prior to setting the DataSource, to display data in the combo box?
DataTextField property.

31. Which control would you use if you needed to make sure the values in two different controls matched?
CompareValidator control.

32. How many classes can a single .NET DLL contain?
It can contain many classes.

Web Service Questions
1. What is the transport protocol you use to call a Web service?
SOAP (Simple Object Access Protocol) is the preferred protocol.

2. True or False: A Web service can only be written in .NET?
False

3. What does WSDL stand for?
Web Services Description Language.

4. Where on the Internet would you look for Web services?
http://www.uddi.org

5. True or False: To test a Web service you must create a Windows application or Web application to consume this service?
False, the web service comes with a test page and it provides HTTP-GET method to test.

State Management Questions
1. What is ViewState?
ViewState allows the state of objects (serializable) to be stored in a hidden field on the page. ViewState is transported to the client and back to the server, and is not stored on the server or any other external source. ViewState is used the retain the state of server-side objects between postabacks.

2. What is the lifespan for items stored in ViewState?
Item stored in ViewState exist for the life of the current page. This includes postbacks (to the same page).

3. What does the "EnableViewState" property do? Why would I want it on or off?
It allows the page to save the users input on a form across postbacks. It saves the server-side values for a given control into ViewState, which is stored as a hidden value on the page before sending the page to the clients browser. When the page is posted back to the server the server control is recreated with the state stored in viewstate.

4. What are the different types of Session state management options available with ASP.NET?
ASP.NET provides In-Process and Out-of-Process state management. In-Process stores the session in memory on the web server. This requires the a "sticky-server" (or no load-balancing) so that the user is always reconnected to the same web server. Out-of-Process Session state management stores data in an external data source. The external data source may be either a SQL Server or a State Server service. Out-of-Process state management requires that all objects stored in session are serializable.
.NET Remoting Interview Questions
To Do: Comfirm these are correct answers. Many of these question I have obtained from other sources and have found they are not entirely correct, or simply wrong.
1. What’s a Windows process?
It’s an application that’s running and had been allocated memory.

2. What’s typical about a Windows process in regards to memory allocation?
Each process is allocated its own block of available RAM space, no process can access another process’ code or data. If the process crashes, it dies alone without taking the entire OS or a bunch of other applications down.

3. Explain what relationship is between a Process, Application Domain, and Application?
A process is an instance of a running application. An application is an executable on the hard drive or network. There can be numerous processes launched of the same application (5 copies of Word running), but 1 process can run just 1 application.

4. What are possible implementations of distributed applications in .NET?
.NET Remoting and ASP.NET Web Services. If we talk about the Framework Class Library, noteworthy classes are in System.Runtime.Remoting and System.Web.Services.

5. What are the consideration in deciding to use .NET Remoting or ASP.NET Web Services?
Remoting is a more efficient communication exchange when you can control both ends of the application involved in the communication process. Web Services provide an open-protocol-based exchange of informaion. Web Services are best when you need to communicate with an external organization or another (non-.NET) technology.

6. What’s a proxy of the server object in .NET Remoting?
It’s a fake copy of the server object that resides on the client side and behaves as if it was the server. It handles the communication between real server object and the client object. This process is also known as marshaling.

7. What are remotable objects in .NET Remoting?
Remotable objects are the objects that can be marshaled across the application domains. You can marshal by value, where a deep copy of the object is created and then passed to the receiver. You can also marshal by reference, where just a reference to an existing object is passed.

8. What are channels in .NET Remoting?
Channels represent the objects that transfer the other serialized objects from one application domain to another and from one computer to another, as well as one process to another on the same box. A channel must exist before an object can be transferred.

9. What security measures exist for .NET Remoting in System.Runtime.Remoting?
None. Security should be taken care of at the application level. Cryptography and other security techniques can be applied at application or server level.

10. What is a formatter?
A formatter is an object that is responsible for encoding and serializing data into messages on one end, and deserializing and decoding messages into data on the other end.

11. Choosing between HTTP and TCP for protocols and Binary and SOAP for formatters, what are the trade-offs?
Binary over TCP is the most effiecient, SOAP over HTTP is the most interoperable.

12. What’s SingleCall activation mode used for?
If the server object is instantiated for responding to just one single request, the request should be made in SingleCall mode.

13. What’s Singleton activation mode?
A single object is instantiated regardless of the number of clients accessing it. Lifetime of this object is determined by lifetime lease.

14. How do you define the lease of the object?
By implementing ILease interface when writing the class code.

15. Can you configure a .NET Remoting object via XML file?
Yes, via machine.config and application level .config file (or web.config in ASP.NET). Application-level XML settings take precedence over machine.config.

16. How can you automatically generate interface for the remotable object in .NET with Microsoft tools?
Use the Soapsuds tool.

Ten Tough Interview Questions and Ten Great Answers

Mental fear of the unknown is often what produces the physical symptoms of nervousness. In addition to preparing yourself physically, you need to prepare yourself mentally. The best way to prepare mentally is to know what may be coming. Fear of the unknown can only exist when there is an unknown. Take the time to understand some of the “standards” when it comes to interviewing questions.
The following are some of the most difficult questions you will face in the course of your job interviews. Some questions may seem rather simple on the surface—such as “Tell me about yourself”—but these questions can have a variety of answers. The more open ended the question, the wider the variation in the answers. Once you have become practiced in your interviewing skills, you will find that you can use almost any question as a launching pad for a particular topic or compelling story.
Others are classic interview questions, such as “What is your greatest weakness?” Questions most people answer improperly. In this case, the standard textbook answer for the “greatest weakness” question is to provide a veiled positive such as: “I work too much. I just work and work and work.” Wrong. Either you are lying or, worse yet, you are telling the truth, in which case you define working too much as a weakness and really do not want to work much at all.
The following answers are provided to give you a new perspective on how to answer tough interview questions. They are not there for you to lift from the page and insert into your next interview. They are provided for you to use as the basic structure for formulating your own answers. While the specifics of each reply may not apply to you, try to follow the basic structure of the answer from the perspective of the interviewer. Answer the questions behaviorally, with specific examples that show that clear evidence backs up what you are saying about yourself. Always provide information that shows you want to become the very best _____ for the company and that you have specifically prepared yourself to become exactly that. They want to be sold. They are waiting to be sold. Don’t disappoint them!
1. Tell me about yourself.
It seems like an easy interview question. It’s open ended. I can talk about whatever I want from the birth canal forward. Right?
Wrong. What the hiring manager really wants is a quick, two- to three-minute snapshot of who you are and why you’re the best candidate for this position.
So as you answer this question, talk about what you’ve done to prepare yourself to be the very best candidate for the position. Use an example or two to back it up. Then ask if they would like more details. If they do, keep giving them example after example of your background and experience. Always point back to an example when you have the opportunity.
“Tell me about yourself” does not mean tell me everything. Just tell me what makes you the best.
2. Why should I hire you?
The easy answer is that you are the best person for the job. And don’t be afraid to say so. But then back it up with what specifically differentiates you.
For example: “You should hire me because I’m the best person for the job. I realize that there are likely other candidates who also have the ability to do this job. Yet I bring an additional quality that makes me the best person for the job--my passion for excellence. I am passionately committed to producing truly world class results. For example . . .”
Are you the best person for the job? Show it by your passionate examples.
3. What is your long-range objective?
Make my job easy for me. Make me want to hire you.
The key is to focus on your achievable objectives and what you are doing to reach those objectives.
For example: “Within five years, I would like to become the very best accountant your company has on staff. I want to work toward becoming the expert that others rely upon. And in doing so, I feel I’ll be fully prepared to take on any greater responsibilities which might be presented in the long term. For example, here is what I’m presently doing to prepare myself . . .”
Then go on to show by your examples what you are doing to reach your goals and objectives.
4. How has your education prepared you for your career?
This is a broad question and you need to focus on the behavioral examples in your educational background which specifically align to the required competencies for the career.
An example: “My education has focused on not only the learning the fundamentals, but also on the practical application of the information learned within those classes. For example, I played a lead role in a class project where we gathered and analyzed best practice data from this industry. Let me tell you more about the results . . .”
Focus on behavioral examples supporting the key competencies for the career. Then ask if they would like to hear more examples.
5. Are you a team player?
Almost everyone says yes to this question. But it is not just a yes/no question. You need to provide behavioral examples to back up your answer.
A sample answer: “Yes, I’m very much a team player. In fact, I’ve had opportunities in my work, school and athletics to develop my skills as a team player. For example, on a recent project . . .”
Emphasize teamwork behavioral examples and focus on your openness to diversity of backgrounds. Talk about the strength of the team above the individual. And note that this question may be used as a lead in to questions around how you handle conflict within a team, so be prepared.
6. Have you ever had a conflict with a boss or professor? How was it resolved?
Note that if you say no, most interviewers will keep drilling deeper to find a conflict. The key is how you behaviorally reacted to conflict and what you did to resolve it.
For example: “Yes, I have had conflicts in the past. Never major ones, but there have been disagreements that needed to be resolved. I've found that when conflict occurs, it helps to fully understand the other person’s perspective, so I take time to listen to their point of view, then I seek to work out a collaborative solution. For example . . .”
Focus your answer on the behavioral process for resolving the conflict and working collaboratively.
7. What is your greatest weakness?
Most career books tell you to select a strength and present it as a weakness. Such as: “I work too much. I just work and work and work.” Wrong. First of all, using a strength and presenting it as a weakness is deceiving. Second, it misses the point of the question.
You should select a weakness that you have been actively working to overcome. For example: “I have had trouble in the past with planning and prioritization. However, I’m now taking steps to correct this. I just started using a pocket planner . . .” then show them your planner and how you are using it.
Talk about a true weakness and show what you are doing to overcome it.
8. If I were to ask your professors to describe you, what would they say?
This is a threat of reference check question. Do not wait for the interview to know the answer. Ask any prior bosses or professors in advance. And if they’re willing to provide a positive reference, ask them for a letter of recommendation.
Then you can answer the question like this:
“I believe she would say I'm a very energetic person, that I’m results oriented and one of the best people she has ever worked with. Actually, I know she would say that, because those are her very words. May I show you her letter of recommendation?”
So be prepared in advance with your letters of recommendation.
9. What qualities do you feel a successful manager should have?
Focus on two words: leadership and vision.
Here is a sample of how to respond: “The key quality in a successful manager should be leadership--the ability to be the visionary for the people who are working under them. The person who can set the course and direction for subordinates. The highest calling of a true leader is inspiring others to reach the highest of their abilities. I'd like to tell you about a person whom I consider to be a true leader . . .”
Then give an example of someone who has touched your life and how their impact has helped in your personal development.
10. If you had to live your life over again, what one thing would you change?
Focus on a key turning point in your life or missed opportunity. Yet also tie it forward to what you are doing to still seek to make that change.
For example: “Although I’m overall very happy with where I’m at in my life, the one aspect I likely would have changed would be focusing earlier on my chosen career. I had a great internship this past year and look forward to more experience in the field. I simply wish I would have focused here earlier. For example, I learned on my recent internship…” …then provide examples.
Stay focused on positive direction in your life and back it up with examples.
In reviewing these responses, please remember that they are only to be viewed samples. Please do not rehearse them verbatim or adopt them as your own. They are meant to stir your creative juices and get you thinking about how to properly answer the broader range of questions that you will face.
Fifty Standard Interview Questions

It is not enough to have solid answers for only the above questions. You need to be prepared for the full spectrum of questions that may be presented. For further practice, make sure you go through the required mock interview (see the Competitive Interview Prep chapter); and for further review, look at some of the following questions:
1. Tell me about yourself.
2. Tell me about your experience.
3. What is your most important accomplishment to date?
4. How would you describe your ideal job?
5. Why did you choose this career?
6. When did you decide on this career?
7. What goals do you have in your career?
8. How do you plan to achieve these goals?
9. How do you personally define success?
10. Describe a situation in which you were successful.
11. What do you think it takes to be successful in this career?
12. What accomplishments have given you the most satisfaction in your life?
13. If you had to live your life over again, what one thing would you change?
14. Would you rather work with information or with people?
15. Are you a team player?
16. What motivates you?
17. Why should I hire you?
18. Are you a goal-oriented person?
19. Tell me about some of your recent goals and what you did to achieve them.
20. What are your short-term goals?
21. What is your long-range objective?
22. What do you see yourself doing five years from now?
23. Where do you want to become ten years from now?
24. Do you handle conflict well?
25. Have you ever had a conflict with a boss or professor? How did you resolve it?
26. What major problem have you had to deal with recently?
27. Do you handle pressure well?
28. What is your greatest strength?
29. What is your greatest weakness?
30. If I were to ask one of your professors (or a boss) to describe you, what would he or she say?
31. Why did you choose to attend your college?
32. What changes would you make at your college?
33. How has your education prepared you for your career?
34. What were your favorite classes? Why?
35. Do you enjoy doing independent research?
36. Who were your favorite professors? Why?
37. Why is your GPA not higher?
38. Do you have any plans for further education?
39. How much training do you think you’ll need to become a productive employee?
40. What qualities do you feel a successful manager should have?
41. Why do you want to work in the _____ industry?
42. What do you know about our company?
43. Why are you interested in our company?
44. Do you have any location preferences?
45. How familiar are you with the community that we’re located in?
46. Are you willing to relocate? In the future?
47. Are you willing to travel? How much?
48. Is money important to you?
49. How much money do you need to make to be happy?
50. What kind of salary are you looking for?
Don’t just read these questions—practice and rehearse the answers. Don’t let the employer interview be the first time you actually formulate an answer in spoken words. It is not enough to think about them in your head—practice! Sit down with a friend, a significant other, or your roommate (an especially effective critic, given the amount of preparation to date) and go through all of the questions. If you have not yet completed a mock interview, do it now. Make the most of every single interview opportunity by being fully prepared!
Top Ten Critical Success Factors

With all the different questions being referenced, you may wonder what exactly the employer is seeking. And I will tell you.
Following is the list of the top ten critical success factors that nearly every employer is seeking:
1. Positive attitude toward work
2. Proficiency in field of study
3. Communication skills (oral and written)
4. Interpersonal skills
5. Confidence
6. Critical thinking and problem-solving skills
7. Flexibility
8. Self-motivation
9. Leadership
10. Teamwork
Show your competence in as many of these critical success factors as possible and you will rise above the competition.

Tips For Improving Your Programming Skills

Reference: Adam McKerlie in Guides, Programming
If there is one thing that a programmer is constantly doing throughout their entire careers, it is improving their programming skills. The IT industry is one of the most rapidly growing sectors and this means that if you don’t adapt to the new standards and practices you’ll quickly be left in the dust and replaced by newer more flexible programmers.
The good thing about being a programmer though, is that you already have strong skills in solving problems and learning things. This means that learning a new programming language or developing a new skill set shouldn’t be as hard as it would for someone who doesn’t have strong problem solving skills. That being said, learning new things can be a daunting task that can take a very long time. Here are a few tips for increasing your programming skills.
Write a program
If you’re trying to learn a new programming language one of the best ways to improve your skill in that language is to start coding. You can study the syntax and the theory of the language, as well as other people’s tutorials and code snippets all you want, but until you get your hands dirty you really won’t have any grasp on it. The first day of my first programming class the teacher gave us all of the commands necessary to create a simple program. He told us to use those commands to make any program that we wanted and that he would explain what everything did in the next class. Without having any clue of what I was doing, I took the commands that he gave us and hacked out a program in just under an hour. By the end of that hour I had a much stronger grasp on the programming language than I would have, had he just sat us down and taught us the syntax and the theory of it.
Now I’m not trying to say that it’s not important to learn the innerworkings of a programming language, because it’s extremely important to have that knowledge. I’m just saying that sometimes its just better to start and code something in order to understand the language.
Read other peoples code
This tip may seem a little backwards after you’ve read the tip above, but reading other peoples code is just as important as writing your own. Before I get started explaining this tip, I’d like to point out that reading other peoples code will only improve your programming skills if the person whose code you are reading is a good programmer. If you choose to read a beginner programmers code you’ll probably just learn bad coding practices and it won’t help you out at all.
Reading another programmers code is not an easy task, but it can be a rewarding one. Lets say you have no idea what a ternary operator (?:) in C is. Reading the documentation on it could help you a little but actually seeing it done in a program will help you a whole lot more. Reading other peoples code can help you with algorithms or structures that you don’t know.
Plan before you start coding
Planning out programs is something that every beginner programmer fails to do (and some experience programmers). Obviously is the program is small planing doesn’t really make sense because of the size of the program, but as the project grows the more important it is to plan. Planning helps you improve your programming skills because it gives you an idea of what is needed for the different parts of the program. Often times when a programmer starts coding a large program they quickly get lost in the small details and forget about the larger picture. What happens is that as the program grows in size they have to write little hacks to make it work which leads to poorly coded programs.
Properly designing a program before you start to code will lead to a more maintainable program.
Work with other programmers
Working with other programmers is one of the best ways to increase your programming skills. Working in a large group helps you in a number of ways. The first way is that working in a large group brings to light your weaknesses in your programming ability. A lot of programmers assume that every thing they do is better than anything anything else that could be written, and this is just not true. When you work with a programmer that is better than you, you quickly realize that there are things that you can’t program. Because we as programmers think that we’re good, when we find out that we can’t do something we tend to learn it quickly.
Working with a group of programmers also lets you refine the skills that you already have. Even if you’ve written an algorithm two hundred times there always the possibility that someone else will be able to help you make the algorithm more efficient. Group settings always bring out the best in me. I strive to show the other members of the group how good I am at programming and because of this I try to code my best.
Final Thoughts
As one of my Computer Science professors once said “You never stop learning in this field”. If you can continually update your programming skills you’ll be well ahead of most of the other programmers in this field. You’ll be able to stay with the current trends and you’re value as a programmer will continually increase.

Complete Introduction to OOAD

1. Introduction
I have noticed an increase in the number of articles published in the Architect category in code-project during the last few months. The number of readers for most of these articles is also high, though the ratings for the articles are not. This indicates that readers are interested in reading articles on Architecture, but the quality does not match their expectations. This article is a constructive attempt to group/ define/ explain all introductory concepts of software architecture for well seasoned developers who are looking to take their next step as system architects.
One day I read an article that said that the richest 2 percent own half the world's wealth. It also said that the richest 1 percent of adults owned 40 percent of global assets in the year 2000. And further, that the richest 10 percent of adults accounted for 85 percent of the world's total wealth. So there is an unbalanced distribution of wealth in the physical world. Have you ever thought of an unbalanced distribution of knowledge in the software world? According to my view point, the massive expansion of the software industry is forcing developers to use already implemented libraries, services and frameworks to develop software within ever shorter periods of time. The new developers are trained to use (I would say more often) already developed software components, to complete the development quicker. They just plug in an existing library and some how manage to achieve the requirements. But the sad part of the story is, that they never get a training to define, design the architecture for, and implement such components. As the number of years pass by, these developers become leads and also software architects. Their titles change, but the old legacy of not understanding, of not having any architectural experience continues, creating a vacuum of good architects. The bottom line is that only a small percentage of developers know how to design a truly object oriented system. The solution to this problem is getting harder every day as the aggressive nature of the software industry does not support an easy adjustment to existing processes, and also the related online teaching materials are either complex or less practical or sometimes even wrong. The most of them use impractical, irrelevant examples of shapes, animals and many other physical world entities to teach concepts of software architecture. There are only very few good business-oriented design references. Unfortunately, I myself am no exception and am a result of this very same system. I got the same education that all of you did, and also referred to the same resource set you all read.
Coming back to the initial point, I noticed that there is a knowledge gap, increasing every day, between the architects who know how to architect a system properly and the others who do not know. The ones, who know, know it right. But the ones, who do not know, know nothing. Just like the world’s wealth distribution, it is an unbalanced distribution of knowledge.
2. Background
This article began after reading and hearing the questions new developers have, on basics of software architecture. There are some good articles out there, but still developers struggle to understand the basic concepts, and more importantly, the way to apply them correctly.
As I see it, newcomers will always struggle to understand a precise definition of a new concept, because it is always a new and hence unfamiliar idea. The one, who has experience, understands the meaning, but the one who doesn’t, struggles to understand the very same definition. It is like that. Employers want experienced employees. So they say, you need to have experience to get a job. But how the hell is one supposed to have that experience if no one is willing to give him a job? As in the general case, the start with software architecture is no exception. It will be difficult. When you start to design your very first system, you will try to apply everything you know or learned from everywhere. You will feel that an interface needs to be defined for every class, like I did once. You will find it harder to understand when and when not to do something. Just prepare to go through a painful process. Others will criticize you, may laugh at you and say that the way you have designed it is wrong. Listen to them, and learn continuously. In this process you will also have to read and think a lot. I hope that this article will give you the right start for that long journey.
“The knowledge of the actions of great men, acquired by long experience in contemporary affairs, and a continual study of antiquity” – I read this phrase when I was reading the book named “The Art of War”, seems applicable here, isn’t it?
3. Prerequisites
This article is an effort to provide an accurate information pool for new developers on the basics of software architecture, focusing on Object Oriented Programming (OOP). If you are a developer, who has a minimum of three or more years of continuous development experience and has that hunger to learn more, to step-in to the next level to become a software architect, this article is for you.
4. The Main Content
4.1. What is Software Architecture?
Software Architecture is defined to be the rules, heuristics and patterns governing:
• Partitioning the problem and the system to be built into discrete pieces
• Techniques used to create interfaces between these pieces
• Techniques used to manage overall structure and flow
• Techniques used to interface the system to its environment
• Appropriate use of development and delivery approaches, techniques and tools.
4.2. Why Architecture is important?

The primary goal of software architecture is to define the non-functional requirements of a system and define the environment. The detailed design is followed by a definition of how to deliver the functional behavior within the architectural rules. Architecture is important because it:
• Controls complexity
• Enforces best practices
• Gives consistency and uniformity
• Increases predictability
• Enables re-use.
4.3. What is OOP?
OOP is a design philosophy. It stands for Object Oriented Programming. Object-Oriented Programming (OOP) uses a different set of programming languages than old procedural programming languages (C, Pascal, etc.). Everything in OOP is grouped as self sustainable "objects". Hence, you gain re-usability by means of four main object-oriented programming concepts.
In order to clearly understand the object orientation, let’s take your “hand” as an example. The “hand” is a class. Your body has two objects of type hand, named left hand and right hand. Their main functions are controlled/ managed by a set of electrical signals sent through your shoulders (through an interface). So the shoulder is an interface which your body uses to interact with your hands. The hand is a well architected class. The hand is being re-used to create the left hand and the right hand by slightly changing the properties of it.
4.4. What is an Object?
An object can be considered a "thing" that can perform a set of activities. The set of activities that the object performs defines the object's behavior. For example, the hand can grip something or a Student (object) can give the name or address.
In pure OOP terms an object is an instance of a class.
4.5. What is a Class?

A class is simply a representation of a type of object. It is the blueprint/ plan/ template that describe the details of an object. A class is the blueprint from which the individual objects are created. Class is composed of three things: a name, attributes, and operations.
public class Student
{
}
According to the sample given below we can say that the student object, named objectStudent, has created out of the Student class.
Student objectStudent = new Student();
In real world, you'll often find many individual objects all of the same kind. As an example, there may be thousands of other bicycles in existence, all of the same make and model. Each bicycle has built from the same blueprint. In object-oriented terms, we say that the bicycle is an instance of the class of objects known as bicycles.
In the software world, though you may not have realized it, you have already used classes. For example, the TextBox control, you always used, is made out of the TextBox class, which defines its appearance and capabilities. Each time you drag a TextBox control, you are actually creating a new instance of the TextBox class.
4.6. How to identify and design a Class?
This is an art; each designer uses different techniques to identify classes. However according to Object Oriented Design Principles, there are five principles that you must follow when design a class,
• SRP - The Single Responsibility Principle
• A class should have one, and only one, reason to change.
• OCP - The Open Closed Principle
• You should be able to extend a classes behavior, without modifying it.
• LSP - The Liskov Substitution Principle
• Derived classes must be substitutable for their base classes.
• DIP - The Dependency Inversion Principle
• Depend on abstractions, not on concretions.
• ISP - The Interface Segregation Principle
• Make fine grained interfaces that are client specific.
For more information on design principles, please refer to Object Mentor.
Additionally to identify a class correctly, you need to identify the full list of leaf level functions/ operations of the system (granular level use cases of the system). Then you can proceed to group each function to form classes (classes will group same types of functions/ operations). However a well defined class must be a meaningful grouping of a set of functions and should support the re-usability while increasing expandability/ maintainability of the overall system. In software world the concept of dividing and conquering is always recommended, if you start analyzing a full system at the start, you will find it harder to manage. So the better approach is to identify the module of the system first and then dig deep in to each module separately to seek out classes.
A software system may consist of many classes. But in any case, when you have many, it needs to be managed. Think of a big organization, with its work force exceeding several thousand employees (let’s take one employee as a one class). In order to manage such a work force, you need to have proper management policies in place. Same technique can be applies to manage classes of your software system as well. In order to manage the classes of a software system, and to reduce the complexity, the system designers use several techniques, which can be grouped under four main concepts named Encapsulation, Abstraction, Inheritance, and Polymorphism. These concepts are the four main gods of OOP world and in software term, they are called four main Object Oriented Programming (OOP) Concepts.
4.7. What is Encapsulation (or information hiding)?
The encapsulation is the inclusion within a program object of all the resources need for the object to function - basically, the methods and the data. In OOP the encapsulation is mainly achieved by creating classes, the classes expose public methods and properties. The class is kind of a container or capsule or a cell, which encapsulate the set of methods, attribute and properties to provide its indented functionalities to other classes. In that sense, encapsulation also allows a class to change its internal implementation without hurting the overall functioning of the system. That idea of encapsulation is to hide how a class does it but to allow requesting what to do.

In order to modularize/ define the functionality of a one class, that class can uses functions/ properties exposed by another class in many different ways. According to Object Oriented Programming there are several techniques, classes can use to link with each other and they are named association, aggregation, and composition.
There are several other ways that an encapsulation can be used, as an example we can take the usage of an interface. The interface can be used to hide the information of an implemented class.
IStudent myStudent = new LocalStudent();
IStudent myStudent = new ForeignStudent();
According to the sample above (let’s assume that LocalStudent and ForeignStudent are implemented by the IStudent interface) we can see how LocalStudent and ForeignStudent are hiding their, localize implementing information through the IStudent interface.
4.8. What is Association?
Association is a (*a*) relationship between two classes. It allows one object instance to cause another to perform an action on its behalf. Association is the more general term that define the relationship between two classes, where as the aggregation and composition are relatively special.
public class StudentRegistrar
{
public StudentRegistrar ();
{
new RecordManager().Initialize();
}
}
In this case we can say that there is an association between StudentRegistrar and RecordManager or there is a directional association from StudentRegistrar to RecordManager or StudentRegistrar use a (*Use*) RecordManager. Since a direction is explicitly specified, in this case the controller class is the StudentRegistrar.

To some beginners, association is a confusing concept. The troubles created not only by the association alone, but with two other OOP concepts, that is association, aggregation and composition. Every one understands association, before aggregation and composition are described. The aggregation or composition cannot be separately understood. If you understand the aggregation alone it will crack the definition given for association, and if you try to understand the composition alone it will always threaten the definition given for aggregation, all three concepts are closely related, hence must study together, by comparing one definition to another. Let’s explore all three and see whether we can understand the differences between these useful concepts.
4.9. What is the difference between Association, Aggregation and Composition?
Association is a (*a*) relationship between two classes, where one class use another. But aggregation describes a special type of an association. Aggregation is the (*the*) relationship between two classes. When object of one class has an (*has*) object of another, if second is a part of first (containment relationship) then we called that there is an aggregation between two classes. Unlike association, aggregation always insists a direction.
public class University
{
private Chancellor universityChancellor = new Chancellor();
}

In this case I can say that University aggregate Chancellor or University has an (*has-a*) Chancellor. But even without a Chancellor a University can exists. But a University cannot exist without Faculties, the life time of a University attached with the life time of its Faculty (or Faculties). If Faculties are disposed the University will not exist or wise versa. In that case we called that University is composed of Faculties. So that composition can be recognized as a special type of an aggregation.

Same way, as another example, you can say that, there is a composite relationship in-between a KeyValuePairCollection and a KeyValuePair. The two mutually depend on each other.
In summary, we can say that aggregation is a special kind of an association and composition is a special kind of an aggregation. (Association->Aggregation->Composition)

4.10. What is Abstraction and Generalization?
Abstraction is an emphasis on the idea, qualities and properties rather than the particulars (a suppression of detail). The importance of abstraction is derived from its ability to hide irrelevant details and from the use of names to reference objects. Abstraction is essential in the construction of programs. It places the emphasis on what an object is or does rather than how it is represented or how it works. Thus, it is the primary means of managing complexity in large programs.
While abstraction reduces complexity by hiding irrelevant detail, generalization reduces complexity by replacing multiple entities which perform similar functions with a single construct. Generalization is the broadening of application to encompass a larger domain of objects of the same or different type. Programming languages provide generalization through variables, parameterization, generics and polymorphism. It places the emphasis on the similarities between objects. Thus, it helps to manage complexity by collecting individuals into groups and providing a representative which can be used to specify any individual of the group.
Abstraction and generalization are often used together. Abstracts are generalized through parameterization to provide greater utility. In parameterization, one or more parts of an entity are replaced with a name which is new to the entity. The name is used as a parameter. When the parameterized abstract is invoked, it is invoked with a binding of the parameter to an argument.
4.11. What is an Abstract class?
Abstract classes, which declared with the abstract keyword, cannot be instantiated. It can only be used as a super-class for other classes that extend the abstract class. Abstract class is the concept and implementation gets completed when it is being realized by a subclass. In addition to this a class can inherit only from one abstract class (but a class may implement many interfaces) and must override all its abstract methods/ properties and may override virtual methods/ properties.
Abstract classes are ideal when implementing frameworks. As an example, let’s study the abstract class named LoggerBase below. Please carefully read the comments as it will help you to understand the reasoning behind this code.
public abstract class LoggerBase
{
///
/// field is private, so it intend to use inside the class only
///

private log4net.ILog logger = null;

///
/// protected, so it only visible for inherited class
///

protected LoggerBase()
{
// The private object is created inside the constructor
logger = log4net.LogManager.GetLogger(this.LogPrefix);
// The additional initialization is done immediately after
log4net.Config.DOMConfigurator.Configure();
}

///
/// When you define the property as abstract,
/// it forces the inherited class to override the LogPrefix
/// So, with the help of this technique the log can be made,
/// inside the abstract class itself, irrespective of it origin.
/// If you study carefully you will find a reason for not to have “set” method here.
///

protected abstract System.Type LogPrefix
{
get;
}

///
/// Simple log method,
/// which is only visible for inherited classes
///

///
protected void LogError(string message)
{
if (this.logger.IsErrorEnabled)
{
this.logger.Error(message);
}
}

///
/// Public properties which exposes to inherited class
/// and all other classes that have access to inherited class
///

public bool IsThisLogError
{
get
{
return this.logger.IsErrorEnabled;
}
}
}
The idea of having this class as an abstract is to define a framework for exception logging. This class will allow all subclass to gain access to a common exception logging module and will facilitate to easily replace the logging library. By the time you define the LoggerBase, you wouldn’t have an idea about other modules of the system. But you do have a concept in mind and that is, if a class is going to log an exception, they have to inherit the LoggerBase. In other word the LoggerBase provide a framework for exception logging.
Let’s try to understand each line of the above code.
Like any other class, an abstract class can contain fields, hence I used a private field named logger declare the ILog interface of the famous log4net library. This will allow the Loggerbase class to control, what to use, for logging, hence, will allow changing the source logger library easily.
The access modifier of the constructor of the LoggerBase is protected. The public constructor has no use when the class is of type abstract. The abstract classes are not allowed to instantiate the class. So I went for the protected constructor.
The abstract property named LogPrefix is an important one. It enforces and guarantees to have a value for LogPrefix (LogPrefix uses to obtain the detail of the source class, which the exception has occurred) for every subclass, before they invoke a method to log an error.
The method named LogError is protected, hence exposed to all subclasses. You are not allowed or rather you cannot make it public, as any class, without inheriting the LoggerBase cannot use it meaningfully.
Let’s find out why the property named IsThisLogError is public. It may be important/ useful for other associated classes of an inherited class to know whether the associated member logs its errors or not.
Apart from these you can also have virtual methods defined in an abstract class. The virtual method may have its default implementation, where a subclass can override it when required.
All and all, the important factor here is that all OOP concepts should be used carefully with reasons, you should be able to logically explain, why you make a property a public or a field a private or a class an abstract. Additionally, when architecting frameworks, the OOP concepts can be used to forcefully guide the system to be developed in the way framework architect’s wanted it to be architected initially.
4.12. What is an Interface?
In summary the Interface separates the implementation and defines the structure, and this concept is very useful in cases where you need the implementation to be interchangeable. Apart from that an interface is very useful when the implementation changes frequently. Some say you should define all classes in terms of interfaces, but I think recommendation seems a bit extreme.
Interface can be used to define a generic template and then one or more abstract classes to define partial implementations of the interface. Interfaces just specify the method declaration (implicitly public and abstract) and can contain fields and properties (which are also implicitly public and abstract). Interface definition begins with the keyword interface. An interface like that of an abstract class cannot be instantiated.
If a class that implements an interface does not define all the methods of the interface, then it must be declared abstract and the method definitions must be provided by the subclass that extends the abstract class. In addition to this an interfaces can inherit other interfaces.
The sample below will provide an interface for our LoggerBase abstract class.
public interface ILogger
{
bool IsThisLogError { get; }
}
4.13. What is the difference between a Class and an Interface?
In .Net/ C# a class can be defined to implement an interface and also it supports multiple implementations. When a class implements an interface, an object of such class can be encapsulated inside an interface.
If MyLogger is a class, which implements ILogger, there we can write
ILogger log = new MyLogger();
A class and an interface are two different types (conceptually). Theoretically a class emphasis the idea of encapsulation, while an interface emphasis the idea of abstraction (by suppressing the details of the implementation). The two poses a clear separation from one to another. Therefore it is very difficult or rather impossible to have an effective meaningful comparison between the two, but it is very useful and also meaningful to have a comparison between an interface and an abstract class.
4.14. What is the difference between an Interface and an Abstract class?
There are quite a big difference between an interface and an abstract class, even though both look similar.
1.
o Interface definition begins with a keyword interface so it is of type interface
o Abstract classes are declared with the abstract keyword so it is of type class
2.
o Interface has no implementation, but they have to be implemented.
o Abstract class’s methods can have implementations and they have to be extended.
3.
o Interfaces can only have method declaration (implicitly public and abstract) and fields (implicitly public static)
o Abstract class’s methods can’t have implementation only when declared abstract.
4.
o Interface can inherit more than one interfaces
o Abstract class can implement more than one interfaces, but can inherit only one class
5.
o Abstract class must override all abstract method and may override virtual methods
o Interface can be used when the implementation is changing
o Abstract class can be used to provide some default behavior for a base class.
o Interface makes implementation interchangeable
o Interface increase security by hiding the implementation
o Abstract class can be used when implementing framework
o Abstract classes are an excellent way to create planned inheritance hierarchies and also to use as non-leaf classes in class hierarchies.
Abstract classes let you define some behaviors; they force your subclasses to provide others. For example, if you have an application framework, an abstract class can be used to provide the default implementation of the services and all mandatory modules such as event logging and message handling etc. This approach allows the developers to develop the application within the guided help provided by the framework.
However, in practice when you come across with some application-specific functionality that only your application can perform, such as startup and shutdown tasks etc. The abstract base class can declare virtual shutdown and startup methods. The base class knows that it needs those methods, but an abstract class lets your class admit that it doesn't know how to perform those actions; it only knows that it must initiate the actions. When it is time to start up, the abstract class can call the startup method. When the base class calls this method, it can execute the method defined by the child class.
4.15. What is Implicit and Explicit Interface Implementations?
As mentioned before .Net support multiple implementations, the concept of implicit and explicit implementation provide safe way to implement methods of multiple interfaces by hiding, exposing or preserving identities of each of interface methods, even when the method signatures are the same.
Let's consider the interfaces defined below.
interface IDisposable
{
void Dispose();
}
Here you can see that the class Student has implicitly and explicitly implemented the method named Dispose() via Dispose and IDisposable.Dispose.
class Student : IDisposable
{
public void Dispose()
{
Console.WriteLine("Student.Dispose");
}

void IDisposable.Dispose()
{
Console.WriteLine("IDisposable.Dispose");
}
}
4.16. What is Inheritance?
Ability of a new class to be created, from an existing class by extending it, is called inheritance.

public class Exception
{
}


public class IOException : Exception
{
}
According to the above example the new class (IOException), which is called the derived class or subclass, inherits the members of an existing class (Exception), which is called the base class or super-class. The class IOException can extend the functionality of the class Exception by adding new types and methods and by overriding existing ones.
Just like abstraction is closely related with generalization, the inheritance is closely related with specialization. It is important to discuss those two concepts together with generalization to better understand and to reduce the complexity.
One of the most important relationships among objects in the real world is specialization, which can be described as the “is-a” relationship. When we say that a dog is a mammal, we mean that the dog is a specialized kind of mammal. It has all the characteristics of any mammal (it bears live young, nurses with milk, has hair), but it specializes these characteristics to the familiar characteristics of canis domesticus. A cat is also a mammal. As such, we expect it to share certain characteristics with the dog that are generalized in Mammal, but to differ in those characteristics that are specialized in cats.
The specialization and generalization relationships are both reciprocal and hierarchical. Specialization is just the other side of the generalization coin: Mammal generalizes what is common between dogs and cats, and dogs and cats specialize mammals to their own specific subtypes.
Similarly, as an example you can say that both IOException and SecurityException are of type Exception. They have all characteristics and behaviors of an Exception, That mean the IOException is a specialized kind of Exception. A SecurityException is also an Exception. As such, we expect it to share certain characteristic with IOException that are generalized in Exception, but to differ in those characteristics that are specialized in SecurityExceptions. In other words, Exception generalizes the shared characteristics of both IOException and SecurityException, while IOException and SecurityException specialize with their characteristics and behaviors.
In OOP, the specialization relationship is implemented using the principle called inheritance. This is the most common and most natural and widely accepted way of implement this relationship.
4.17. What is Polymorphism?
Polymorphism is a generic term that means 'many shapes'. More precisely Polymorphism means the ability to request that the same operations be performed by a wide range of different types of things.
At times, I used to think that understanding Object Oriented Programming concepts have made it difficult since they have grouped under four main concepts, while each concept is closely related with one another. Hence one has to be extremely careful to correctly understand each concept separately, while understanding the way each related with other concepts.
In OOP the polymorphism is achieved by using many different techniques named method overloading, operator overloading and method overriding,
4.18. What is Method Overloading?
The method overloading is the ability to define several methods all with the same name.
public class MyLogger
{
public void LogError(Exception e)
{
// Implementation goes here
}

public bool LogError(Exception e, string message)
{
// Implementation goes here
}
}
4.19. What is Operator Overloading?
The operator overloading (less commonly known as ad-hoc polymorphism) is a specific case of polymorphism in which some or all of operators like +, - or == are treated as polymorphic functions and as such have different behaviors depending on the types of its arguments.
public class Complex
{
private int real;
public int Real
{ get { return real; } }

private int imaginary;
public int Imaginary
{ get { return imaginary; } }

public Complex(int real, int imaginary)
{
this.real = real;
this.imaginary = imaginary;
}

public static Complex operator +(Complex c1, Complex c2)
{
return new Complex(c1.Real + c2.Real, c1.Imaginary + c2.Imaginary);
}
}
I above example I have overloaded the plus operator for adding two complex numbers. There the two properties named Real and Imaginary has been declared exposing only the required “get” method, while the object’s constructor is demanding for mandatory real and imaginary values with the user defined constructor of the class.
4.20. What is Method Overriding?
Method overriding is a language feature that allows a subclass to override a specific implementation of a method that is already provided by one of its super-classes.
A subclass can give its own definition of methods but need to have the same signature as the method in its super-class. This means that when overriding a method the subclass's method has to have the same name and parameter list as the super-class's overridden method.
using System;
public class Complex
{
private int real;
public int Real
{ get { return real; } }

private int imaginary;
public int Imaginary
{ get { return imaginary; } }

public Complex(int real, int imaginary)
{
this.real = real;
this.imaginary = imaginary;
}

public static Complex operator +(Complex c1, Complex c2)
{
return new Complex(c1.Real + c2.Real, c1.Imaginary + c2.Imaginary);
}

public override string ToString()
{
return (String.Format("{0} + {1}i", real, imaginary));
}
}
In above example I have extended the implementation of the sample Complex class given under operator overloading section. This class has one overridden method named “ToString”, which override the default implementation of the standard “ToString” method to support the correct string conversion of a complex number.
Complex num1 = new Complex(5, 7);
Complex num2 = new Complex(3, 8);

// Add two Complex numbers using the
// overloaded plus operator
Complex sum = num1 + num2;

// Print the numbers and the sum
// using the overriden ToString method
Console.WriteLine("({0}) + ({1}) = {2}", num1, num2, sum);
Console.ReadLine();
4.21. What is a Use case?
A use case is a thing a system does. A use case maps actors to functions. Importantly, the actors need not be people.

In another angle a use case encodes a typical user interaction with the system. In particular, it:
• Captures some user-visible function.
• Achieves some concrete goal for the user.
A complete set of use cases largely defines the requirements for your system: everything the user can see, and would like to do. The below diagram contains a set of use cases that describes a simple login module of a gaming website.

4.22. What is a Class Diagram?
A class diagrams are widely used to describe the types 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. These perspectives become evident as the diagram is created and help solidify the design.
The Class diagrams, physical data models, along with the system overview diagram are in my opinion the most important diagrams that suite the current day rapid application development requirements.
UML Notations:

4.23. What is a Package Diagram?
Package diagrams are used to reflect the organization of packages and their elements. When used to represent class elements, package diagrams provide a visualization of the namespaces. In my designs, I use the package diagrams to organize classes in to different modules of the system.
4.24. What is a Sequence Diagram?
A sequence diagrams model the flow of logic within a system in a visual manner, it enable both to document and validate your logic, and are used for both analysis and design purposes. Sequence diagrams are the most popular UML artifact for dynamic modeling, which focuses on identifying the behavior within your system.
4.25. What is two-tier architecture?
The two-tier architecture is refers to client/ server architectures as well, the term client/ server was first used in the 1980s in reference to personal computers (PCs) on a network. The actual client/ server model started gaining acceptance in the late 1980s, and later it was adapted to World Wide Web programming.
According to the modern days use of two-tier architecture the user interfaces (or with ASP.NET, all web pages) runs on the client and the database is stored on the server. The actual application logic can run on either the client or the server. So in this case the user interfaces are directly access the database. Those can also be non-interface processing engines, which provide solutions to other remote/ local systems. In either case, today the two-tier model is not as reputed as the three-tier model. The advantage of the two-tier design is its simplicity, but the simplicity comes with the cost of scalability. The newer three-tier architecture, which is more famous, introduces a middle tier for the application logic.

4.26. What is three-tier architecture?
The three tier software architecture (also known as three layer architectures) emerged in the 1990s to overcome the limitations of the two tier architecture. This architecture has aggressively customized and adopted by modern day system designer to web systems.
Three-tier is a client-server architecture in which the user interface, functional process logic, data storage and data access are developed and maintained as independent modules, some time on separate platforms. The term "three-tier" or "three-layer", as well as the concept of multi-tier architectures (often refers to as three-tier architecture), seems to have originated within Rational Software.

The 3-Tier architecture has the following three tiers.
1. Presentation Tier or Web Server: User Interface, displaying/ accepting data/ input to/ from the user
2. Application Logic/ Business Logic/ Transaction Tier or Application Server: Data validation, acceptability check before being added to the database and all other business/ application specific operations
3. Data Tier or Database server: Simple reading and writing method to database or any other storage, connection, command, stored procedures etc
4.27. What is MVC architecture?
The Model-View-Controller (MVC) architecture separates the modeling of the domain, the presentation, and the actions based on user input into three separate classes.
Unfortunately, the popularity of this pattern has resulted in a number of faulty usages; each technology (Java, ASP.NET etc) has defined it in their own way making it difficult to understand. In particular, the term "controller" has been used to mean different things in different contexts. The definitions given bellow are the closes possible ones I found for ASP.NET version of MVC.

1. Model: DataSet and typed DataSet (some times business object, object collection, XML etc) are the most common use of the model.
2. View: The ASPX and ASCX files generally handle the responsibilities of the view.
3. Controllers: The handling of events or the controlling is usually done in the code-behind class.
In a complex n-tier distributed system the MVC architecture place the vital role of organizing the presentation tier of the system.
4.28. What is SOA?
A service-oriented architecture is essentially a collection of services. These services communicate with each other. The communication can involve either simple data passing or it could involve two or more services coordinating some activity. Some means of connecting services to each other is needed.
The .Net technology introduces the SOA by mean of web services.

The SOA can be used as the concept to connect multiple systems to provide services. It has it's great share in the future of the IT world.
According to the imaginary diagram above, we can see how the Service Oriented Architecture is being used to provide a set of centralized services to the citizens of a country. The citizens are given a unique identifying card, where that card carries all personal information of each citizen. Each service centers such as shopping complex, hospital, station, and factory are equipped with a computer system where that system is connected to a central server, which is responsible of providing service to a city. As an example when a customer enter the shopping complex the regional computer system report it to the central server and obtain information about the customer before providing access to the premises. The system welcomes the customer. The customer finished the shopping and then by the time he leaves the shopping complex, he will be asked to go through a billing process, where the regional computer system will manage the process. The payment will be automatically handled with the input details obtain from the customer indentifying card.
The regional system will report to the city (computer system of the city) while the city will report to the country (computer system of the country).
4.29. What is the Data Access Layer?
The data access layer (DAL), which is a key part of every n-tier system, is mainly consist of a simple set of code that does basic interactions with the database or any other storage device. These functionalities are often referred to as CRUD (Create, Retrieve, Update, and Delete).
The data access layer need to be generic, simple, quick and efficient as much as possible. It should not include complex application/ business logics.
I have seen systems with lengthy, complex store procedures (SP), which run through several cases before doing a simple retrieval. They contain not only most part of the business logic, but application logic and user interface logic as well. If SP is getting longer and complicated, then it is a good indication that you are burring your business logic inside the data access layer.
4.30. What is the Business Logic Layer?
I know for a fact that this is a question for most, but from the other hand by reading many articles I have become aware that not everyone agrees to what business logic actually is, and in many cases it's just the bridge in between the presentation layer and the data access layer with having nothing much, except taking from one and passing to the other. In some other cases, it is not even been well thought out, they just take the leftovers from the presentation layer and the data access layer then put them in another layer which automatically is called the business logic layer. However there are no god said things that cannot be changed in software world. You can change as and when you feel comfortable that the method you apply is flexible enough to support the growth of your system. There are many great ways, but be careful when selecting them, they can over complicating the simple system. It is a balance one needs to find with their experience.
As a general advice when you define business entities, you must decide how to map the data in your tables to correctly defined business entities. The business entities should meaningfully define considering various types of requirements and functioning of your system. It is recommended to identify the business entities to encapsulate the functional/ UI (User Interface) requirements of your application, rather than define a separate business entity for each table of your database. For example, if you want to combine data from couple of table to build a UI (User Interface) control (Web Control), implement that function in the Business Logic Layer with a business object that uses couple of data object to support with your complex business requirement.
4.31. What is Gang of Four (GoF) Design Patterns?
The Gang of Four (GoF) patterns are generally considered the foundation for all other patterns. They are categorized in three groups: Creational, Structural, and Behavioral. Here you will find information on these important patterns.
Creational Patterns
o Abstract Factory Creates an instance of several families of classes
o Builder Separates object construction from its representation
o Factory Method Creates an instance of several derived classes
o Prototype A fully initialized instance to be copied or cloned
o Singleton A class of which only a single instance can exist
Structural Patterns
o Adapter Match interfaces of different classes
o Bridge Separates an object’s interface from its implementation
o Composite A tree structure of simple and composite objects
o Decorator Add responsibilities to objects dynamically
o Facade A single class that represents an entire subsystem
o Flyweight A fine-grained instance used for efficient sharing
o Proxy An object representing another object
Behavioral Patterns
o Chain of Resp. A way of passing a request between a chain of objects
o Command Encapsulate a command request as an object
o Interpreter A way to include language elements in a program
o Iterator Sequentially access the elements of a collection
o Mediator Defines simplified communication between classes
o Memento Capture and restore an object's internal state
o Observer A way of notifying change to a number of classes
o State Alter an object's behavior when its state changes
o Strategy Encapsulates an algorithm inside a class
o Template Method Defer the exact steps of an algorithm to a subclass
o Visitor Defines a new operation to a class without change
5. What is the Conclusion?
I don't think, that it is realistic trying to make a programming language be everything to everybody. The language becomes bloated, hard to learn, and hard to read if everything plus the kitchen sink is thrown in. In another word every language has their limitations. As system architect and designer we should be able to fully and more importantly correctly utilize the available tools and features to build usable, sustainable, maintainable and also very importantly expandable software systems, that fully utilize the feature of the language to bring a competitively advance system to their customers. In order to do it, the foundation of a system places a vital role. The design or the architecture of a software system is the foundation. It hold the system together, hence designing a system properly is the key to the success. When you talk about designing a software system, the correct handling of OOP concept is very important. I have made the above article richer with idea but still kept it short so that one can learn/ remind all of important concept at a glance. Hope you all will enjoy reading it.
6. What I Referred?
• MSDN Library: http://msdn2.microsoft.com/en-us/library/default.aspx
• Practical Approach to Computer Systems Design and Architecture: http://www.codeproject.com/useritems/System_Design.asp
• Introduction: What is Object-Oriented Programming?: http://www.inf.ufsc.br/poo/smalltalk/ibm/tutorial/oop.html
• Basic Object-Oriented Concepts: http://www.toa.com/pub/oobasics/oobasics.htm
• Inheritance and Polymorphism—Specialization and Generalization: http://en.csharp-online.net/Inheritance_and_Polymorphism%E2%80%94Specialization_and_Generalization
• Abstraction and Generalization: http://cs.wwc.edu/~aabyan/PLBook/HTML/AbsGen.html
• Object Oriented Analysis and Design Team: http://atlas.kennesaw.edu/~dbraun/csis4650/A&D/index.htm
• Client/Server Software Architectures--An Overview: http://www.sei.cmu.edu/str/descriptions/clientserver.html
• Service-oriented architecture (SOA) definition: http://www.service-architecture.com/web-services/articles/service-oriented_architecture_soa_definition.html
• http://www.dofactory.com/Patterns/Patterns.aspx
• http://www.objectmentor.com
7. History
• 28/01/2007
o - Added more content base on design principles.
o - Added History section
License

Popular Posts