This document discusses lessons learned from migrating an application from Objective-C to Swift. It covers various challenges such as interoperability between the two languages, handling optionals and enums, and migrating Objective-C code and patterns to Swift equivalents. Recommendations are provided such as starting the migration with files without subclasses, using Swift features selectively, and adopting a file-by-file migration approach. Potential issues with architectures like MVC and patterns like delegation are also addressed.
This document provides an overview of the Django web framework. It begins with definitions of Django and the MTV architectural pattern it follows. It then explains the differences between MTV and traditional MVC. Models, templates, and views are described as the core components of MTV. The document outlines Django's installation process and project structure. It also discusses Django's database API and advantages such as ORM support, multilingualism, and administration interfaces. Popular websites that use Django are listed before the document concludes by praising Django's security features and database API.
The document provides an introduction and overview of ES6, React, and Redux. It begins with an in-depth section about new features and syntax in ES6, including variable types, arrow functions, modules, classes, and more. It then discusses React, explaining concepts like the virtual DOM, one-way data flow, JSX syntax, props, nested components, conditionals, and state/setState. Finally, it briefly introduces Redux and mentions using React components on the server and in mobile apps with React Native.
Objective-C is how we¡¯ve built Mac and iOS apps for many years. It¡¯s a huge part of the landscape of Apple Development. And, here comes Swift which is only a year old but with lot of promises and features.
From Philly Tech Week 2016 Dev Talks http://2016.phillytechweek.com/events/dev_talks.
Learning a new language is what we do. It¡¯s fun, it¡¯s reinvigorating, and it¡¯s challenging. It¡¯s why we do what we do. But it¡¯s not often that you learn a brand new language and then implement it side by side in a code base with another language. Especially when the other language is sad because it knows you are replacing it and it doesn¡¯t want to play nice with the new guy. At URBN, we made a decision to write Swift for all new code even though several of our apps are 100% Objective-C. There were challenges, like learning a new language while trying to still push production feature releases, or stumbling through interoperability. But we¡¯ve figured it out (we think). We¡¯ll take a look at some actual code and some of the things we did to make this process as seamless as possible without introducing too much technical debt for the long run.
The document discusses Istio, an open source service mesh that provides traffic management, resilience, and security for microservices applications. It begins with an overview of microservices and common challenges in managing microservices applications. It then introduces Istio and its components that address these challenges, such as intelligent routing, policy enforcement, and telemetry collection. Specific Istio features like traffic control, splitting, and mirroring are demonstrated. Finally, it provides instructions for getting started with Istio and links for additional information.
This document discusses object-oriented programming concepts like classes, inheritance, and polymorphism.
It begins with an overview of classes, explaining that classes contain instance variables and methods. Classes can extend other classes through inheritance, allowing subclasses to override or add new functionality. References can point to objects of a class or any superclass.
The document then discusses polymorphism, where the decision of which method to call is determined at runtime based on the actual object type. This allows subclasses to be used through their parent class references. The summary cautions that direct concrete inheritance can cause issues if not used carefully, such as violating the Liskov substitution principle.
Microservices Architectures (aka Distributed Architectures) are the new paradigm to develop and deploy applications in Cloud environments. These architectures resolve several problems and improve the new life cycle in DevOps teams, however new challenges should be resolved or managed.
OpenShift Service Mesh (based in Istio, Kiali, Jaeger) allows us to manage this new paradigm easily without to change our current applications.
These slides will introduce you in OpenShift Service Mesh as a new component on OpenShift to manage your microservices architectures. Carlos Vicens worked on it with me.
ºÝºÝߣs used during a coordinated meetup between three different groups in Madrid:
- OpenShift Madrid Group: https://www.meetup.com/es/openshift_spain/events/258188248/
- Microservices Madrid Group: https://www.meetup.com/es-ES/Microservicios/events/258188068/
- Madrid Spring User Group: https://www.meetup.com/es/madrid-spring-user-group/events/258322835/
This document discusses different API design options like REST, gRPC, and GraphQL. It provides an overview of Apache Cassandra and describes a methodology for designing APIs that involves modeling the data, workflows, and technologies. A decision tree is presented to analyze criteria for different APIs like performance, data integrity, and developer experience to determine which option is best. REST is best for CRUD APIs, gRPC for high performance services, and GraphQL for complex queries.
Serhiy Kalinets "Building Service Mesh with .NET Core"Fwdays
?
There is a lot of hype around service mesh happening right now. It¡¯s a new concept that solves common problems related to microservices: observability, traffic management, security and so on.
In this session Serhiy will introduce the idea of service mesh and show how to use it with the latest release of .NET Core to build lightweight microservices with minimal efforts. And of course, we will see how it works in action.
Moving your application into a container and deploying it to
production is a great first step towards taking advantage of
containerization. This gets you past "works on my machine", and Docker
makes this easy. But the real value of containers -- fast immutable
deployments, maximizing resource utilization, and bare-metal
performance -- comes from an architecture optimized for containers.
This is container-native architecture.
Tim will explore the story of a real-world large scale production
microservices deployment of Docker, and the challenges faced in both
design and operations of migrating this kind of multi-faceted
application to a container-native architecture.
KubeCon schedule link: http://sched.co/4eO0
This document compares the programming languages Java and C#. It discusses that C# was developed with the .NET framework in mind and is intended to be the primary language for .NET development. It outlines some subtle syntactic differences between the languages, like how print statements and inheritance are defined. It also examines some concepts that are modified in C# compared to Java, such as polymorphism and operator overloading. Finally, it presents some new concepts in C# that do not exist in Java, including enums, foreach loops, and properties.
This document provides an overview of key concepts in C++ including:
- Similarities and differences between C and C++ and how that impacts language selection
- Common C++ concepts like namespaces, functions, variables, statements, and data types
- Object-oriented programming principles in C++ like encapsulation, inheritance, and polymorphism
- Additional C++ features like templates, the standard template library (STL), streams, files, and exceptions handling
It aims to help readers understand fundamental C++ concepts to get started with application development.
This document provides an overview of key concepts in C++ including:
- Similarities and differences between C and C++ and how that impacts language selection
- Common C++ concepts like namespaces, functions, variables, statements, and data types
- Object-oriented programming principles in C++ like encapsulation, inheritance, and polymorphism
- Additional C++ features like templates, the standard template library (STL), streams, and exceptions handling
The document is intended as a high-level introduction and reference for C++ concepts.
Newspeak: Evolving Smalltalk for the Age of the NetESUG
?
This document discusses Newspeak, an evolution of Smalltalk designed for the modern web. Newspeak aims to improve on Smalltalk's modularity, security, and interoperability using message-based programming and an object capability model without static state. It also aims to support cloud computing by enabling network-serviced applications that can run locally but sync seamlessly with server-hosted software and data.
Here are the key points about classes and metaclasses in Objective-C:
- Every Objective-C class is an instance of another class called its metaclass. The metaclass allows the class to receive and respond to messages.
- The root class is called Class. All other classes are subclasses of Class.
- When you send a message to a class like [MyClass foo], it is actually sending the message to the metaclass of MyClass, not to MyClass itself. The metaclass handles class methods and behaviors.
- The isa pointer in the class structure points to the metaclass, not the superclass. This allows classes to behave like objects and receive messages.
- So in summary, classes are objects (instances
- What is Kubernetes
- Why we need Kubernetes
- Demo how to deploy application on Kubernetes
Jirayut Nimsaeng
Founder & CEO
Opsta (Thailand) Co., Ltd.
Facebook Record: https://www.facebook.com/ThaiProgrammerSociety/videos/1908659749331066
Coder Live with Thai Programmer Association
June 6, 2022
This document discusses object-oriented programming concepts like classes, objects, encapsulation, inheritance, polymorphism, and more. It provides examples of defining classes with data members and member functions, creating objects, passing objects as arguments, and using constructors and destructors. Key points include how memory is allocated for classes and objects, characteristics of constructors, constructor overloading, and examples of programs using constructors and destructors to print student details.
Java vs. C#
The document compares Java and C# programming languages. It discusses some key differences:
1. Syntax differences such as main method signatures, print statements, and array declarations are slightly different between the two languages.
2. Some concepts are modified in C# from Java, such as polymorphism requiring the virtual keyword, operator overloading restrictions, and switch statements allowing string cases.
3. C# introduces new concepts not in Java like enumerations, foreach loops, properties to encapsulate fields, pointers in unsafe contexts, and passing arguments by reference.
Objective-C is how we¡¯ve built Mac and iOS apps for many years. It¡¯s a huge part of the landscape of Apple Development. And, here comes Swift which is only a year old but with lot of promises and features.
From Philly Tech Week 2016 Dev Talks http://2016.phillytechweek.com/events/dev_talks.
Learning a new language is what we do. It¡¯s fun, it¡¯s reinvigorating, and it¡¯s challenging. It¡¯s why we do what we do. But it¡¯s not often that you learn a brand new language and then implement it side by side in a code base with another language. Especially when the other language is sad because it knows you are replacing it and it doesn¡¯t want to play nice with the new guy. At URBN, we made a decision to write Swift for all new code even though several of our apps are 100% Objective-C. There were challenges, like learning a new language while trying to still push production feature releases, or stumbling through interoperability. But we¡¯ve figured it out (we think). We¡¯ll take a look at some actual code and some of the things we did to make this process as seamless as possible without introducing too much technical debt for the long run.
The document discusses Istio, an open source service mesh that provides traffic management, resilience, and security for microservices applications. It begins with an overview of microservices and common challenges in managing microservices applications. It then introduces Istio and its components that address these challenges, such as intelligent routing, policy enforcement, and telemetry collection. Specific Istio features like traffic control, splitting, and mirroring are demonstrated. Finally, it provides instructions for getting started with Istio and links for additional information.
This document discusses object-oriented programming concepts like classes, inheritance, and polymorphism.
It begins with an overview of classes, explaining that classes contain instance variables and methods. Classes can extend other classes through inheritance, allowing subclasses to override or add new functionality. References can point to objects of a class or any superclass.
The document then discusses polymorphism, where the decision of which method to call is determined at runtime based on the actual object type. This allows subclasses to be used through their parent class references. The summary cautions that direct concrete inheritance can cause issues if not used carefully, such as violating the Liskov substitution principle.
Microservices Architectures (aka Distributed Architectures) are the new paradigm to develop and deploy applications in Cloud environments. These architectures resolve several problems and improve the new life cycle in DevOps teams, however new challenges should be resolved or managed.
OpenShift Service Mesh (based in Istio, Kiali, Jaeger) allows us to manage this new paradigm easily without to change our current applications.
These slides will introduce you in OpenShift Service Mesh as a new component on OpenShift to manage your microservices architectures. Carlos Vicens worked on it with me.
ºÝºÝߣs used during a coordinated meetup between three different groups in Madrid:
- OpenShift Madrid Group: https://www.meetup.com/es/openshift_spain/events/258188248/
- Microservices Madrid Group: https://www.meetup.com/es-ES/Microservicios/events/258188068/
- Madrid Spring User Group: https://www.meetup.com/es/madrid-spring-user-group/events/258322835/
This document discusses different API design options like REST, gRPC, and GraphQL. It provides an overview of Apache Cassandra and describes a methodology for designing APIs that involves modeling the data, workflows, and technologies. A decision tree is presented to analyze criteria for different APIs like performance, data integrity, and developer experience to determine which option is best. REST is best for CRUD APIs, gRPC for high performance services, and GraphQL for complex queries.
Serhiy Kalinets "Building Service Mesh with .NET Core"Fwdays
?
There is a lot of hype around service mesh happening right now. It¡¯s a new concept that solves common problems related to microservices: observability, traffic management, security and so on.
In this session Serhiy will introduce the idea of service mesh and show how to use it with the latest release of .NET Core to build lightweight microservices with minimal efforts. And of course, we will see how it works in action.
Moving your application into a container and deploying it to
production is a great first step towards taking advantage of
containerization. This gets you past "works on my machine", and Docker
makes this easy. But the real value of containers -- fast immutable
deployments, maximizing resource utilization, and bare-metal
performance -- comes from an architecture optimized for containers.
This is container-native architecture.
Tim will explore the story of a real-world large scale production
microservices deployment of Docker, and the challenges faced in both
design and operations of migrating this kind of multi-faceted
application to a container-native architecture.
KubeCon schedule link: http://sched.co/4eO0
This document compares the programming languages Java and C#. It discusses that C# was developed with the .NET framework in mind and is intended to be the primary language for .NET development. It outlines some subtle syntactic differences between the languages, like how print statements and inheritance are defined. It also examines some concepts that are modified in C# compared to Java, such as polymorphism and operator overloading. Finally, it presents some new concepts in C# that do not exist in Java, including enums, foreach loops, and properties.
This document provides an overview of key concepts in C++ including:
- Similarities and differences between C and C++ and how that impacts language selection
- Common C++ concepts like namespaces, functions, variables, statements, and data types
- Object-oriented programming principles in C++ like encapsulation, inheritance, and polymorphism
- Additional C++ features like templates, the standard template library (STL), streams, files, and exceptions handling
It aims to help readers understand fundamental C++ concepts to get started with application development.
This document provides an overview of key concepts in C++ including:
- Similarities and differences between C and C++ and how that impacts language selection
- Common C++ concepts like namespaces, functions, variables, statements, and data types
- Object-oriented programming principles in C++ like encapsulation, inheritance, and polymorphism
- Additional C++ features like templates, the standard template library (STL), streams, and exceptions handling
The document is intended as a high-level introduction and reference for C++ concepts.
Newspeak: Evolving Smalltalk for the Age of the NetESUG
?
This document discusses Newspeak, an evolution of Smalltalk designed for the modern web. Newspeak aims to improve on Smalltalk's modularity, security, and interoperability using message-based programming and an object capability model without static state. It also aims to support cloud computing by enabling network-serviced applications that can run locally but sync seamlessly with server-hosted software and data.
Here are the key points about classes and metaclasses in Objective-C:
- Every Objective-C class is an instance of another class called its metaclass. The metaclass allows the class to receive and respond to messages.
- The root class is called Class. All other classes are subclasses of Class.
- When you send a message to a class like [MyClass foo], it is actually sending the message to the metaclass of MyClass, not to MyClass itself. The metaclass handles class methods and behaviors.
- The isa pointer in the class structure points to the metaclass, not the superclass. This allows classes to behave like objects and receive messages.
- So in summary, classes are objects (instances
- What is Kubernetes
- Why we need Kubernetes
- Demo how to deploy application on Kubernetes
Jirayut Nimsaeng
Founder & CEO
Opsta (Thailand) Co., Ltd.
Facebook Record: https://www.facebook.com/ThaiProgrammerSociety/videos/1908659749331066
Coder Live with Thai Programmer Association
June 6, 2022
This document discusses object-oriented programming concepts like classes, objects, encapsulation, inheritance, polymorphism, and more. It provides examples of defining classes with data members and member functions, creating objects, passing objects as arguments, and using constructors and destructors. Key points include how memory is allocated for classes and objects, characteristics of constructors, constructor overloading, and examples of programs using constructors and destructors to print student details.
Java vs. C#
The document compares Java and C# programming languages. It discusses some key differences:
1. Syntax differences such as main method signatures, print statements, and array declarations are slightly different between the two languages.
2. Some concepts are modified in C# from Java, such as polymorphism requiring the virtual keyword, operator overloading restrictions, and switch statements allowing string cases.
3. C# introduces new concepts not in Java like enumerations, foreach loops, properties to encapsulate fields, pointers in unsafe contexts, and passing arguments by reference.
26. FILE BY FILE
MIGRATION ?
IS THE MOST
EFFECTIVE WAYChild2
Base
Child1
Class2
Class4
Class3
27. START WITH ?
FILES WITHOUT
SUBCLASSES
Child2
Base
Child1
Class2
Class4
Class3
YOU CANNOT SUBCLASS
A SWIFT CLASS IN
OBJECTIVE-C
28. SWIFT CLASS MUST BE
A DESCENDANT OF AN
OBJECTIVE-C CLASS?
¡TO BE ACCESSIBLE
IN OBJECTIVE-C FILES
Child2
Base
Child1
Class4
Class3
NSObject
29. SWIFT CLASS MUST BE
A DESCENDANT OF AN
OBJECTIVE-C CLASS?
Child2
Base
Child1
Class4
Class3
NSObject
OBJECTIVE-C WILL NOT BE
ABLE TO TRANSLATE CERTAIN
SWIFT-SPECIFIC FEATURES
31. Mix-and-match functionality makes it easy to choose
which features and functionality to implement in
Swift, and which to leave in Objective-C.
Interoperability makes it possible to integrate those
features back into Objective-C code with no hassle.
Apple Inc. ¡°Using Swift with Cocoa and Objective-C (Swift 3).¡±
34. BUNDLE SIZE
22 MB 38 MB
YES FOR THE WATCHOS APP
NO FOR THE WATCHOS APP EXTENSION
Always Embed Swift Standard Libraries
?
37. IN OBJECTIVE-C
HEADER FILES ONLY
USE FORWARD
DECLARATIONS
NSObject
@class ClassName;
@protocol ProtocolName;
IMPORTING A SWIFT HEADER FILE
THERE WILL LEAVE YOU WITH
A CIRCULAR REFERENCE.
38. IF BOTH SWIFT AND
OBJECTIVE-C CLASSES
ARE IN THE SAME
APPLICATION PROJECT
NSObject
#import "ModuleName-Swift.h"
39. IF BOTH SWIFT AND
OBJECTIVE-C CLASSES
ARE IN THE SAME
COCOA POD PROJECT
NSObject
#import <PodName/PodName-Swift.h>
40. IF SWIFT FILE IS ?
IN ANOTHER POD
NSObject
@import PodName;
41. IF SWIFT FILE IS ?
IN ANOTHER POD
NSObject
@import PodName;
ADD *.SWIFT FILES TO
SOURCE_FILES DECLARATION ?
IN PODSPEC FILE
43. MUST BE A DESCENDANT ?
OF AN OBJECTIVE-C CLASS
WILL NOT BE VISIBLE?
IN OBJECTIVE-C
INT?, INT!, FLOAT?, ¡
SOME NAMES ARE ALREADY IN
USE IN NSOBJECT
description: String
SWIFT CLASSES CANNOT BE
SUBCLASSED IN OBJECTIVE-C
objc_subclassing_restricted
METHODS WITH NIL
TERMINATION WILL BE NOT
ACCESSIBLE IN SWIFT
NS_REQUIRES_NIL_TERMINATION
DEALLOC IS UNAVAILABLE ?
IN SWIFT, BUT YOU CAN USE
DEINIT INSTEAD
dealloc != deinit
45. ENUM SHOULD HAVE THE
@OBJC PREFIX
@objc prefix
ASSOCIATED VALUES ?
ARE NOT SUPPORTED
case variant1(value: Int)
IN OBJECTIVE-C ENUM CAN
ONLY HAVE INTEGER TYPE
@enum Name: Int
46. CASE STUDY: MIGRATING FROM OBJECTIVE-C TO SWIFT
RawRepresentable enum for ObjectMapper?
? Model should provide wrapper for Obj-C code:
? Translation to enum: Int ?
during mapping transformation or in runtime
? Computed property `isActive: Bool`, `is¡: Bool`
47. CASE STUDY: MIGRATING FROM OBJECTIVE-C TO SWIFT
API Endpoints as URLRequestConvertible enums?
? Create a proxy class (inherited from NSObject) with class
requests methods, that inside will use Swift enum
? We decided to only de?ne methods really used by Obj-C?
?
?
?
?
?
More about elegant API Endpoints in Alamo?re?
https://github.com/Alamo?re/Alamo?re#crud--authorization
49. CASE STUDY: MIGRATING FROM OBJECTIVE-C TO SWIFT
NSCoding
? NSKeyedArchiver, NSKeyedUnarchiver will see only
properties visible for Objective-C
? We can change properties type or¡
50. CASE STUDY: MIGRATING FROM OBJECTIVE-C TO SWIFT
NSCoding
? NSKeyedArchiver, NSKeyedUnarchiver will see only
properties visible for Objective-C
? We can change properties type or¡
? Use value(forUnde?nedKey key: String) -> Any? and
setValue(_ value: Any?, forUnde?nedKey key: String)?
to set/get not bridged properties
? Example: Use enum¡¯s rawValue as encodable value
52. CASE STUDY: MIGRATING FROM OBJECTIVE-C TO SWIFT
Future? Swift Archival & Serialization proposal
? It aims to provide a solution for the archival of Swift struct
and enum types
? It aims to provide a more type-safe solution for serializing
to external formats, such as JSON and plist
? Read more: https://github.com/itaiferber/swift-evolution/
blob/swift-archival-serialization/proposals/XXXX-swift-
archival-serialization.md
55. CASE STUDY: MIGRATING FROM OBJECTIVE-C TO SWIFT
enum ServiceError: Error {}
? Error type in Obj-C code? ?
NSError without associated values¡
56. CASE STUDY: MIGRATING FROM OBJECTIVE-C TO SWIFT
enum ServiceError: Error {}
? Error type in Obj-C code? ?
NSError without associated values¡
? CustomNSError protocol: Describes an error type that
speci?cally provides a domain, code, and user-info
dictionary?
?
?
More: https://github.com/apple/swift-evolution/blob/
master/proposals/0112-nserror-bridging.md
61. CASE STUDY: MIGRATING FROM OBJECTIVE-C TO SWIFT
Optional(?2000 PLN¡±)
? Swift 3.1 will actually actually raise ?
a warning when you use an optional ?
in string interpolation?
?
?
?
?
?
?
More: https://oleb.net/blog/2016/12/optionals-string-
interpolation