Overriding in Swift programming

This article is a continuation from previous article

A subclass can provide its own custom implementation of an instance method, class method, instance property, class property, or subscript that it would otherwise inherit from a superclass. This is known as overriding.
When you provide a method, property, or subscript override for a subclass, it is sometimes useful to use the existing superclass implementation as part of your override. For example, you can refine the behavior of that existing implementation, or store a modified value in an existing inherited variable.

Overriding Methods:

You can override an inherited instance or class method to provide a tailored or alternative implementation of the method within your subclass.

The following example defines a new subclass of Vehicle called Train, which overrides the makeNoise method that Train inherits from Vehicle:

class Train: Vehicle {
    override func makeNoise() {
        println("Choo Choo")
    }
}

If you create a new instance of Train and call its makeNoise method, you can see that the Train subclass version of the method is called:

let train = Train()
train.makeNoise()
// prints "Choo Choo"

Overriding Properties:

You can override an inherited instance or class property to provide your own custom getter and setter for that property, or to add property observers to enable the overriding property to observe when the underlying property value changes.

Overriding Property Observers:

You can use property overriding to add property observers to an inherited property. This enables you to be notified when the value of an inherited property changes, regardless of how that property was originally implemented.

Inheritance in Swift programming language

A class can inherit methods, properties, and other characteristics from another class. When one class inherits from another, the inheriting class is known as a subclass, and the class it inherits from is known as its superclass. Inheritance is a fundamental behavior that differentiates classes from other types in Swift.

Let us check with one example:

The example below defines a base class called Vehicle. This base class defines a stored property called currentSpeed, with a default value of 0.0 (inferring a property type of Double). The currentSpeed property’s value is used by a read-only computed String property called description to create a description of the vehicle.

The Vehicle base class also defines a method called makeNoise. This method does not actually do anything for a base Vehicle instance, but will be customized by subclasses of Vehicle later on:

class Vehicle {
    var currentSpeed = 0.0
    var description: String {
        return "traveling at \(currentSpeed) miles per hour"
    }
    func makeNoise() {
        // do nothing - an arbitrary vehicle doesn't necessarily make a noise
    }
}

////////////Create one object of Vehicle class///////////////
let someVehicle = Vehicle()
rintln(“Vehicle: \(someVehicle.description)”)
// Vehicle: traveling at 0.0 miles per hour

Subclassing is the act of basing a new class on an existing class. The subclass inherits characteristics from the existing class, which you can then refine. You can also add new characteristics to the subclass.

To indicate that a subclass has a superclass, write the subclass name before the superclass name, separated by a colon:

class Bicycle: Vehicle {
var hasBasket = false
}

By default, any new Bicycle instance you create will not have a basket. You can set the hasBasket property to true for a particular Bicycle instance after that instance is created:

let bicycle = Bicycle()
bicycle.hasBasket = true
You can also modify the inherited currentSpeed property of a Bicycle instance, and query the instance’s inherited description property:

bicycle.currentSpeed = 15.0
println(“Bicycle: \(bicycle.description)”)
// Bicycle: traveling at 15.0 miles per hour

Subclasses can themselves be subclassed. The next example creates a subclass of Bicycle for a two-seater bicycle known as a “tandem”:
class Tandem: Bicycle {
var currentNumberOfPassengers = 0
}
Tandem inherits all of the properties and methods from Bicycle, which in turn inherits all of the properties and methods from Vehicle. The Tandem subclass also adds a new stored property called currentNumberOfPassengers, with a default value of 0.

If you create an instance of Tandem, you can work with any of its new and inherited properties, and query the read-only description property it inherits from Vehicle:

let tandem = Tandem()
tandem.hasBasket = true
tandem.currentNumberOfPassengers = 2
tandem.currentSpeed = 22.0
println(“Tandem: \(tandem.description)”)
// Tandem: traveling at 22.0 miles per hour

Closures in Swift programming

Closures are self-contained blocks of functionality that can be passed around and used in your code. Closures in Swift are similar to blocks in C and Objective-C and to lambdas in other programming languages.

Closure expression syntax has the following general form:

{ (parameters) -> return type in
statements
}

The example below shows a closure expression:

let names = [“Chris”, “Alex”, “Ewa”, “Barry”, “Daniella”]
reversed = sorted(names, { (s1: String, s2: String) -> Bool in
return s1 > s2
})

Enumerations in Swift programming language

An enumeration defines a common type for a group of related values and enables you to work with those values in a type-safe way within your code.

Enumeration Syntax:

enum SomeEnumeration {
// enumeration definition goes here
}

Here’s an example for the four main points of a compass:

enum CompassPoint {
case North
case South
case East
case West
}

You can match individual enumeration values with a switch statement:

directionToHead = .South
switch directionToHead {
case .North:
println(“Lots of planets have a north”)
case .South:
println(“Watch out for penguins”)
case .East:
println(“Where the sun rises”)
case .West:
println(“Where the skies are blue”)
}

Google Compute Engine: An Overview

Google Compute Engine: An Overview

Google Compute Engine: An Overview

The world of cloud computing has seen many players but the major player so far has been Google with the Google compute engine. This is infrastructure as a service where you get to power new and existing applications with the virtual machines running on the massive Google infrastructure. There are a lot of different configurations that are available which can also be modified in order to fit your needs. With a Linux kernel, you are assured of getting the maximum utilization from your computing needs. Security is also assured since the virtual machines run on a stable operating system.

Cost

In terms of cost, the Google compute engine is the most cost effective cloud computing solution available. You only get to pay for what you use and there is no payment needed upfront. This way, you can save a lot of money that you would have otherwise spent on buying servers and maintaining them. The billing is also very flexible and you can enjoy minute-level billing increments which show you how much you are using every minute. You will not be asked to pay for computational minutes that you have not used hence saving you a lot of money. This is also very accountable since the reports show your exact usage and how much you are expected to pay. This way, accounting in your company when it comes to computing resources becomes a breeze.

Security

There is high data security when you are using the Google compute engine infrastructure for your data storage needs. All data stored on the Google compute engine must be encrypted using the latest 128 bit encryption algorithm in order to ensure that the data stays safe at all times and attackers are unable to access this data.

Fast and Simple Provisioning

You can be up and running with the Google compute engine in no time at all thanks to the very intuitive and easy to use tools that you are provided with such as memcache. You can deploy a huge cluster of virtual machines to service your needs in no time at all.

Large Powerful Disks

With the storage scale provided by Google, you can create up to 10terabyte disk volumes which offer very strong and predictable storage performance. No matter how big your files are, you will never lack space to place your files in.

Green Computing

The data centers provided by Google are way more efficient than traditional ones. These data centers have achieved the highest certification of environmental standards so you get to benefit from the cost savings delivered by highly optimized facilities.

Load Balancing

With native load balancing, you can spread your traffic across a pool of instances in order to maximize throughput, performance and availability of your application or site in a cost effective manner. No matter how many people are accessing your site or application at the same time, you can rest assured that they will get the same level of high quality service. In conclusion, the Google compute engine is a true game changer when it comes to cloud computing.

Google Cloud Singapore

Have you ever thought about utilizing the power of cloud computing for your business? Well, with Google cloud Singapore, you can easily harness the power of Google cloud platform for your business or company. There is a lot that is involved with cloud computing and getting the best cloud service provider is the first step in the right direction. With a reputable cloud service provider, you are assured of your business being online all the time and scaling up and down automatically depending on the load on the servers.

Google Cloud

With a business, you do not necessarily have to purchase the costly computing equipment needed to run your site or applications. For the enterprise, you can simply take advantage of the fact that Google has provided their computing infrastructure in order for you to get your business up and running in no time at all. Google cloud Singapore offers world class Google compute engine hosting and management for all types of business. You will have access to a large computing scale at a very affordable cost. No longer do you have to worry about server management and maintenance since it is all taken care for you hence reducing your costs.

Your business can run very cost-effectively on the Google computing infrastructure. You are able to access your files from various locations and devices as long as you provide the right authentication credentials. Given the fact that permissions can be set and tuned to fit with the security policies of your company, you never again have to worry about someone gaining unauthorized access to your data.

The files that you rely on in order to run your business on the cloud will always be kept safe on the cloud and replicated on multiple servers for backup. In case your data has grown too big, you can easily scale up the storage in order to fit your new needs. There is no day you will ever be lacking in storage or running out of free disk space as long as you are using the Google cloud platform. With your files safe in the cloud, you can run your business all year round without having to worry about a thing.

Speed and efficiency are the main benefits you get while using the massive computing scale that Google provides. Not only will your clients be able to access your site faster, but the user experience will also be great since there will be no outage of services for any reason whatsoever. The pricing is also very cost effective and affordable for all. This means that you are able to pay a much cheaper price than you would have spent if you were to buy your own servers. There is also maximized efficiency since the resources that you are not using will not count towards your billing. You only pay for what you are using and nothing more. Indeed, Google cloud Singapore is your one stop solution for enterprise computing needs on a massive and scalable scale.

Cloud Hosting Training Singapore

The field of cloud computing is still relatively new. As such, there are not so many people who are well versed in utilizing resources on the cloud and deploying applications and sites successfully. This is why it is recommended to get the appropriate training first before you can venture into the cloud computing scene. There is no reason why you should not take up cloud hosting training Singapore as soon as you can in order to get started with the amazing world of cloud computing. In order to fully make use of the huge computing power that is placed at your fingertips with the world of cloud computing, you need to be trained on how you can properly harness this power for your needs.

Cloud Hosting Training Singapore

You will be taught from the very basics of cloud computing and server virtualization in order to give you enough foundational skills and concepts to get you started. Additionally, you will go through live training sessions where you get to work on real cloud computing systems and deploy applications and sites on them. It is important to note that there is more to cloud computing and cloud hosting apart from just the deployment. You need to ensure that the deployment environment is set up well in advance. This involves configuration of virtual machines and storage locations where everything will be running in later.

Most cloud hosting providers use Linux as their deployment and hosting environment so you will be taken through the basics of the UNIX kernel and the Linux operating environment. Having a knowledge of this will come in handy when you are setting up your own virtual machines for use in your business or company. Having a good basic knowledge of the Linux operating environment will also enable you to create virtual machines and cloud deployment environments that are stable and secure against all forms of attack.

Additionally, you will learn how to deploy a web server on the virtual machine in order to run your applications and sites. This involves setting a number of firewall rules that will restrict access to certain ports only. Having done that, you will be taught how to manage your web server such that there will be no interruptions. You will also learn how you can deploy the same instance across multiple servers which will act as a backup. This way, there will be no interruptions to business activities in case one of the servers goes down.

All in all cloud hosting training Singapore is a must have if you are serious about getting into the cloud computing field. Not only do you get the basic knowledge needed in order to deploy applications on the cloud, but also learn how you can manage applications that are running in the cloud in order to ensure the availability of data and applications even in case of unforeseen events. The practical sessions will also come in handy when you are doing it on your own since you will know how to go about doing something. You will never regret having gotten this training as it will serve you for years to come.

Cloud Hosting Setup Singapore

People looking to start making use of the cloud computing infrastructure are usually scared of the initial process of setting up the necessary resources needed in order to be up and running with the cloud platform. Not many people are familiar with the activities involved in setting up a cloud service and they are usually afraid of getting onto the cloud for this reason. Well, the good news is that for all those businesses and SMBs who are looking to explore the world of cloud computing, cloud hosting setup Singapore is the ultimate solution for you.

Cloud Hosting Setup

With our replicated setup, your data will be stored on more than two different servers so that in case of any unforeseen errors, your business till keeps on going without any interruption. We also get your applications ported to the cloud so that you can be able to access them from wherever you are. This involves making changes to the software programs you make use of in your business in order to optimize them for the cloud. In other cases, the programs are usually completely rewritten in order to make them compatible with the cloud. Though this may seem like a lot of work in the beginning, it really does pay off in the long run.

In order to maximize your cloud hosting experience, we have pay as you go hosting plans where you only pay for the much computing resources that you are using. This is actually a very affordable plan since you do not have to pay for anything upfront and the computing resources scale themselves automatically depending on the demand. For those times when there is peak demand from your clients, you need to ensure that your cloud resources scale themselves automatically in order to handle the extra load.

You will not run into any hardware or software bottlenecks with our professional cloud hosting setup Singapore services. Being in the cloud computing field since its early days, we have seen a lot of changes in terms of software and hardware upgrades. We are confident when we day that our services are the best and you will never regret working with us. You can be assured that your cloud deployment is in the right hands when you work with us. We will go to great lengths to ensure that you are successfully set up on the cloud platform and ready to go.

As an authority in the cloud computing field, we feel that your business should not be left out when it comes to the cloud computing field. There is a lot that you stand to gain from the cloud and setting it up in the right manner is the first step towards success for your business. There is a lot of things that are involved in setting up a cloud environment to run your applications and sites all of them needing vast knowledge in cloud infrastructure. With our knowledge, we are ready and willing to assist you get up and running in the cloud as soon as possible.

Cloud Hosting Migration Singapore

Making use of cloud services may seem like a bit of an issue for most people. Businesses see it a hassle to migrate their apps and data to the cloud. As a matter of fact, there is quite a bit of work that is involved in getting data, applications and services to the cloud and this is where the cloud hosting migration Singapore services come in handy. Suppose you are using one cloud hosting provider and you wish to more to another one, you do not have to lose any data or even start from scratch. Instead, you can simply rely on our trusted experts to help you with the process.

Cloud Hosting Migration Singapore

We will work with you through every step of the migration process in order to ensure that everything goes well. There are various differences between the various computing cloud types and this brings a bit of an issue if the migration is not done in the right manner. For instance, different clouds make use of different databases for their data storage. When migrating your data and services, it is important that you know all the tiny details that make a difference between the two cloud service providers and convert your data to do this.

There are also differences when it comes to the underlying cloud architecture. One cloud service provider may be running the virtual machines on Linux machines while the other one may be running theirs on windows machines. These differences have to be taken into account when you are migrating your services and data from one cloud provider to another one. You need to setup the new environment in such a way that there will be no interruption in the running of applications that are migrated from one provider to the new one.

When you are migrating from one provider to another one, it is important that the change is as smooth as possible so that your customers do not notice the difference. This means that the migration has to be done at a time when the interruption will not be easily noticed and the change has to happen as fast as possible. This requires the careful attention and expertise of a professional who is well versed with the cloud architecture and data migration from one cloud to the other one. With cloud hosting migration Singapore, you no longer need to worry about the interruption to your business since we are the best at what we do.

We have worked with a lot of clients in the past migrating data and applications from one cloud provider to the other with minimal interruption in the provision of services to customers. We understand that you need to have your business running all the time and we do our best to make sure that even during the migration process, your customers are still able to access the crucial parts of your business. Just leave it to the experts to do the migration for you as you focus on providing great services to your customers.

Cloud Hosting Consultant Singapore

Suppose you are an enterprise or SMB looking to integrate cloud computing into your business and IT strategies, then you need the services of a cloud hosting consultant Singapore. We have a whole team of experts with vast experience in the field of cloud computing and server virtualization. We work with you to ensure that your needs are fully taken care of and you get the best solution for your business needs. Having worked with a number of high profile clients in the past, we believe that we have what it takes to deploy a cloud solution for your business or company.

Cloud Hosting Consultant Singapore

The cloud computing field is still a new field with very few experts. We pride ourselves as being one of the first players in the field providing custom cloud services for our clients. We always listen to your needs and come up with tailor-made solutions for you. In terms of costs, we ensure that you get the best deal and get to save a lot of money when you use our cloud solutions. We will ensure that you no longer have to buy a server ever again as we move all your mission critical services to the cloud and replicate them across multiple servers for maximum uptime. You will be able to access your resources on the cloud at any time from any location in the world thanks to remote access from the internet. This is not to mean that your data will be at any risk. Cloud services are built to be very robust and secure. No longer will you have to worry about unauthorized access to your data as we harden the security around your applications and data residing on the cloud.

We will work with you to migrate your applications and data to the cloud platform letting you focus more on providing great services to your clients instead of having to keep worrying about non-core issues such as servers and maintenance. Your IT team will now be free to concentrate on more important things such as innovative new products instead of wasting their time on maintaining servers and doing the same repetitive things over and over again. With your IT team freed from maintenance tasks, you are in a better position to get better results with the same taskforce.

As more and more people look towards mobile apps as a way of doing business, we will ensure that you can have this for your business too. Enterprise cloud applications for your mobile devices can be developed so that your employees are able to work from anywhere they are in the world and still deliver good results. We are capable of creating and deploying large scale applications to fit whatever size of workforce you have.

We also have a proven track record working with all the major providers of cloud computing services such as Google and amazon. In conclusion, cloud hosting consultant Singapore is all you need in order to get your business up and running on the cloud in no time.