Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

Thursday, October 5, 2017

Use of Private Constructor in OOPS

If we set access specifier of a constructor to private, then that constructor can only be accessed inside the class. A private constructor is mainly used when you want to prevent the class instance from being created outside the class. 

This is mainly in the case of singleton class. Singleton classes are employed extensively in concepts like Networking and Database Connectivity. Using private constructor we can ensure that no more than one object can be created at a time. 

Example of Private Constructor in a Singleton Class

public class SingletonClass
{
    public static SingletonClass singletonClass;

    private SingletonClass() 
    {
    }

    public static SingletonClass getInstance() 
    {
        if(singletonClass == null) 
        {
            singletonClass = new SingletonClass();
        }
        return singletonClass;
    }
}

A class with private constructor cannot be inherited.

If we don’t want a class to be inherited, then we make the class constructor private. So, if we try to derive another class from this class then compiler will flash an error. Why compiler will flash an error? 

We know the order of execution of constructor in inheritance that when we create an object of a derived class then first constructor of the base call will be called and then constructor of derived class. Since base class constructor is private, hence, derived class will fail to access base class constructor.

We can also use sealed class to stop a class to be inherited. Sealed class provide more flexible and readable way to stop inheritance.

Diamond Problem in Multiple Inheritance in OOPS

The diamond problem occurs when two super classes of a class have a common base class. 

Suppose there are four classes A, B, C and D. Class B and C inherit class A. Now class B and C contains one copy of all the functions and data members of class A. Class D is derived from class B and C. Now class D contains two copies of all the functions and data members of class A. One copy comes from class B and another copy comes from class C.

Let’s say class A has a function with name display(). So class D have two display() functions as I have explained above. If we call display() function using class D object then ambiguity occurs because compiler gets confused that whether it should call display() that came from class B or from class C. If you will compile above program then it will show error.

This kind of problem is called diamond problem as a diamond structure is formed (see the image).

That is why major programming languages like C#, Java and Delphi don't have multiple inheritance because it can lead to diamond problem and rather than providing some complex way to solve it, there are better ways through which we can achieve the same result as multiple inheritance. We can use interfaces to resolve this problem.

C++ supports multiple inheritance.

Notice that the above problem with multiple class inheritance can also come with only three classes where all of them has at least one common method.

Because of this problem we can not extend two classes for implementing multiple inheritance and to resolve this problem of multiple inheritance in object oriented programming we use interfaces for implementing the functionality of multiple inheritance. 

As we know we do not define a function but only declare that function in an interface. So if we use interfaces we can extend one class and one or more interfaces or we can implement more than one interfaces at a time to use the functionality of multiple inheritance and we can escape from diamond problem.

Tuesday, September 26, 2017

What is the difference between Singleton Class and Static Class? Which one to use and when?

Almost both singleton class and static class serve the same purpose which creates confusion among developers and architects about which one to use. When to use singleton class and when to use static class. In this article I have tried to differentiate between the two. Following is the list of differences between a singleton class and a static class:

1. Singleton classes are more inclined to the object-oriented concepts as compared to the static classes. With Singleton classes, you can use inheritance and polymorphism to extend a base class, implement an interface and capable of providing different implementations. While a static class cannot inherit their instance members. So, Singleton classes are more flexible than static classes.

2. Singleton classes can be passed as an object to other methods while a static class allows only static methods and you cannot pass static class as parameter.

3. If your requirement is to maintain the state, then singleton class is the better choice than static class, because maintaining the state with static classes is very cumbersome and leads to subtle bugs.

4. Singleton classes can be lazy loaded if it’s a heavy object, but static class doesn't have such advantages and always eagerly loaded. Static class is generally initialized when it is first loaded and it will lead to potential class loader issues.

5. Static classes are hard to mock and consequently hard to test than singletons, which are easy to mock and thus easy to test. It’s easier to write unit tests for singleton than static classes, because you can pass mock object whenever singleton is expected, e.g. into constructor or as method arguments.

6. Singleton classes provide more flexibility. Consider the possibility that your application has a global shared object and tomorrow you decide that you must make more than one instance of the class. If you use a singleton class then all you should do is make the constructor public. This is not so simple with static classes.

7. Many Dependency Injection framework manages singleton quite well e.g. Spring, which makes using them very easy.

8. Singleton objects are stored in Heap, but static objects are stored in Stack.

9. Static class provides better performance than singleton class, because static methods are bonded on compile time.

10. Singleton classes maintain single object across the application life cycle, so the scope is at application level. The static does not have any object pointer, so the scope is at App Domain level. Moreover, both should be implemented to be thread-safe.

Wednesday, February 19, 2014

Can Software Developers enjoy their personal life?

Can Software Developers enjoy their personal life?

Normally in any job around the world, you have to work for 40-45 hours a week. But is this really true for a software developer? As a software developer, if you have to grow in your professional life, you have to sacrifice your personal life. This statement is intimidating, but true to some extent. Mainly, the initial years of a software developer are very crucial and you have to work extensively to thrive in your career. Only the lucky software developers get flexible working hours in the office otherwise most of the software developers have to compromise their personal life.

In a software industry, you will have to face:

1. Tight Deadlines
2. Excessive Work Load
3. Staying Late Nights
4. Working on Weekends
5. Code quality and code delivery at same time
6. Bug fixing

If you are a software developer, you have to try hard to maintain work-life balance. Software development is full of uncertainties. Any time any thing can happen in your project and then you have to sit to solve that issue. You always have to think twice before planning your evenings, weekends and holidays as these uncertain and untimely issues can destroy them easily. If you are planning to go for a long holiday, you will have to plan that according to the situation in the project. If you are running through a lot of issues, forget that you will get leaves. You have to inform your manager months ago for your holiday plans otherwise just forget it.

Single vs Married vs Parent Developers

If you are still single, that's fine. You can stay late evenings, you can come on weekends etc. You can also take excessive work load and pressure because at this stage of life you don't have to care about other troubles of your life (except your girlfriend, if you have :) ) as your personal life is smooth till now. But once you get married, you get extra personal life responsibilities on your shoulder. Now you also have to care about your life partner. You also have to give sufficient amount of your time to her/him. You cannot come stay late in office every evening, cannot come to office every weekend etc. etc. The situation becomes worst after kids. At this stage of life, you really have to struggle hard to maintain work life balance otherwise you will not be able to see your kids growing.

Advice to software developers:

1. It depends on how you handle the situation and your skill. However, to survive in the any kind of stream, you should invest your time for atleast 2 to 3 years in that domain and understand clearly. Then you will go into a better position in that stream and you can do well with balanced life. I mean, after you understand clearly about what you do, then only you can prioritize the work properly and can live balanced life with work and family. There are lot of companies which expects only 40 hours of work. Even there, if you fail to deliver, you should put more time and complete the work.

2. Companies take advantage of eager graduates and workaholic tendencies. Just refuse to fall into the pressure to extend hours. If companies can't deal with that, then your better off looking for a new employer. When interviewing at new jobs, it would be good to find out what their overtime policies are. If they have real overtime policies that involve giving you respectable amounts of money for working late, they're probably not as likely to ask for 60-hour work weeks (though I would try to talk to other employees there to get an idea of what actually goes on).

3. Product companies have better working hours compared to Service Oriented companies. So try to get into product companies. But product companies are limited as compared to software oriented companies. 

Monday, February 10, 2014

5 Advantages and Disadvantages of Software Developer Job

5 Advantages and Disadvantages of Software Developer Job 

No job is perfect. Every job has some advantages and disadvantages. If you are enjoying your job, that job is best for you. You should carefully choose a right career for you as it can make your life heaven or hell. If you have chosen for becoming a software developer, you must know the pros and cons of this career. I would like to share the advantages and disadvantages of software developer's job.

Advantages of Software Programming Job

1. Good Pay: As compared to other jobs and professions, software programming job's pay is high.

2. Portable Skills: You learn a lot of things like programming language, software tools etc. in one company and can apply that knowledge in another company. When you switch from one company to another, you also get a good salary hike.

3. Work Anywhere: You can work from anywhere. All you need is one laptop and the internet connection. Work From Home is a very good facility in this field.

4. Comfortable Working Environment: You work in a very comfortable environment. You always have access to fast internet connection. You always have air condition office, nice comfortable chair. You don't have to worry about the harsh weather conditions outside. Heavy rainfall, hailstorm, cold snow, hot or cold weather cannot affect your work.

5. Continuous Learning Curve in all directions: You always keep on learning new things in your office, in your project. Your knowledge continuosly increases with your experience. You always remain updated with the new technologies and inventions.

Disadvantages of Software Programming Job

1. Global Competition and Outsourcing: We live in a very well connected world. Every body in any corner of the world is well connected with each other through emails, messengers etc. There is great IT workforce in India which can do the same job in less money as compared to the developers in USA and Europe. Almost every IT company outsources its lot of work to India to reap benefits by utilising the talent of India and saves a lot of money. So, the competition in this field is global and you have to be very perfect to cope this.

2. You have to upgrade your skills continuously: Technology is changing every day. Everyday, there are new enhancements, everyday there is new invention. You have to keep yourself very active and updated otherwise you will be left behind in the race. You have to learn new thing everyday. You should learn to adapt with new things. Standing rigid with the old things will make you lose the competition. Keep on learning new programming languages and always add new thing to your resume.

3. Sitting Job: You have to sit tight to your desk and stare at your computer continuously. If this is not fine for you, you should not come to this profession. But today, other jobs are also becoming like this. So you will find this kind of scenario in each and every job. It can make you unhealthy very easily.

4. Age Discrimination: There is a lot of age discrimination in the software programming field. Many people think that a person above 40 would not be able to perform well. Preference is given to the young developers because it is assumed that they have fresh mind and would be able to solve the programming puzzles and tricks easily as compared to the old brains. Also young developers will cost less to the companies.

5. Long hours, Tight deadlines and no personal and social life: In IT field, you are bound to the tight deadlines and have to work for long hours and on weekends to meet the deadlines. Most of the Software developers have to sacrifice their personal and social life to make the deliveries on time. 

Friday, February 7, 2014

Should Interviewers ask Puzzles to Software Developers in an Interview to evaluate their skills?

Should Interviewers ask Puzzles to Software Developers in an Interview to evaluate their skills?

Programming is not about writing lines of code, it is about solving problems for the people. Some interviewers ask puzzles in an attempt to gauge software developer's ability and approach to solving problems. Puzzles can be useful in assessing problem solving skills, which is of course one of the key aspects of programming. Interviewer's expectations in that case are to hear you articulate your approach to the problem. What other data would you try to gather? How would you test your hypothesizes, etc. The point of asking the puzzles is to watch how developers work toward the solution, not necessarily if they get the right answer. You can spot good programmers pretty quickly just by watching this process. The interviewer must have been referring to problem solving and logic skills, which is part of the everyday work of a programmer. When given a problem, you need to be able to analyze it, subdivide it, and write a solution for it by using the most optimal approach.

Personally, I don't think that such puzzles provide an accurate indicator. I cannot understand the connection between such puzzles and programming. In the "real world", you have more than five minutes to figure out if your dealing with a bin packing vs a back pack problem, for instance. Initially, it's sometimes easy to misunderstand the problem at hand until you're in the middle of applying the wrong solution. That happens to people with 1, 5, 10 or even 20 years of experience.

The best interview 'puzzles' are the ones where you sit down at a computer to solve a problem in the domain in which you claim expertise. I also dislike the "Well, a programmer should be able to ..." thinking because it doesn't take into consideration that people get anxious when hit with something unexpected in a setting that is already stressful. Sure, you could solve that if you had time to think about it.. and perhaps you could solve it faster if you realized that your life would be over if you didn't. Do you want to work somewhere where your life will be over if you can't solve problems in five minutes? Will you get fired if you can't?

Should all great programmers also be champion sudoku solvers? I'm sure that plenty are, but it's not like some kind of prerequisite for competency.

I'm not saying that you should not be tested on how you approach problems, but the tests should be fun and invite the 'best' that the applicant has to give, given their area of expertise. Proving that you are as smart as a character that Bruce Willis portrays seems kind of pointless, considering that producers spent a pretty sum to get that scene just right.

These sorts of puzzles are generally used by interviewers who neither know what they are doing nor how to look for developers? These are just voodoo hiring practices. Some interviewers ask these questions so they feel like they are supposed to. They know that not answering the question is "bad" and answering is "good", but they can't tell you why beyond non-answers like "a developer needs these skills". They are a waste of time and an indicator that the interviewer is not a competent interviewer. In other words, if you detect that you're being interviewed by someone who has little comprehension over what you'll actually be doing, excuse yourself to go to the restroom and never return.

Suggestion to Interviewers

It is far better to ask coding questions to the software developers. In other words, you need to ask questions that allow you to explore the skills and behaviour of the software developer as they try and tackle the problem. Asking silly puzzles instead of coding philosophies will not give you any indication about how good that person is for the job.

Always try to make the applicant feel as comfortable as possible, so that you can actually try to find out how good that person will be for the job. The best programmers are those who understand the dynamics of software development, even if they don't have the highest IQs.

Saturday, January 25, 2014

Devexpress vs Telerik vs Infragistics: Which one to choose and why?

Devexpress vs Telerik vs Infragistics: Which one to choose and why?

Devexpress, Telerik and Infragistics are the great third party tools for you for both your windows and web application. These third party tools mainly support .NET technologies like WinForms, Silverlight, ASP.NET and WPF. Devexpress also supports windows application built in Delphi programming language and I am currenty working on it. Also I have heard some other third party tools like ComponentOne, SyncFusion and Januscontrols but never worked upon them. Which one is good, which one to choose and why? Although this is difficult and time consuming task, but let's try to solve the confusion.

Why do we require these third party tools for our application?

These all thrid party tools are mainly used for improving the user interface which standard controls cannot provide. Devexpress, Telerik and Infragistics third party tools provide a lot of exciting features and components which you require like attractive dashboards, advanced reporting tools, sorting, searching, grouping, paging, filtering, databinding, drag and drop features, intelligent editors, smart control panels, importing and exporting features, attractive ribbon bars, complex tree views and graphs, cool transition controls, rich textboxes, navigation contorls, charting controls, complex themes and much more...

Devexpress vs Telerik vs Infragistics: Which one to choose and why?

Which tool is best? This is very hard to say. This question seems philosophical to me. There's no one answer.

Devexpress, Telerik and Infragistics have their own strong and weak points. Each and every tool has some learning curve to understand its way of doing the things. These all tools provide excellent performance and great convenience to the user. 

It is upto you and your needs to choose one of these. Following are some humble suggestions which you can consider before choosing one of these tools for your windows or web application.

1. What is your requirement?

What is the nature of your application and what functionalities do you want to put in? This should be the first questions striking in your mind before choosing any thrid party tool for your UI. Once you finalized your requirement, then move to these contorls and read their documentation, features list, online demos, try trial versions to implement your functionality. If the tool is giving you your desired functionality, consider it.

2. Your familiarity with tool

A good choice, nevertheless is to choose one you know. I would start by expressing my opinion that the best tool set is the one with which you gain your greatest familiarity. I think the market demonstrates that there is a sufficient percentage of buyers to support all these three tools. I would also conjecture that the longer you work in any one, the more you will like it. 

My observation is that each library comes with its own set of presuppositions: about structure, nomenclature, interface and class design and inheritance; about consistency and your mental model of the controls and events; about many things. 

Some of these presuppositions blend easily with the way some people think. Others blend better with other brain architecture. It doesn't mean one is better or worse. It means one is different than the other. You have to find the one that works for the way you think and program. Otherwise you will be twisting on a right-hand nut with a left-hand wrench.

3. Which tool your co-workers and other teams of your company are using?

You should also investigate with other teams in your company if they are using any of these tools. If yes, learn from their experience. 

4. Support and Documentation

Evaluate each tool in terms of their support and documentation. Go with tool which provide solid support, documentation, sample examples, tutorials, example codes and demonstrations. All the component libraries should be well-represented and documented. When you will use a third party software or tool, you will need much help from those people. The tool vendor should have good forum.

5. Cross browser compliant

If you are looking for Devexpress, Telerik and Infragistics for you web application, must ensure that all the features which you need from these third party tools run same on all the browsers. 

6. Cost and Licensing 

Cost should be reasonable and licensing should be simple. 

Conclusion

To be fair, all grid components will do great if you're on the standard track. As soon as you'll have something to implement that is not a general purpose usage it will get harder. This is true for all third party controls.

Compare demos and trial versions based on your needs. I would encourage you to evaluate the controls on your own to see which control will best meet your needs. That's the best suggestion I can suggest.

Friday, January 17, 2014

24 Frequently Asked Basic SOA Interview Questions and Answers

24 Frequently Asked Basic SOA Interview Questions and Answers

SOA stands for Service Oriented Architecture. If you are preparing for SOA interview, the following SOA interview questions and answers can be very useful to you. Basically, these SOA interview questions and answers cover basic concepts of SOA like services in SOA, characteristics and principles of services in SOA, loose coupling of services, contract, address and bindings in SOA, main benefits of SOA to the business and IT, difference between services and components in SOA, requirement of SOA to the business, pitfalls of SOA etc. Let's have a look:

1. What is a Service in SOA?

In the real world, a service is what we pay for and we get the intended service. 

Example 1 (from Real World): You go to a restaurant and order food. Your order first goes to the counter and then it goes to the kitchen where the food is prepared and finally the waiter serves the food.

So in order to order an item from a restaurant you need three logical departments / services to work together (counter, kitchen, and waiter).

In the same manner in software world, these services are termed as business services. 

Example 2 (from Software World): You go to Amazon to order a book. Different services like payment gateway, stock system, and delivery system come together to achieve your task. 

All the services are self contained and logical. They are like black boxes. In short we do not need to understand the internal details of how the business service works. For the external world it’s just a black box which takes messages and serves accordingly. For instance the ‘payment gateway’ business service takes the message ‘check credit’ and gives out output: does the customer have credit or not. For the ‘order system’ business service ‘payment gateway’ service is a black box.

2. What are the main characteristics of services in SOA?

Following are the main characteristics of services in SOA:

A) SOA components are loosely coupled. When we say loosely coupled that means every service is self contained and exists alone logically. For instance we take the ‘payment gateway’ service and attach it to a different system.

B) SOA services are black boxes. In SOA, services hide there inner complexities. They only interact using messages and send services depending on those messages. By visualizing services as black boxes, services become more loosely coupled.

C) SOA service should be self defined: SOA services should be able to define themselves.

D) SOA services are maintained in a listing: SOA services are maintained in a central repository. Applications can search the services in the central repository and use them accordingly.

E) SOA services can be orchestrated and linked to achieve a particular functionality: SOA services can be used/orchestrated in a plug and play manner. For instance, the figure ‘Orchestration’ shows two services ‘Security service’ and ‘Order processing service’. You can achieve two types of orchestrations from it: one you can check the user first and then process the order, or vice-versa. Yes, you guessed right, using SOA we can manage a workflow between services in a loosely coupled fashion.

3. What is SOA?

SOA stands for Service Oriented Architecture. SOA is an architecture for building business applications using loosely coupled services which act like black boxes and can be orchestrated to achieve a specific functionality by linking together.

4. What are Contract, Address, and Bindings?

These three terminologies on which SOA service stands. Every service must expose one or more ends by which the service can be available to the client. End consists of three important things where, what and how:-

Contract is an agreement between two or more parties. It defines the protocol how client should communicate with your service. Technically, it describes parameters and return values for a method.

An Address indicates where we can find this service. Address is a URL, which points to the location of the service.

Bindings determine how this end can be accessed. It determines how communications is done. For instance, you expose your service, which can be accessed using SOAP over HTTP or BINARY over TCP. So for each of these communications medium two bindings will be created.

5. Are web-services SOA?

SOA is a thinking, it’s an architectural concept, and web service is one of the technical approaches to complete it. Web services are the preferred standards to achieve SOA.

In SOA we need services to be loosely coupled. A web service communicates using the SOAP protocol which is XML based, which is very loosely coupled. It answers the what part of the service.

SOA services should be able to describe themselves. WSDL describes how we can access the service.

SOA services are located in a directory. UDDI describes where we can get the web service. This is nothing but the implementation of the SOA registry.

6. What are the main benefits of SOA?

SOA helps create greater alignment between IT and line of business while generating more flexibility - IT flexibility to support greater business flexibility. Your business processes are changing faster and faster and global competition requires the flexibility that SOA can provide.

SOA can help you get better reuse out of your existing IT investments as well as the new services you’re developing today. SOA makes integration of your IT investments easier by making use of well-defined interfaces between services. SOA also provides an architectural model for integrating business partners’, customers’ and suppliers’ services into an enterprise’s business processes. This reduces cost and improves customer satisfaction

7. What is a reusable Service?

It is an autonomous, reusable, discoverable, stateless functionality that has the necessary granularity, and can be part of a composite application or a composite service.

A reusable service should be identified with a business activity described by the service specifications (design-time contract).

A service’s constraints, including security, QoS, SLA, usage policies, may be defined by multiple run-time contracts, multiple interfaces (the WSDL for a SOAP Web Service), and multiple implementations (the code).

A reusable service should be governed at the enterprise level throughout its entire lifecycle, from design-time through run-time. Its reuse should be promoted through a prescriptive process, and that reuse should be measured.

8. Talking about Service identification, which approach between top-down and bottom-up methodologies encourages re-use and maintenance?

Since the top-down approach is business-driven it can be practical to separate the different concerns of business and IT on different plans, providing a common ground in between. So in most situations it the most appropriate if you want to improve reuse and ROI in the medium/long term. 

9. How can you achieve loose coupling in a SOA?

One strategy for achieving loose coupling is to use the service interface (the WSDL for a SOAP Web Service) to limit this dependency, hiding the service implementation from the consumer. Loose coupling can be addressed by encapsulating the service functionalities in a manner that limits the impact of changes to the implementation on the service interface. However, at some point you will need to change the interface and manage versioning without impacting service consumers, in addition to managing multiple security constraints, multiple transports, and other considerations

10. Do you recall any pattern which could be used to leverage loose coupling?

The Mediation pattern, using an enterprise service bus (ESB), will help in achieving this.

Mediation will take loose coupling to the highest level. It will establish independence between consumers and providers on all levels, including message formats, message types (including SOAP, REST, XML, binary) and transport protocols (including HTTP, HTTPS, JMS).

Architecturally speaking this means the separation of concerns between consumers and providers on the transport, message type, and message format levels.

11. The Service of a SOA should be engineered as stateless or stateful?

Service should be stateless. It may have a context within its stateless execution, but it will not have an intermediary state waiting for an event or a call-back. The retention of state-related data must not extend beyond a request/response on a service. This is because state management consumes a lot of resources, and this can affect the scalability and availability that are required for a reusable service.

12. What is composition of a Service?

Composition is the process by which services are combined to produce composite applications or composite services. A composite application consists of the aggregation of services to produce an enterprise portal or enterprise process. A composite service consists of an aggregation of services that produces another reusable service. It’s just like combining electronic components to create a computer motherboard, and then using that motherboard in a computer. Think of the motherboard as a reusable composite service that is a component of the computer, and of the computer as the composite application.

13. How do I integrate my Legacy applications with SOA?

Legacy applications are frequently at the core of your IT environment. With the right skills and tools, you need to identify discrete elements within your legacy applications and “wrap” them in standards-based interfaces and use them as services within your SOA.

14. How does the ESB fits in this picture?

The Enterprise Service Bus is a core element of any SOA. ESBs provide the “any to any” connectivity between services within your own company, and beyond your business to connect to your trading partners. But SOA does not stop at just implementing an ESB. Depending on what your goals are, you may want to use an ESB to connect other services within your SOA such as information services, interaction services and business process management services. Additionally, you will need to consider development services and IT service management services. The SOA reference architecture can help you lay out an SOA environment that meets your needs and priorities. The ESB is part of this reference architecture and provides the backbone of an SOA but it should not be considered an SOA by itself.

15. In SOA do we need to build systems from scratch?

No. If you need to integrate or make an existing system as a business service, you just need to create loosely coupled wrappers which will wrap your custom systems and expose the systems functionality in a generic fashion to the external world.

16. What’s the difference between services and components?

Services are logical grouping of components to achieve business functionality. Components are implementation approaches to make a service. The components can be in JAVA, C#, C++ but the services will be exposed in a general format like Web Services.

17. The concept of SOA is nothing new, however why everyone started to talk about SOA only in the recent years?

Yes, I agree the basic concepts of SOA aren’t new, however some technology technology changes in the last 10 years made service-oriented architecture more practical and applicable to more organizations than it was previously. Among this:

1. Universally-accepted industry standards such as XML, its many variants, and Web-services standards have contributed to the renewed interest in SOA.

2. Data governance frameworks, which are important to a successful SOA implementation, have well test and refined over the years.

3. A variety of enabling technologies and tools (e.g., modeling, development, infrastructure/middleware, management, and testing) have matured.

4. Understanding of business and business strategies has grown, shifting attention from technology to the people, cultural changes, and process that are key business success factors.

18. What is the most important skill you need to adopt SOA? Technical or Cultural?

Surely cultural. SOA does require people to think of business and technology differently. Instead of thinking of technology first (e.g., If we implement this system, what kinds of things can we do with it?), practitioners must first think in terms of business functions, or services (e.g., My company does these business functions, so how can I set up my IT system to do those things for me most efficiently?).It is expected that adoption of SOA will change business IT departments, creating service-oriented (instead of technology-oriented) IT organizations.

19. What are the main obstacles in the way of SOA?

1. Shortage of skills. 
2. Justifying the ROI of SOA projects. 

20. Can I buy an SOA or must I build one?

To move your organization toward greater service orientation, you need to take a balanced approach to building versus buying. To create the infrastructure for an SOA, you'll need the right commercial off-the-shelf software that complements (rather than replaces) your existing IT infrastructure. This is a “buy” statement. On the “build” side, you may also choose to access know-how and hands-on involvement to use these software products effectively and get the most out of them. This infrastructure and the associated tools can help you create the business services that run on your SOA. Again, there is some “building” associated with this. So the real answer is that you need a certain measure of both building and buying.

21. Do I need SOA Governance to get started?

A key aspect of successful SOA implementations is having business involved in the effort from the beginning. One of the values from SOA you can gain is improved Business/IT Alignment. SOA Governance supplies the decision rights, processes, and policies for business and IT to work together. After a service is deployed, there must be management aspects in place to control and monitor the service. You do not need a lot of SOA Governance to get started, but enough to work with the level of Smart SOA you are implementing.

22. What are SOA Entry Points?

To get started quickly with SOA, you need to select an initial project that focuses on a particular business opportunity that can be completed in a reasonably short time frame. The SOA Entry points are project areas that have been shown to provide business value in a timely manner. Each Entry Point provides a key SOA related solution:

People - collaboration improving productivity by giving employees and partners the ability to create a personalized, consolidated way to interact with others.

Process - optimize and deploy processes on the fly and monitor the effectiveness of the altered processes.

Information - improve business insight and reduce risk by using trusted information services delivered in line and in context.

Reuse - newly created and reusable services are the building blocks of SOA. Reuse gives users flexibility through reduced cycle time and elimination of duplicate processes.

Connectivity - although, in the past, connectivity has been a requirement, SOA brings new levels of flexibility to these linkages. The connectivity provided by SOA has distinct value on its own and as a building block for additional SOA initiatives.

23. What are the common pitfalls of SOA?

One of the most common pitfalls is to view SOA as an end, rather than a means to an end. Developers who focus on building an SOA solution rather than solving a specific business problem are more likely to create complex, unmanageable, and unnecessary interconnections between IT resources.

Another common pitfall is to try to solve multiple problems at once, rather than solving small pieces of the problem. Taking a top-down approach—starting with major organization-wide infrastructure investments—often fails either to show results in a relevant time-frame or to offer a compelling return on investment.

24. Is SOA really needed on your opinion?

SOA is not for everyone. While SOA delivers significant benefits and cost savings, SOA does require disciplined enforcement of centralized governance principals to be successful. For some organizations, the cost of developing and enforcing these principals may be higher than the benefits realized, and therefore not a sound initiative.

Monday, December 23, 2013

Apple iPhone Application Development - Initial Steps

Apple iPhone Application Development - Initial Steps

Today, Apple iPhone application development is in full swing and iPhone developers are in great demand. In order to develop iPhone apps, you should be a good Objective C developer. If you have good grip on C++, OOPS Concepts, I can guarantee you that you can learn Objective C easily and quickly and can start building your iPhone apps. There are a lot of iPhone apps development tutorials available on the internet and very good iPhone apps development community on the stackoverflow, so you will not feel alone if you stuck anywhere while iPhone app development. Today, companies are hiring a lot of iPhone app developers for building their iPhone apps. XCode is the full featured tool which eases your iPhone app development to a large extent. A lot of demos, sample codes, sample applications are available on the internet which can fulfil your basic iPhone app functionalities. So, I am just giving the initial steps which you should take while iPhone app development.

Step 1: Think of a good idea

Have a unique idea for an iphone app? So what makes an app stand out?  Why would anyone want to use your app?  Why would they pay money for it if you are going to charge?

Be sure to check that there aren’t other apps that do the same thing that you are proposing. Or if you want to create something better than an app that already exists, think about how your idea will be better.  Draw it out on paper or on the computer.

Step 2: Get A Mac

The iPhone is an Apple product and uses a variation of the Mac OS. Currently, the iPhone development tools are only available for Mac users. You can buy a Mac mini relatively cheaply if you don’t have a Mac at your disposal.

Step 3: Register As An Apple Developer

To work with the Mac tools, you will need to become an official Apple Developer. Registration is free so you simply have to give them your information and agree to their terms.  You only need to register once, and you are able to use the same username and password used for your iTunes account. Once you are an Apple Developer, you can develop iPhone apps for any of the Mac products.

Step 4:  Download The Software Development Kit For iPhone (SDK)

Once you are an official developer, you can download the SDK for iPhone.  The version you need depends on the OS you are currently running.  This download is HUGE because it comes with all sorts of documentation, sample codes, and all sorts of things you will be glad to have later on. It could take a few hours, so you might want to start the download, put in a good movie, and wait.

Step 5: Download XCode

If you don’t already have it, download XCode.  According to Apple, “Xcode is a complete, full-featured IDE built around a smooth workflow that integrates the editing of source code, with the build and compile steps, through to a graphical debugging experience – all without leaving the view of your source code.”  This is another huge download, so you might want to rent a second movie.

Step 6: Develop Your iPhone App With The Templates In The SDK

Once you have your app drawn out on paper or in Photoshop, you can start designing it with the templates provided in the SDK.  This is where that HUGE amount of download time will be a huge benefit.  You will have lots of templates to choose from, and there are a lot of great YouTube clip tutorials on how to use the templates effectively.

Step 7: Learn Objective-C For Cocoa

If you love programming languages, you will love Objective-C.  If you don’t know how to program, this is the part that can get pretty sticky, so you might want to find a programmer friend or hire someone.  It really does help to get a book, too, for reference.

Step 8: Program Your App In Objective-C

Once you at least understand the basics of Objective-C (or at least know how to find answers to programming questions), you are ready to program your app.  It helps to take screenshots as you go along so you can remember what you tried.  Some apps can take just a few hours to program while other Apps can take months. Only you know how much detail you want out there for its maiden voyage in the App Store!

Step 9: Test The App In The iPhone Simulator

The SDK comes with a lovely iPhone Simulator.  You will need to load up your app and do your own testing.  You should try to work out as many bugs as possible and think about all the ways someone might use your app.

Step 10: Host A Bake Sale

Remember when I told you in the fine print that you would have to raise some cash?  This is that moment.  Sadly, loading an app into iTunes costs a one time member fee of $99 (USD).  There is no way out of this fee, but you might earn it back in triplicate if your app is worthy!  Truly though, you DO get a lot for your $99. For one, you get access to some of the coolest people on this side of Pluto!

Step 11: Have Others Test Your App

Once you pay your fee, you will be able to have others in the app community test your app and help you work out final bugs.  This is a great community, and testing new stuff is lots of fun. If you are a newbie like me, you will be in awe of the kings and queens of geeky stardom. Depending on the nature and complexity of your app, this process can take some time.

Step 12: Submit Your App For Approval

After testing your app in the community and working out all the bumps, you can submit the app to iTunes for approval.  You will be able to upload it right from the community.  The process of approval can take some time, so be patient!

Step 13: Watch The Dough & Traffic Roll In!

If you created a paid app, just wait for the money to roll in to shore. If you created a free app, watch the traffic!

Monday, December 16, 2013

Difference between Unicode, UTF-8 and UTF-16 (Unicode vs UTF-8 vs UTF-16)

Difference between Unicode, UTF-8 and UTF-16 (Unicode vs UTF-8 vs UTF-16)

Unicode is a character set. UTF-8 and UTF-16 are both encodings of Unicode. 

A character set is a list of characters with unique numbers (these numbers are sometimes referred to as "code points"). For example, in the Unicode character set, the number for A is 41.

An encoding on the other hand, is an algorithm that translates a list of numbers to binary so it can be stored on disk. For example UTF-8 would translate the number sequence 1, 2, 3, 4 like this:

00000001 00000010 00000011 00000100 

Our data is now translated into binary and can now be saved to disk.

All together now

Say an application reads the following from the disk:

1101000 1100101 1101100 1101100 1101111 

The app knows this data represent a Unicode string encoded with UTF-8 and must show this as text to the user. First step, is to convert the binary data to numbers. The app uses the UTF-8 algorithm to decode the data. In this case, the decoder returns this:

104 101 108 108 111 

Since the app knows this is a Unicode string, it can assume each number represents a character. We use the Unicode character set to translate each number to a corresponding character. 

The resulting string is "hello".

Historical Artifact from Microsoft

The development of Unicode was aimed at creating a new standard for mapping the characters in a great majority of languages that are being used today, along with other characters that are not that essential but might be necessary for creating the text. UTF-8 is only one of the many ways that you can encode the files because there are many ways you can encode the characters inside a file into Unicode.

UTF-8 was developed with compatibility in mind. ASCII was a very prominent standard and people who already had their files in the ASCII standard might hesitate in adopting Unicode because it would break their current systems. UTF-8 eliminated this problem as any file encoded that only has characters in the ASCII character set would result in an identical file, as if it was encoded with ASCII. This allowed people to adopt Unicode without needing to convert their files or even changing their current legacy software that was unaware of the Unicode standard. Any of the other mapping methods for Unicode breaks compatibility with ASCII and would force people to convert their system.

The observance of compatibility to ASCII of UTF-8 produces a side-effect that makes it ideal for word processing where most of the time, all the characters being used are included in the ASCII character set. UTF-8 only uses a byte to represent every code point resulting in a file size that is half to the same file encoded in UTF-16 which uses 2 bytes, and a quarter to the same file encoded in UTF-32 which uses 4.

UTF-8 has been adopted in the World Wide Web because it is both space efficient and byte oriented. Web pages are often simple text files that usually do not contain any character that is outside the ASCII character set. Using other encoding methods would only increase the network load without any benefit. Even in email transport systems, UTF-8 is slowly but surely being adopted as a replacement for the older encoding systems that are still being used.

Summary:

1. Unicode is the standard for computers to display and manipulate text while UTF-8 is one of the many mapping methods for Unicode. 

2. UTF-8 is a mapping method the retains compatibility with the older ASCII

3. UTF-8 is the most space efficient mapping method for Unicode compared to other encoding methods

4. UTF-8 is the most used Unicode standard for the web

Conclusion

UTF-8 and Unicode cannot be compared. UTF-8 is an encoding used to translate binary data into numbers. Unicode is a character set used to translate numbers into characters.