This document summarizes an agenda for a presentation on CDI 2.0. It provides background on the CDI specification timeline and key features of previous versions. The presentation will cover new CDI 2.0 features like Java SE support, enhanced events with ordering and asynchronous events, and metadata configurators. It will also discuss the status of CDI 2.0 and plans for upcoming features.
This document discusses big data and data science. It begins by questioning whether big data and data science are hype. It then discusses how companies can use data science techniques like A/B testing to continuously improve their online systems. The document provides examples of how recommender systems and anomaly detection can be improved using these techniques. It describes the data flow and challenges of training models offline and updating them online. It also discusses evaluating models offline and testing them online to identify the best performing models.
This document discusses Docker, DevAssistant, and how they can help with development workflows. It summarizes that Docker allows for containerization of applications and their dependencies to enable portable deployment. While Docker simplifies development in some ways, properly setting up related containers and services can be complex. DevAssistant aims to address this by providing plugins to automate common development tasks like initializing projects, installing dependencies, and configuring container-based environments. The document demonstrates how DevAssistant can help simplify using Docker for development. It concludes with information on a competition to earn a free beer by following instructions using DevAssistant.
What's New in JHipsterLand - Devoxx Poland 2017Matt Raible
JHipster is an application generator that allows you to create monoliths or microservices, based on Spring Boot and Angular. It leverages Spring Cloud for microservices and contains best-of-breed JavaScript and CSS libraries for creating your UI. In this session, you’ll learn about what’s new in JHipster. Topics include Angular 4, Progressive Web Apps, HTTP/2, JUnit 5 and Spring 5.
Monolith Demo: https://github.com/mraible/jhipster4-demo/blob/master/README.adoc
Microservices Demo: https://developer.okta.com/blog/2017/06/20/develop-microservices-with-jhipster
10 tips to become an awesome Technical Lead v2 (Devoxx PL)Bart Blommaerts
As you grow in your career, chances are that one day you will end up as the Technical Lead of 1 or more projects. Often not by choice. The role of Technical Lead is quite different from the role of (senior) Software Developer and this talk will bring you answers on questions like:
- How do I do technical interviews?
- How do I lead a team? How do I lead multiple teams?
- How do I cope with my new responsibilities?
- How do I cope with success / failure?
- How do I prevent losing focus on the technical challenges?
- …
In summary, everything you want(ed) to know on your first day as a Technical Lead and that you can use every day from that point onwards.
Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"Daniel Bryant
There is trouble brewing in the land of microservices – today’s shiny technology is tomorrow’s legacy, and there is concern that we will all be dealing with spaghetti services in 2018…
It is often a sign of an architectural approach’s maturity that, in addition to the emergence of well-established principles and practices, anti-patterns also begin to be identified and classified. In this talk we introduce the 2016 edition of the seven deadly sins that if left unchecked could easily ruin your next microservices project…
This talk will take a tour of some of the nastiest anti-patterns in microservices, giving you the tools to not only avoid but also slay these demons before they tie up your project in their own special brand of hell.
Topics covered include: Pride - selfishly ignoring the new requirements for testing; Envy - introducing inappropriate intimacy within services by creating a shared domain model; Wrath - failing to deal with the inevitable bad things that occur within a distributed system; Sloth - composing services in a lazy fashion, which ultimately leads to the creation of a “Distributed Monolith”; and Lust - embracing the latest, greatest (and costly) technology.
This document summarizes an agenda for a presentation on CDI 2.0. It provides background on the CDI specification timeline and key features of previous versions. The presentation will cover new CDI 2.0 features like Java SE support, enhanced events with ordering and asynchronous events, and metadata configurators. It will also discuss the status of CDI 2.0 and plans for upcoming features.
This document discusses big data and data science. It begins by questioning whether big data and data science are hype. It then discusses how companies can use data science techniques like A/B testing to continuously improve their online systems. The document provides examples of how recommender systems and anomaly detection can be improved using these techniques. It describes the data flow and challenges of training models offline and updating them online. It also discusses evaluating models offline and testing them online to identify the best performing models.
This document discusses Docker, DevAssistant, and how they can help with development workflows. It summarizes that Docker allows for containerization of applications and their dependencies to enable portable deployment. While Docker simplifies development in some ways, properly setting up related containers and services can be complex. DevAssistant aims to address this by providing plugins to automate common development tasks like initializing projects, installing dependencies, and configuring container-based environments. The document demonstrates how DevAssistant can help simplify using Docker for development. It concludes with information on a competition to earn a free beer by following instructions using DevAssistant.
What's New in JHipsterLand - Devoxx Poland 2017Matt Raible
JHipster is an application generator that allows you to create monoliths or microservices, based on Spring Boot and Angular. It leverages Spring Cloud for microservices and contains best-of-breed JavaScript and CSS libraries for creating your UI. In this session, you’ll learn about what’s new in JHipster. Topics include Angular 4, Progressive Web Apps, HTTP/2, JUnit 5 and Spring 5.
Monolith Demo: https://github.com/mraible/jhipster4-demo/blob/master/README.adoc
Microservices Demo: https://developer.okta.com/blog/2017/06/20/develop-microservices-with-jhipster
10 tips to become an awesome Technical Lead v2 (Devoxx PL)Bart Blommaerts
As you grow in your career, chances are that one day you will end up as the Technical Lead of 1 or more projects. Often not by choice. The role of Technical Lead is quite different from the role of (senior) Software Developer and this talk will bring you answers on questions like:
- How do I do technical interviews?
- How do I lead a team? How do I lead multiple teams?
- How do I cope with my new responsibilities?
- How do I cope with success / failure?
- How do I prevent losing focus on the technical challenges?
- …
In summary, everything you want(ed) to know on your first day as a Technical Lead and that you can use every day from that point onwards.
Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"Daniel Bryant
There is trouble brewing in the land of microservices – today’s shiny technology is tomorrow’s legacy, and there is concern that we will all be dealing with spaghetti services in 2018…
It is often a sign of an architectural approach’s maturity that, in addition to the emergence of well-established principles and practices, anti-patterns also begin to be identified and classified. In this talk we introduce the 2016 edition of the seven deadly sins that if left unchecked could easily ruin your next microservices project…
This talk will take a tour of some of the nastiest anti-patterns in microservices, giving you the tools to not only avoid but also slay these demons before they tie up your project in their own special brand of hell.
Topics covered include: Pride - selfishly ignoring the new requirements for testing; Envy - introducing inappropriate intimacy within services by creating a shared domain model; Wrath - failing to deal with the inevitable bad things that occur within a distributed system; Sloth - composing services in a lazy fashion, which ultimately leads to the creation of a “Distributed Monolith”; and Lust - embracing the latest, greatest (and costly) technology.
A Pannon Egyetemen fejlesztett felhő alapú workflow rendszer (ORENBI) back-end oldali fejlesztése alapján a Műszaki Informatikai karon tartott tanszéki szeminárum során előadott prezentációnk. A prezentáció témája az alkalmazott technológiák és architektúrális valamint TDD módszereink bemutatása és tapasztalataink átadása.
SCaLE 2016 - syslog-ng: From Raw Data to Big DataBalaBit
syslog-ng is an enhanced logging daemon, with a focus on central log collection. It collects logs from many different sources, processes and filters them and forwards them to a destination. This session focuses on how syslog-ng parses important information from incoming messages, how to send this information to “big data” destinations, like HDFS, Kafka, ElasticSearch or MongoDB.
Abstract: syslog-ng is an enhanced logging daemon, with a focus on central log collection. It collects logs from many different sources.
Raw log messages come in a variety of formats:
- lacking any structure most are usually just an almost proper English sentence with some variable parts in it, like user names or IP addresses.
- Fix table-like structure, like Apache access logs.
- A small minority of logs arrive in an already structured form: JSON.
Parsers in syslog-ng make it possible to extract important information from any of these messages and create name-value pairs.Once you have name-value pairs instead of raw log messages, you have many possibilities. On the syslog-ng side, you can use them for filtering, for example, to send an alert if the username is “root”. You can also use them in file names, or messages can be modified to facilitate log rotation or better suit applications processing the logs.
Parsing and preprocessing log messages also allows you to store them more effectively:
- you can send them to the destination (for example, ElasticSearch or MongoDB) in a format that can be easy to process (for example, JSON),
- you can filter irrelevant data, and forward only what is really needed,
- processing is off-loaded to very effective C code.
Finally you will learn about the “big data” destinations that syslog-ng supports, and how they benefit from message parsing:
- Hadoop Distributed File System ( HDFS ),
- Apache Kafka,
- ElasticSearch and Kibana, and
- MongoDB.
And if syslog-ng cannot already do something that you need, and you are not afraid of writing some code, you can learn about how language bindings of syslog-ng make it possible to add new destinations, not only in C, but also in Java, Lua, Perl, or Python.
Bio: Peter Czanik is community manager at Balabit, developers of syslog-ng. He helps distributions to maintain the syslog-ng package, follows bug trackers, helps users and talks regularly at conferences (FOSDEM, Libre Software Meeting, LOADays, Scale, etc.) In his limited free time he is interested in non-x86 architectures, and works on one of his PPC or ARM machines.
NIAS 2015 - The value add of open source for innovationBalaBit
(Balázs Scheidler, co-founder and CTO, BalaBit)
As a long term member of the Open Source community, I believe that the Open Source development model creates a great context for innovation to happen. In the open source world, collaboration and sharing are key principles. These principles put the problem to be solved in focus and tear down
organizational boundaries. An Open Source project is a space where the best engineers from multiple competing organizations work as a team on solving a common goal. This space and the direct connection to users boosts engineer motivation, creating trust and a virtuous circle that results in fast iterations: creating layers upon layers of work yielding a great product at a pace that is unrealistic in a proprietary software development setting. We can also see that the same values and principles start happening outside of the software realm: Wikipedia, Creative Commons and the Maker community confirms the approach works in other fields, which shows that it can be adapted to further situations to improve efficiency and innovation.
Les Assises 2015 - Why people are the most important aspect of IT security?BalaBit
Balázs Scheidler, co-founder and CTO of BalaBit holds a presentation about the importance of privileged users in IT security. He introduces BalaBit's approach to people-centric security - people centric security is a strategic approach to information security that emphasizes individual accountability and trust. It de-emphasizes restrictive, preventive security controls, while the monitoring of user activities is a fundamental element of people centric security.
Mr. Scheidler showcases how cooperates Blindspotter, BalaBit's UBA solution with its Privileged Activity Monitoring tool, Shell Control Box, and how does they provide an effective defense against Advanced Persistent Threats. A live demo of how an APT attack would be prevented will be also part of the presentation.
2015. Libre Software Meeting - syslog-ng: from log collection to processing a...BalaBit
Peter Czanik: syslog-ng - from log collection to processing and infomation extraction
2015. Libre Software Meeting
After a short introduction to system logging, we will show how the current log messages look like, and what the problem is with this free text format. Next, we will introduce you the powerful concept of name-value pairs, and how you can extract useful information from your logs by parsing log messages into name-value pairs. Next we will demonstrate the flexibility of syslog-ng’s message parsers (patterndb, csv and JSON parsers), and show you how to create patterns using a text editor or a GUI. This can also be used to overwrite sensitive information due to privacy regulations. At the end, you will learn about the Perl/Python/Lua/Java bindings of syslog-ng Open Source Edition, how value pairs can be passed to them, and some reference applications written for syslog-ng.
LOADays 2015 - syslog-ng - from log collection to processing and infomation e...BalaBit
Peter Czanik: syslog-ng - from log collection to processing and infomation extraction
LOADays 2015.
After a short introduction to system logging, we will show how the current log messages look like, and what the problem is with this free text format. Next, we will introduce you the powerful concept of name-value pairs, and how you can extract useful information from your logs by parsing log messages into name-value pairs. Next we will demonstrate the flexibility of syslog-ng’s message parsers (patterndb, csv and JSON parsers), and show you how to create patterns using a text editor or a GUI. This can also be used to overwrite sensitive information due to privacy regulations. At the end, you will learn about the Perl/Python/Lua/Java bindings of syslog-ng Open Source Edition, how value pairs can be passed to them, and some reference applications written for syslog-ng.
syslog-ng: from log collection to processing and information extractionBalaBit
This document discusses syslog-ng, an open source log collection and processing software. It begins with an introduction of the speaker and an overview of topics to be covered, including the basics of syslog-ng configuration, parsing structured log messages, using PatternDB to extract fields, and language bindings. The document then goes into more detail on sources, processing methods like filtering and parsing, and destinations for logs. It also provides an example configuration file and discusses tools for managing syslog-ng configurations.
The document discusses the shift from traditional IT security control models to contextual security through real-time monitoring. It advocates a prevention approach using monitoring to complement control. The BalaBit eCSI Suite is presented as a solution that provides reliable logging from multiple sources, high-performance monitoring, and real-time dashboards to enable prevention through intelligent data analysis and monitoring.
A recent eCSI survey reveals that nearly a quarter of IT professionals use firewalls as their only protection against malicious insiders and targeted attacks, which is completely ineffective for that purpose.
Hogyan maradj egészséges irodai munka mellett?BalaBit
Hogy kiknek szól ez a kiadvány? Amatőröknek. Pályakezdőknek. Újrakezdőknek. Sohaelnemkezdőknek. Mármint egészség fronton. Fájós háttal, úszógumival a derekukon munkában úszó sorstársainknak.
Hogy kiknek nem szól? Profiknak nem szól, mert ahhoz szándékosan kevés. Misztikus-egzotikus csodaprogramokat habzsoló divat-egészségeseknek sem szól, mert nincs könnyű út.
Csak egy út van.
Az alábbi pár oldalon összeszedtük a legfontosabb tanácsokat és megtámogattuk őket azokkal a tényeket, ami biológiából, anatómiából, kémiából stb... következik. Hiszünk benne, hogy a megértés segíti a tudás alkalmazását.
Log messages can be used to detect security incidents, operational problems, and other issues like policy violations, and are useful in auditing and forensics situations.
From this white paper you can learn the advantages of using the syslog-ng Store Box logserver appliance to collect, store, and manage system log (syslog) and eventlog messages for policy compliance.
Kontrolle und revisionssichere Auditierung privilegierter IT-ZugriffeBalaBit
In einem Unternehmen gibt es meist eine Vielzahl unbekannter privilegierter Benutzer: Systemadministratoren, Benutzer mit Zugriff auf vertrauliche Inhalte – besonders in IT-Architekturen, die mehrere Altsysteme enthalten.
This document discusses logging technologies including syslog-ng, journal, CEE/Lumberjack, and ELSA. It provides an overview of syslog and syslog-ng, describing how syslog-ng offers more functionality than traditional syslog. It also discusses the journal logging system, standardization efforts through CEE and Lumberjack, and how ELSA uses syslog-ng to provide log search and archival capabilities.
The document discusses the importance of proper logging during all phases of development. It describes what syslog is and introduces syslog-ng as the next generation syslog server. It emphasizes that logging should be an integral part of development and developers should consult with operators. The document also discusses logging best practices like using structured, name-value pair logging and centralized logging.
BalaBit develops Contextual Security Intelligence products that rely on real-time visibility of user behavior rather than predefined patterns to identify threats. It is best known for its open source syslog-ng log management solution with over 1 million users. BalaBit has offices globally and serves Fortune 100 customers through partners in over 40 countries to improve security through products like log management, privileged activity monitoring, and user behavior analytics.
More Related Content
Similar to Swift -Helyzetjelentés az iOS programozás új nyelvéről
A Pannon Egyetemen fejlesztett felhő alapú workflow rendszer (ORENBI) back-end oldali fejlesztése alapján a Műszaki Informatikai karon tartott tanszéki szeminárum során előadott prezentációnk. A prezentáció témája az alkalmazott technológiák és architektúrális valamint TDD módszereink bemutatása és tapasztalataink átadása.
SCaLE 2016 - syslog-ng: From Raw Data to Big DataBalaBit
syslog-ng is an enhanced logging daemon, with a focus on central log collection. It collects logs from many different sources, processes and filters them and forwards them to a destination. This session focuses on how syslog-ng parses important information from incoming messages, how to send this information to “big data” destinations, like HDFS, Kafka, ElasticSearch or MongoDB.
Abstract: syslog-ng is an enhanced logging daemon, with a focus on central log collection. It collects logs from many different sources.
Raw log messages come in a variety of formats:
- lacking any structure most are usually just an almost proper English sentence with some variable parts in it, like user names or IP addresses.
- Fix table-like structure, like Apache access logs.
- A small minority of logs arrive in an already structured form: JSON.
Parsers in syslog-ng make it possible to extract important information from any of these messages and create name-value pairs.Once you have name-value pairs instead of raw log messages, you have many possibilities. On the syslog-ng side, you can use them for filtering, for example, to send an alert if the username is “root”. You can also use them in file names, or messages can be modified to facilitate log rotation or better suit applications processing the logs.
Parsing and preprocessing log messages also allows you to store them more effectively:
- you can send them to the destination (for example, ElasticSearch or MongoDB) in a format that can be easy to process (for example, JSON),
- you can filter irrelevant data, and forward only what is really needed,
- processing is off-loaded to very effective C code.
Finally you will learn about the “big data” destinations that syslog-ng supports, and how they benefit from message parsing:
- Hadoop Distributed File System ( HDFS ),
- Apache Kafka,
- ElasticSearch and Kibana, and
- MongoDB.
And if syslog-ng cannot already do something that you need, and you are not afraid of writing some code, you can learn about how language bindings of syslog-ng make it possible to add new destinations, not only in C, but also in Java, Lua, Perl, or Python.
Bio: Peter Czanik is community manager at Balabit, developers of syslog-ng. He helps distributions to maintain the syslog-ng package, follows bug trackers, helps users and talks regularly at conferences (FOSDEM, Libre Software Meeting, LOADays, Scale, etc.) In his limited free time he is interested in non-x86 architectures, and works on one of his PPC or ARM machines.
NIAS 2015 - The value add of open source for innovationBalaBit
(Balázs Scheidler, co-founder and CTO, BalaBit)
As a long term member of the Open Source community, I believe that the Open Source development model creates a great context for innovation to happen. In the open source world, collaboration and sharing are key principles. These principles put the problem to be solved in focus and tear down
organizational boundaries. An Open Source project is a space where the best engineers from multiple competing organizations work as a team on solving a common goal. This space and the direct connection to users boosts engineer motivation, creating trust and a virtuous circle that results in fast iterations: creating layers upon layers of work yielding a great product at a pace that is unrealistic in a proprietary software development setting. We can also see that the same values and principles start happening outside of the software realm: Wikipedia, Creative Commons and the Maker community confirms the approach works in other fields, which shows that it can be adapted to further situations to improve efficiency and innovation.
Les Assises 2015 - Why people are the most important aspect of IT security?BalaBit
Balázs Scheidler, co-founder and CTO of BalaBit holds a presentation about the importance of privileged users in IT security. He introduces BalaBit's approach to people-centric security - people centric security is a strategic approach to information security that emphasizes individual accountability and trust. It de-emphasizes restrictive, preventive security controls, while the monitoring of user activities is a fundamental element of people centric security.
Mr. Scheidler showcases how cooperates Blindspotter, BalaBit's UBA solution with its Privileged Activity Monitoring tool, Shell Control Box, and how does they provide an effective defense against Advanced Persistent Threats. A live demo of how an APT attack would be prevented will be also part of the presentation.
2015. Libre Software Meeting - syslog-ng: from log collection to processing a...BalaBit
Peter Czanik: syslog-ng - from log collection to processing and infomation extraction
2015. Libre Software Meeting
After a short introduction to system logging, we will show how the current log messages look like, and what the problem is with this free text format. Next, we will introduce you the powerful concept of name-value pairs, and how you can extract useful information from your logs by parsing log messages into name-value pairs. Next we will demonstrate the flexibility of syslog-ng’s message parsers (patterndb, csv and JSON parsers), and show you how to create patterns using a text editor or a GUI. This can also be used to overwrite sensitive information due to privacy regulations. At the end, you will learn about the Perl/Python/Lua/Java bindings of syslog-ng Open Source Edition, how value pairs can be passed to them, and some reference applications written for syslog-ng.
LOADays 2015 - syslog-ng - from log collection to processing and infomation e...BalaBit
Peter Czanik: syslog-ng - from log collection to processing and infomation extraction
LOADays 2015.
After a short introduction to system logging, we will show how the current log messages look like, and what the problem is with this free text format. Next, we will introduce you the powerful concept of name-value pairs, and how you can extract useful information from your logs by parsing log messages into name-value pairs. Next we will demonstrate the flexibility of syslog-ng’s message parsers (patterndb, csv and JSON parsers), and show you how to create patterns using a text editor or a GUI. This can also be used to overwrite sensitive information due to privacy regulations. At the end, you will learn about the Perl/Python/Lua/Java bindings of syslog-ng Open Source Edition, how value pairs can be passed to them, and some reference applications written for syslog-ng.
syslog-ng: from log collection to processing and information extractionBalaBit
This document discusses syslog-ng, an open source log collection and processing software. It begins with an introduction of the speaker and an overview of topics to be covered, including the basics of syslog-ng configuration, parsing structured log messages, using PatternDB to extract fields, and language bindings. The document then goes into more detail on sources, processing methods like filtering and parsing, and destinations for logs. It also provides an example configuration file and discusses tools for managing syslog-ng configurations.
The document discusses the shift from traditional IT security control models to contextual security through real-time monitoring. It advocates a prevention approach using monitoring to complement control. The BalaBit eCSI Suite is presented as a solution that provides reliable logging from multiple sources, high-performance monitoring, and real-time dashboards to enable prevention through intelligent data analysis and monitoring.
A recent eCSI survey reveals that nearly a quarter of IT professionals use firewalls as their only protection against malicious insiders and targeted attacks, which is completely ineffective for that purpose.
Hogyan maradj egészséges irodai munka mellett?BalaBit
Hogy kiknek szól ez a kiadvány? Amatőröknek. Pályakezdőknek. Újrakezdőknek. Sohaelnemkezdőknek. Mármint egészség fronton. Fájós háttal, úszógumival a derekukon munkában úszó sorstársainknak.
Hogy kiknek nem szól? Profiknak nem szól, mert ahhoz szándékosan kevés. Misztikus-egzotikus csodaprogramokat habzsoló divat-egészségeseknek sem szól, mert nincs könnyű út.
Csak egy út van.
Az alábbi pár oldalon összeszedtük a legfontosabb tanácsokat és megtámogattuk őket azokkal a tényeket, ami biológiából, anatómiából, kémiából stb... következik. Hiszünk benne, hogy a megértés segíti a tudás alkalmazását.
Log messages can be used to detect security incidents, operational problems, and other issues like policy violations, and are useful in auditing and forensics situations.
From this white paper you can learn the advantages of using the syslog-ng Store Box logserver appliance to collect, store, and manage system log (syslog) and eventlog messages for policy compliance.
Kontrolle und revisionssichere Auditierung privilegierter IT-ZugriffeBalaBit
In einem Unternehmen gibt es meist eine Vielzahl unbekannter privilegierter Benutzer: Systemadministratoren, Benutzer mit Zugriff auf vertrauliche Inhalte – besonders in IT-Architekturen, die mehrere Altsysteme enthalten.
This document discusses logging technologies including syslog-ng, journal, CEE/Lumberjack, and ELSA. It provides an overview of syslog and syslog-ng, describing how syslog-ng offers more functionality than traditional syslog. It also discusses the journal logging system, standardization efforts through CEE and Lumberjack, and how ELSA uses syslog-ng to provide log search and archival capabilities.
The document discusses the importance of proper logging during all phases of development. It describes what syslog is and introduces syslog-ng as the next generation syslog server. It emphasizes that logging should be an integral part of development and developers should consult with operators. The document also discusses logging best practices like using structured, name-value pair logging and centralized logging.
BalaBit develops Contextual Security Intelligence products that rely on real-time visibility of user behavior rather than predefined patterns to identify threats. It is best known for its open source syslog-ng log management solution with over 1 million users. BalaBit has offices globally and serves Fortune 100 customers through partners in over 40 countries to improve security through products like log management, privileged activity monitoring, and user behavior analytics.
2. Swift dióhéjban
• iOS/OS X fejlesztés új nyelve
• Script nyelv szerű szintaxis (~JavaScript, Ruby), de
sokkal “biztonságosabb”, modern nyelvi lehetőségekkel
• Natív kódra fordul
> Mint C, C++ vagy Objective-C
• Sok más nyelvből merít: Python, Haskell, Ruby, C#
> Objective-C without the C
• Könnyen összekapcsolható Objective-C-ben írt kóddal
(interoperability)
• Elsőre egyszerűnek tűnik, de sok funkciója kifejezetten
komplex és ezek helyes elsajátítása nem kevés időt
igényel
4. Swift fordító?
LLVM
C C++ Objective-C
ARM64 ARMv7 X86
Clang fordító (frontend)
Swift
Gépi kód
Optimalizálás
Swift fordító
5. Evolúció
• A Swift az első béták (2014 nyár) óta
rengeteget változott / fejlődött
>Teljesítmény
>Szintaxis és nyelvi elemek
• 2014. szeptember - Swift 1.0
• 2015. február - Swift 1.2
6. Kompatibilitás
• OS verziók
>iOS 7.0+
>OS X 10.9 (Mavericks)+
• Fejlesztéshez Xcode 6.0+
• Az összes standard Apple API elérhető
Swiftből
• Silver: egy Swift kompatibilis fordító .NET
CLR/Java-hoz (sajnos nem open source):
http://elementscompiler.com/elements/silver/
7. Playground ~ Swift homokozó
• Playground dokumentum
>Interaktív Swift környezet
>A kód automatikusan fordul és minden
kódsorhoz kiértékeli/kiírja az eredményét
>Tanuláshoz, kódrészletek kipróbálásához, új
osztályok prototípusának megírásához
>Rich-text dokumentáció ágyazható bele
(markdown)
8. Milyen más programozási nyelvekből
merített?
• Objective-C: Objective-C runtime, ARC
• Rust: let/var és még rengeteg más…
• Haskell: optional
• Python: n-nesek (tuples), opcionális
pontosvesszők
• C#: class: reference type, struct: value type
• Java: generics
• JavaScript: closures
9. Swift és Objective-C egy
projektben
• Alapvetően a két nyelvben írt osztályok
vegyíthetők egy projekten belül is
>Az ObjC API-k átkonvertálódnak Swift-re
- (NSString *)generateKeyWithSeed:(NSString *)seed complexity:(NSInteger)complexity;
func generateKeyWithSeed(seed: String!, complexity: Int) -> String!
>A Swift osztályok interfésze átkonvertálódik ObjC-
re, kivéve a Swift specifikus funkciókat (pl.
generics, tuples)
• 3rd party ObjC libraryk gond nélkül
10. Biztonságos kód
• Erősen és statikusan típusos
• Változókat első használat előtt kötelező
inicializálni
• var/let (mutable/immutable) változók
deklarálása
• Generics
• switch-eknek le kell fednie a teljes
értékkészletet (ellenőrzés fordításkor)
• Láthatóság szabályozása:
public/private/internal
11. Optional
• Hogyan fejezzük ki egy érték hiányát? Pl.
ObjC:
>Objektumok (pointerek): nil pointer
>Primitív típusoknál? 0? Mi történjen, ha a 0 is
megengedett érték? NSNull?
• Swift: tetszőleges típus megjelölhető
optional-ként (?) és innentől felvehet nil
értéket
>Nem csak referencia típusoknál!
>Explicit kommunikálja, hogy egy adott változónál
előfordulhat-e, hogy nincs értéke
var optionalInt: Int? = nil
12. Tömör és jól érthető kód
• Type inference
>Változók, closure-ök
• Pontosvesszők és zárójelek (legtöbb
esetben) opcionálisak
• Tömör closure (lambda) szintaxis
let someClosue: () -> Void = { println("Hello") }
• Függvényekhez híváskor kiírandó („külső”)
paraméternevek
• Sok „syntax sugar”
13. Rugalmas és bővíthető
• Metódusokkal bővíthető enum és struct
• Névterek (sajnos csak külön modulonként:
library)
• Dinamikus frameworkök
• Operator overloading
>Egyedi operátorok is megadhatók (akár
egyedi unicode karakterrel)
prefix operator +++ {}
• Már meglévő típusok (struct-tok is) utólag
bővíthetők új metódusokkal (extension)
14. Enum egyedi metódussal
• Metódusok rendelhetők szinte minden
adatszerkezethez
enum DashboardState {
case Empty
case Unpaid
mutating func toggle() {
if self == .Empty {
self = .Unpaid
}
else {
self = .Empty
}
}
}
15. Példa: SwiftyJSON
• Alap JSON parszolás rengeteg extra kód az optional ellenőrzések
miatt:
let JSONObject: AnyObject? = NSJSONSerialization.JSONObjectWithData(
data, options: nil, error: nil)
if let statusesArray = JSONObject as? [AnyObject],
let status = statusesArray[0] as? [String: AnyObject],
let user = status["user"] as? [String: AnyObject],
let username = user["name"] as? String {
// Végre megvan a username...
}
• SwiftyJSON library, subscript [ ] operátor felüldefiniálássaé:
let json = JSON(data: dataFromNetworking)
if let userName = json[0]["user"]["name"].string{
// Máris megvan a username
}
16. Funkcionális programozás
• A függvények, metódusok és closure-ök
(lambdák) a nyelv elsőrendű elemei
>Lehetnek visszatérési érték, paraméterként
átadhatók, stb.
• Swift standard library: map, filter, reduce
let numbers = [1, 3, -5, 7, -9]
let negativeNumbers = numbers.filter { $0 < 0 }
• Ettől még a Swift nem egy funkcionális
programozási nyelv (csak tartalmaz
funkcionális programozást támogató
konstrukciókat)
17. Hátrányok? 1/2
• Kevésbbé dinamikus mint ObjC (pl. nincs
method swizzling, bizonyos trükköket nem
lehet vagy nehezebb megcsinálni)
>Pl. nincs Swiftben írt unit tesztelésnél
használható Mock/Stubbing (test double)
könyvtár
• Sok API-nál vissza kell nyúlni az
ObjC/Foundation osztályokhoz (pl.
NSString osztály vs. Swift String osztály)
18. Hátrányok? 2/2
• let (konstans) eltérő viselkedés struct/class
esetén
>struct (érték típus): valódi konstans (immutable)
let str = "Hello" // String struct -> valódi konstans
>class (referencia típus): csak a referencia
konstans
let obj = NSObject() // csak a referencia konstans,
// obj mutable
• Elsőre furcsa (inkonzisztens) függvény
paraméterezés
• Selector kezelés sztringekkel (futási időben
ellenőrzi)
Selector("methodNameThatYouWillSurelyMistype:")
19. Open source Swift?
• Apple-től nem valószínű...
>Bár az Objective-C runtime open source, sosem
volt magas prioritással kezelve az Apple-nél
>Apple-nek valószínűleg nem érdeke, hogy
megjelenjen más platformokon
>4 évig teljesen titokban tartották
• Hátha mégis?
>llvm/clan-re épül, ami open source...
>Silver: egy Swift kompatibilis fordító .NET
CLR/Java-hoz (sajnos nem open source):
http://elementscompiler.com/elements/silver/
20. Swift teljesítmény
• Általánosságban: gyors, az Objective-C-vel
összemérhető teljesítmény
• 3 Geekbench teszt átírva Swift-re: 10%-on
belüli eltérés a C++ implementációhoz
képest
>http://www.primatelabs.com/blog/2015/02/swift-
performance-updated/
• JSON feldolgozás, tömb műveletek, GPS
koordináták feldolgozása:
>ObjC adatszerkezetek még gyorsabbak, de nem
vészes
>http://blog.sudeium.com/2015/02/10/swift-1-dot-2-
performance-pretty-much-fine/
21. Xcode (IDE) teljesítmény
• Xcode 6.3-ra sokat javult, de még mindig a legnagyobb
probléma
> Crash-ek, lefagyások
> Indexálás/code completion anomáliák
> Nagy projekteknél code completion/indexing borzasztóan
belassul
> Fordító jóval lassabb mint ObjC-nél
> Fordító néha rosszul/máshol jelzi a hibákat a kódban (különösen
closure-öknél)
> „Gyilkos kódrészletek”: kifagy tőle az IDE, néha az egész gép és
nehéz megtalálni a hibás részt (egyre kevésbé probléma)
22. Objective-C?
• Apple: „az Objective-C teljesértékű iOS
programozási nyelv marad”
>Meddig?
• Jelenleg még nagyon fontos az ObjC tudás
(rengeteg legacy kód, library ObjC-ben)
>Olvasási/megértési szinten tisztán Swift-ben
írt projekteknél se árt
• A fejlesztői közösségben nagy a Swift
sikere
>Rengeteg csak Swiftet támogató új library
23. Saját projekttapasztalatok
• 2 teljesen Swiftben írt alkalmazás
• Az Xcode időben elveszi amit a tömör
szintaxissal nyerünk...
• Néhány megmagyarázhatatlan
memory
leak és crash ObjC és Swift
keverésekor
>Némi kísérletezéssel meg lehetett oldani
őket
• A Swift eltérő gondolkodást igényel
>Lehet „Objective-C”-s Swift kódot is írni...
24. Esettanulmány: SlideShare iOS
App 1.0
• App Store-ban elérhető, 4.5⭐-os értékelés
• 95% Swift
>ObjC: néhány library és pár speciális osztály
• Alapvetően pozitív tapasztalatok, blocking
issue nem volt
• Problémák:
>Lassú fordító és akadozó Xcode...
>Új Xcode/Swift verzióknál kód átírása
https://engineering.linkedin.com/ios/our-swift-experience-slideshare
25. Swift libraryk
• Már most nagyon sok, tisztán Swiftben írt
komponens (egy részük használható ObjC
kódból is)
• https://github.com/Wolg/awesome-swift
>A curated list of awesome Swift frameworks
• Példák:
>Alamofire: http networking
>Haneke-swift: image caching
>ios-charts: charting library
26. REPL (Read-Eval-Print Loop)
• Parancssorból vagy debuggolás közben
elérhető interaktív Swift környezet
>Terminal: xcrun swift
>Debugger (lldb): repl
• Egyszerűen injektálható kód akár futás
közben
27. Átállás Swiftre
• Új iOS fejlesztők számára jó lehetőség
> Kezdés Swift-tel és később megtanulni ObjC-t
• Új projekteknél érdemes teljesen vagy legalább
részlegesen (pl. prezentáció/UI) átállni
> Nyomás a fejlesztői közösség és az Apple részéről: előbb
utóbb úgyis
• Kockázat: Xcode, de kezelhető
• Már meglévő projekteknél csak speciális esetben
> Minden működik továbbra is Objective-C-ben
> Egyedüli hiányosság a vadonat-új, csak Swiftben, ObjC-vel
nem kompatibilis Swift library-kra való igény lehet
> Meglévő kódokat átkonvertálni felesleges
http://appleinsider.com/articles/14/06/04/apples-top-secret-swift-language-grew-from-work-to-sustain-objective-c-which-it-now-aims-to-replace
Chris Lattner