Programming Kotlin [Englishonlineclub.Com].Pdf

Total Page:16

File Type:pdf, Size:1020Kb

Programming Kotlin [Englishonlineclub.Com].Pdf Programming Kotlin Familiarize yourself with all of Kotlin’s features with this in- depth guide Stephen Samuel Stefan Bocutiu BIRMINGHAM - MUMBAI Programming Kotlin Copyright © 2017 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: January 2017 Production reference: 1130117 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-78712-636-7 www.packtpub.com Credits Authors Copy Editor Stephen Samuel Safis Editing Stefan Bocutiu Reviewers Project Coordinator Antonios Chalkiopoulos Vaidehi Sawant Alexander Hanschke Commissioning Editor Proofreader Aaron Lazar Safis Editing Acquisition Editor Indexer Kirk D'costa Tejal Daruwale Soni Sonali Vernekar Content Development Editor Graphics Nikhil Borkar Abhinash Sahu Technical Editor Production Coordinator Subhalaxmi Nadar Shraddha Falebhai About the Authors Stephen Samuel is an accomplished developer with over 17 years of experience. He has worked with Java throughout his career, and in the past 5 years has focused on Scala. He has a passion for concurrency and Big Data technologies. Having spent the last few years in investment banking, he is currently working with Kotlin on a major Big Data ingestment project. Stephen is also active in the open source community, being the author of several high profile Scala and Kotlin libraries. I would like to thank my wife for being patient with all the days and nights spent on the computer, developing. I would also like to thank Stefan for kindly agreeing to co-author this book with me. Stefan Bocutiu is a Big Data consultant with over 13 years of experience in software development. He enjoys coding in Scala, C#, and has a passion for stream processing technologies. With the team at DataMountaineer--a consultancy company offering delivery of solutions for streaming/ fast data platforms - he focuses on providing scalable, unified, real-time data pipelines allowing reactive decision making, analytics, and Hadoop integration. Stefan is passionate about motorsports, and while his racing skills are not good enough to allow him to compete, he tries to attend as many MotoGP races as possible. When he is not coding, he can be found at the climbing wall or at the gym. Occasionally, hiking and scrambling trips are on his calendar, and during the winter season, skiing trips are a must for him. About the Reviewers Antonios Chalkiopoulos is a distributed systems specialist, engineering Big Data systems in the past 5 years on Media, Betting, Retail, Investment Banks, and FinTech companies in London. He is the author of Programming MapReduce with Scalding, one of the first books presenting how Scala can be used for Big Data solutions, and an open source contributor to a number of projects. He is the founder of LANDOOP, a company that specializes in Fast Data and Big Data solutions and provides numerous tools and capabilities around Apache Kafka and real-time streaming systems. Alexander Hanschke is a co-founder and CTO at techdev Solutions GmbH, a software company based in Berlin. He graduated from University of Mannheim and has worked in the financial sector, building Java enterprise applications for 8 years. At his company, these days Alex is working on web applications written in Java and Kotlin. He frequently talks at user groups and conferences and is writing about Kotlin-related topics. You can find him on Twitter at @alexhanschke. www.PacktPub.com For support files and downloads related to your book, please visit www.PacktPub.com. Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details. At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks. h t t p s ://w w w . p a c k t p u b . c o m /m a p t Get the most in-demand software skills with Mapt. Mapt gives you full access to all Packt books and video courses, as well as industry-leading tools to help you plan your personal development and advance your career. Why subscribe? Fully searchable across every book published by Packt Copy and paste, print, and bookmark content On demand and accessible via a web browser Customer Feedback Thank you for purchasing this Packt book. We take our commitment to improving our content and products to meet your needs seriously—that's why your feedback is so valuable. Whatever your feelings about your purchase, please consider leaving a review on this book's Amazon page. Not only will this help us, more importantly it will also help others in the community to make an informed decision about the resources that they invest in to learn. You can also review for us on a regular basis by joining our reviewers' club. If you're interested in joining, or would like to learn more about the benefits we offer, please contact us: [email protected]. Table of Contents Preface 1 Chapter 1: Getting Started with Kotlin 7 Using the command line to compile and run Kotlin code 8 Kotlin runtime 10 The REPL 10 Kotlin for scripting 11 Kotlin with Gradle 12 Kotlin with Maven 15 IntelliJ and Kotlin 18 Eclipse and Kotlin 22 Mixing Kotlin and Java in a project 24 Summary 29 Chapter 2: Kotlin Basics 30 Vals and vars 30 Type inference 31 Basic types 32 Numbers 32 Booleans 33 Chars 34 Strings 34 Arrays 34 Comments 35 Packages 36 Imports 36 Wildcard imports 36 Import renaming 37 String templates 37 Ranges 38 Loops 39 Exception handling 40 Instantiating classes 41 Referential equality and structural equality 42 This expression 43 Scope 43 Visibility modifiers 43 Private 44 Protected 44 Internal 45 Control flow as expressions 45 Null syntax 46 Smart casts 47 Explicit casting 48 When expression 49 When (value) 49 When without argument 51 Function Return 52 Type hierarchy 53 Summary 54 Chapter 3: Object-Oriented Programming in Kotlin 55 Classes 56 Access levels 60 Nested classes 60 Data classes 63 Enum classes 63 Static methods and companion objects 64 Interfaces 69 Inheritance 73 Visibility modifiers 76 Abstract classes 78 Interface or abstract class 79 Polymorphism 79 Overriding rules 85 Inheritance versus composition 87 Class delegation 89 Sealed classes 91 Summary 92 Chapter 4: Functions in Kotlin 93 Defining functions 93 Single expression functions 94 Member functions 95 Local functions 95 Top-level functions 98 [ ii ] Named parameters 99 Default parameters 100 Extension functions 103 Extension function precedence 105 Extension functions on nulls 106 Member extension functions 106 Overriding member extension functions 107 Companion object extensions 109 Multiple return values 110 Infix functions 111 Operators 113 Operator overloading 114 Basic operators 115 In/contains 116 Get/set 117 Invoke 117 Comparison 118 Assignment 119 Java interop 120 Function literals 120 Tail recursive functions 121 Varargs 123 Spread operator 124 Standard library functions 124 Apply 125 Let 126 With 126 Run 126 Lazy 127 Use 127 Repeat 128 Require/assert/check 128 Generic functions 129 Pure functions 130 Java from Kotlin 131 Getters and setters 131 Single abstract methods 132 Escaping Kotlin identifiers 133 Java void methods 133 [ iii ] Kotlin from Java 134 Top-level functions 134 Default parameters 135 Object and static methods 135 Erasure naming 136 Checked exceptions 136 Summary 137 Chapter 5: Higher Order Functions and Functional Programming 138 Higher order functions 138 Returning a function 140 Function assignment 141 Closures 142 Anonymous functions 143 Function references 144 Top-level function references 144 Member and extension function references 144 Bound references 145 Function-literal receivers 146 Functions in the JVM 147 Bytecode 148 Function composition 149 Inline functions 151 Noinline 155 Currying and partial application 156 Currying in action 157 Adding currying support 158 Memoization 159 Implementing memoization 161 Type alias 162 Either 164 Fold 164 Projection 165 Further projection functions 167 Custom DSLs 169 Infix functions as keywords 170 Using function receivers in a DSL 173 Validation and error accumulation 174 Summary 177 [ iv ] Chapter 6: Properties 178 Why use properties? 178 Syntax and variations 181 Visibility 183 Late initialization 184 Delegated properties 185 Lazy initializations 191 Lateinit versus lazy 196 Observables 197 A non-null property delegate 198 Properties or methods? 198 Summary 200 Chapter 7: Null Safety, Reflection, and Annotations 201 Nullable types 202 Smart cast 203
Recommended publications
  • Weld 3.0.2.Final - CDI Reference Implementation
    Weld 3.0.2.Final - CDI Reference Implementation CDI: Contexts and Dependency In- jection for the Java EE platform by Gavin King, Pete Muir, Jozef Hartinger, Martin Kouba, Dan Allen, and David Allen and thanks to Nicola Benaglia, Gladys Guerrero, Eun- Ju Ki,, Terry Chuang, Francesco Milesi, and Sean Wu A note about naming and nomenclature ............................................................................. ix I. Beans ............................................................................................................................ 1 1. Introduction ......................................................................................................... 5 1.1. What is a bean? ......................................................................................... 5 1.2. Getting our feet wet .................................................................................... 5 2. More about beans ................................................................................................ 9 2.1. The anatomy of a bean ............................................................................. 10 2.1.1. Bean types, qualifiers and dependency injection ............................... 10 2.1.2. Scope ............................................................................................ 13 2.1.3. EL name ........................................................................................ 13 2.1.4. Alternatives .................................................................................... 14 2.1.5. Interceptor
    [Show full text]
  • (Minus Sign) in Class Diagrams, 15 * (Asterisk) As Wildcard, 58 ? (Question
    Index - (minus sign) in class diagrams, 15 AOP module (Spring), 34, 37 * (asterisk) as wildcard, 58 Apache Axis web services framework, 210 ? (question mark) for positional bind Apache Maven, 280–285 variables, 187 Apache Struts framework, 23 + (plus sign) in class diagrams, 15 Apache Tiles framework, 122, 278 Apache Tomcat, 257 ■ A APF (Authentication Processing Filter), AbstractCachingViewResolver class, 60 233–243 AbstractCommandController class, 74–78 application contexts (Spring), 33 AbstractController class, 71–74 Application Controller pattern AbstractEnterpriseBean class, 158, 200 action/command handling, 52–56 AbstractHandlerMapping, 54 action handlers, using, 56–58 AbstractMessageDrivenBean class, 200 for action-view management, 50–52 AbstractProcessingFilter, 234 background, 50–51 AbstractStatelessSessionBean, 158 benefits and concerns, 68 AbstractTemplateViewResolver class, strategies with Spring framework, 52 60–61 view handlers, 59–62, 62–68 AbstractWizardFormController class, 89 application server transactions, 261 access decision manager (Spring application servers, 138 Security), 228 application service implementation class, accessDecisionManager property, 164 246–247 Application Service pattern Acegi Security, 223–224 benefits and concerns, 167 action/command handling (application to concentrate business logic in POJO controller), 52–56 classes, 162–163 action handlers strategies with Spring framework, page controllers and, 51 164–167 sequence, 54 applicationContext-security.xml, 229 using (application controller), 56–58
    [Show full text]
  • Perception and Effects of Implementing Kotlin in Existing Projects
    Bachelor thesis Undergraduate level Perception and effects of implementing Kotlin in existing projects A case study about language adoption Author: Emil Sundin Supervisor: Wei Song Examiner: Azadeh Sarkheyli Discipline: Informatics Course: IK2017 Credit: 15 credits Examination date: 2018-05-25 Dalarna University provides the opportunity for publishing the thesis through DiVA as Open Access. This means that the thesis work will become freely available to read and download through their portal. Dalarna University encourages students as well as researchers to publish their work in the Open Access format. We approve the publishing of this thesis work under the Open Access format: Yes ☒ No ☐ Dalarna University – SE-791 88 Falun – Phone +4623-77 80 00 Abstract The Kotlin programming language has seen an increase of adoption since its launch in 2011. In late 2017 Google announced first-class support for Kotlin on the Android platform which further popularized the language. With this increase in popularity we felt it was interesting to investigate how Kotlin affects the developer experience. We performed a case study to see how Java developers perceive the Kotlin language, and how it meets the requirements of these developers. To gather the developer requirements and their perception of Kotlin we performed two sets of interviews and rewrote parts of their codebase. The first set of interviews identified developer requirements and the second set of interviews showcased the Kotlin language and its potential use in their codebase. The results show that Kotlin can meet most of the developer requirements and that the perception of Kotlin is positive. Kotlin’s ability to be incrementally adopted was a prominent feature which reduced the inherent risks of technology adoption while providing them the ability to further evaluate the language.
    [Show full text]
  • Develop a Simple Web Application with Apache Wicket and Apache
    Develop a simple Web application with Apache Wicket and Apache Geronimo Combine Wicket, Geronimo, and Apache Derby to form an open source Java Web development platform Skill Level: Intermediate Robi Sen ([email protected]) Vice President Department 13 LLC 10 Jul 2007 Apache Wicket is an innovative Java™ Web application framework that was introduced a couple of years ago. It helps simplify Web application development by clearly separating the roles of developers and designers. It lets you remove logical code from the view layer, eliminating the need for JavaServer Pages (JSP), providing a simple plain old Java object (POJO)-centric mode of development, and removing much of the need for XML and other configuration file formats. In this tutorial, learn how to set up your system to develop a simple Web application with Wicket, using Apache Geronimo as your application server and Apache Derby as the embedded database. Section 1. Before you start This tutorial is designed for developers who have found Java frameworks, such as Struts, lacking in needed functionality. If you're interested in developing Web applications in a more object-oriented manner, where the view is clearly separated from logic and there's minimal configuration and mapping, then Wicket is for you! This tutorial walks you through the basics of how Wicket works, while using Apache Geronimo to set up a Java Platform, Enterprise Edition (Java EE) server, Web server, and embedded database in just minutes. Combining Wicket with Geronimo lets you develop data-driven, scalable Web applications using software that's all open source. Develop a simple Web application with Apache Wicket and Apache Geronimo © Copyright IBM Corporation 1994, 2008.
    [Show full text]
  • Towards High-Quality Android Applications Development with Kotlin Bruno Gois Mateus
    Towards high-quality Android applications development with Kotlin Bruno Gois Mateus To cite this version: Bruno Gois Mateus. Towards high-quality Android applications development with Kotlin. Mobile Computing. Université Polytechnique Hauts-de-France, 2021. English. NNT : 2021UPHF0012. tel- 03247062 HAL Id: tel-03247062 https://tel.archives-ouvertes.fr/tel-03247062 Submitted on 2 Jun 2021 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. PhD Thesis Université Polytechnique Hauts-de-France and from INSA Hauts-de-France Subject: Computer Science Presented and defended by Bruno GÓIS MATEUS On March 26, 2021, Valenciennes Doctoral School: Sciences Pour l’Ingénieur (ED SPI 072) Research team, Laboratory: Département d’Informatique Laboratory of Industrial and Human Automation control, Mechanical engineering and Computer Science (LAMIH UMR CNRS 8201) Towards high-quality Android applications development with Kotlin JURY Committee President - Káthia MARÇAL DE OLIVEIRA. Professor at Université Polytechnique Hauts-de-France. Reviewers - Guilherme HORTA TRAVASSOS. Professor at Federal University of Rio de Janeiro. - Jacques KLEIN. Professor at University of Luxembourg. Examiner - Dalila TAMZALIT. Associate Professor at Université de Nantes. Supervisor - Christophe KOLSKI. Professor at Université Polytechnique Hauts-de-France. Co-Supervisor - Matias MARTINEZ.
    [Show full text]
  • Esper Reference
    Esper Reference Version 8.3.0 by EsperTech Inc. [http://www.espertech.com] Copyright 2006 - 2019 by EsperTech Inc. Preface ......................................................................................................................... xxvii 1. Getting Started ............................................................................................................ 1 1.1. Introduction to Complex Event Processing ........................................................... 1 1.2. Introduction to the Architecture ............................................................................ 1 1.3. Introduction to EPL ............................................................................................. 2 1.4. Compiler Getting-Started ..................................................................................... 3 1.4.1. Compiler - Step One: Setting up the Compiler Classpath ............................ 3 1.4.2. Compiler - Step Two: Provide Information on Input Events .......................... 3 1.4.3. Compiler - Step Three: Compiling EPL ...................................................... 4 1.5. Runtime Getting-Started ...................................................................................... 5 1.5.1. Runtime - Step One: Setting up the Runtime Classpath .............................. 5 1.5.2. Runtime - Step Two: Obtain Runtime ........................................................ 6 1.5.3. Runtime - Step Three: Deploy EPL Compiled Module and Attach a Callback .........................................................................................................................
    [Show full text]
  • An Object Relational Mapping Technique for Java Framework
    International Journal of Engineering Science Invention ISSN (Online): 2319 – 6734, ISSN (Print): 2319 – 6726 www.ijesi.org Volume 2 Issue 6 ǁ June. 2013 ǁ PP.01-09 An Object Relational Mapping Technique for Java Framework Ogheneovo, Edward Erhieyovwe,1 Asagba, Prince Oghenekaro,1 Ogini, Nicholas Oluwole2 1College of Natural and Applied Sciences, Faculty of Physical and Information Technology, Department of Computer Science, University of Port Harcourt, Port Harcourt, PMB 5323, Choba, Rivers State, Nigeria 2Faculty of Science, Department of Mathematics and Computer Science, Delta State University, Abraka, Delta State, Nigeria ABSTRACT: Database technology is in a period of intensive change and innovation that is both revolutionary and evolutionary. The revolutionary aspect refers to the innovation of an object-oriented programming technology. Object relational mapping (ORM) frameworks address the impedance problem of software implementation level. In this paper, we discussed the problem of building an object relational mapping by presenting a framework based on Java platform that will guide developer in handling incompatibility issues. This paper exploits the powerful features of Java as a managed object-oriented platform. The major goal of the work is to map data between incompatible type systems in the object-oriented programming language by linking the SQL database to object-oriented language concepts, thus creating in effect a “virtual object database”. The work discusses how a mini bank application can be designed and implemented as well as mapping of the object- oriented constructs to entities of the relational databases. Implementing the design in code is a straightforward process that results in two Java class libraries (.JAR files) that have to be deployed in the development environment.
    [Show full text]
  • Copyrighted Material
    20_777106 bindex.qxp 11/28/06 10:49 PM Page 715 Index Index SYMBOLS AND A abstraction, 126 NUMERICS access 2-byte Unicode strings, 433 to databases, 311 200 (HTTP response code), 532 to fields, 442–445 403 (HTTP response code), 532 in JNI, 442–445 404 (HTTP response code), 532 access control, 585–586 500 (HTTP response code), 532 accessor methods, 104 @AroundInvoke annotation, 481, 484 Action classes. See also specific types, e.g.: XWork @AttributeOverride annotation, 490 Action @Column annotation, 479 IoC and, 401 @deprecated annotation, 27 in WebWork, 399 @Discriminator annotation, 488 of XWork, 399, 412–415 @EJB annotation, 490 ActionListener interface, 163, 205, 217–218 @Entity annotation, 487 actionPerformed method, 163, 205, 213 @Id annotation, 478 Adapter pattern @Interceptors annotation, 481 using, 126 @MappedSuperclass annotation, 489 Adaptee interface in, 133 @OneToMany annotation, 478 Adapter interface in, 133 @overrides annotation, 27 Client interface in, 132 @PersistenceContext annotation, 487 discussed, 131–132 @PersistenceContexts annotation, 487 Target interface in, 132 @PersistenceUnit annotation, 487 addActionListener method, 205 @PersistenceUnits COPYRIGHTED MATERIAL annotation, 487 addFolder method, 466 @Remote annotation, 483 adding data @Resource annotation, 380–381 in EJB database, 476, 477 @Stateless annotation, 497 in EntityManager API, 477–478 @TransactionAtrribute marking, 508 in Hibernate, 412 @TransactionManagement annotation, 508 to Model 2 system, 417–419 @Transient annotation, 512 web application visualization
    [Show full text]
  • Introduction to Spring
    Collin College - Continuing Education COURSE SYLLABUS COURSE INFORMATION Course Number: JAVA 6490 Course Title: Introduction to Spring Course Description: Use Spring Framework to achieve Java application development in less time with improved maintainability. Experience the power and flexibility of the Inversion of Control and Dependency Injection design patterns. Discover how the open source Spring Framework simplifies and improves Java application development using a consistent architectural framework of over 20 modules, including Core, Beans, Context, AOP, JBDC, and Transactions. Suggested Course Prerequisite(s): Java Programming II Course Resources: Spring in Action 5th Edition Walls; Ingram Publications ISBN: 9781617294945 Student Learning Outcomes: Upon completion, you will: • Understand current best practices for Java development • Understand the basic principles of dependency injection • Be able to use the Spring framework container to develop in any Java environment • Be able to use the JDBC & ORM abstraction layers to simplify database access. • Understand the basics of Aspect-oriented programming (AOP) • Be able to use the AOP framework to declare transactions. Certification Notes: N/A Next course recommendation: Spring MVC, Introduction to Hibernate Refund Policy: Please refer to www.collin.edu/ce/inforegistrar.html for our refund policy. No refunds after the start time of the first class. Americans with Disabilities Act: Collin College will adhere to all applicable federal, state and local laws, regulations and guidelines with respect to providing reasonable accommodations as required to afford equal opportunity. It is the student’s responsibility to contact the ACCESS office, SCC-D140 or 972.881.5898 (V/TTD: 972.881.5950) to arrange for appropriate accommodations. See the current Collin Student Handbook for additional information.
    [Show full text]
  • EJB 3 in Action Debu Panda Author : EJB 3 in Action ( ) EJB 2 Vs EJB 3 EJB 3 Goals
    <Insert Picture Here> EJB 3 In Action Debu Panda http://debupanda.com Author : EJB 3 In Action ( http://manning.com/panda ) EJB 2 vs EJB 3 EJB 3 Goals • Simplify developers life • EJB now resembles Plain Java Object (POJO) • Use metadata annotations • XML descriptors are no longer necessary • Default • Unnecessary artifacts are optional • Simplify client view using dependency injection • Standardize persistence API for Java platform • Based on success of leading ORM solutions • Including Oracle TopLink, Hibernate Where EJB fits Device View Controller Model Renderer JSF JSF or Struts EJB 3/JPA Common Metadata Services Declarative Development Working with Enterprise JavaBean Types EJB container JPA Provider Session bean (Business EntityEntity Logic) (Persistence)(Persistence) Client Database EJB 2 Versus EJB 3: Simplifying Complexity 800 670 700 651 600 500 Lines of Code 400 326 300 Lines of XML 200 100 44 0 2.1 3.0 20 16 15 Classes 10 6 Descriptors 5 5 2 0 2.1 3.0 Simplify EJB Development • POJO (Plain Old Java Object) Class • EJB Class will be a plain java class • POJI (Plain Old Java interface) • Regular business interface • EJB interface does not have to implement EJBObject • No need of home interface • Annotations for type of EJB and interface EJB 2.1 Session Bean Class public class CartEJB implements SessionBean { protected Collection items = new ArrayList(); public void add(String item) { items.add(item); } public Collection getItems() { return items; } public void completeOrder(){ .. } public void ejbCreate(){} public void ejbActivate(){}
    [Show full text]
  • Bsc. Thesis Template
    Malicious Email Detection & Filtering System Using Bayesian Machine Learning Algorithm Authors Rao Muhammad Umer 10CS61 2010-IU-967 Tayyeb Islam 10CS76 2010-IU-972 Awais Anwar 10CS119 2010-IU-994 Hussain Ahmed Madni 10CS67 2010-IU-970 Supervisor Engr. Khurram Hameed Lecturer DEPARTMENT OF COMPUTER SYSTEM ENGINEERING UNIVERSITY COLLEGE OF ENGINEERING AND TECHNOLOGY The Islamia University of Bahawalpur 2010-2014 i Malicious Email Detection & Filtering System Using Bayesian Machine Learning Algorithm Authors Rao Muhammad Umer 10CS61 2010-IU-967 Tayyeb Islam 10CS76 2010-IU-972 Awais Anwar 10CS119 2010-IU-994 Hussain Ahmed Madni 10CS67 2010-IU-970 A thesis submitted in partial fulfillment of the requirements for the degree of B.Sc. Computer System Engineering Supervisor Engr. Khurram Hameed Lecturer (UCET-IUB) External Examiner Signature: ________________________________________ Thesis Supervisor Signature: ________________________________________ DEPARTMENT OF COMPUTER SYSTEM ENGINEERING UNIVERSITY COLLEGE OF ENGINEERING AND TECHNOLOGY The Islamia University of Bahawalpur 2010-2014 ii ABSTRACT Suspicious or Malicious E-mail detection is a kind of mailing system where suspicious users are identified by determining the keywords used by someone. The keywords such as bomb, RDX and attached harmful files are found in the mails which are sent by the user. All these blocked mails are checked by the administrator and identify the users who sent such mails. Malicious E-mail is the term used to describe any code in any part of a software system or script that is intended to cause undesired effects, security breaches or damage to a system. Malicious code describes a broad category of system security terms that includes attack scripts, viruses, worms, Trojan horses, backdoors, and malicious active content.
    [Show full text]
  • Databeans Fully Object Oriented Persistence for Java
    databeans fully object oriented persistence for java version 2.0 1. Introduction 1. Different kinds of persistence 2. Persistence for java 3. databeans 4. The databeans 1. What is a databean ? 5. Coding a databean 6. Using a databean 7. Data structures 8. Notifications 9. The backing store (heapspace) 1. Memory allocation 10. Garbage collection 11. Connections and transactions 12. Administation tasks 1. Importing and exporting the backing store 13. Other administration tasks 14. Advanced topics 1. databeans constructors with more than zero args 15. Note on overriding the init method 16. Persistent classes and the way they handle java classes definition changes 17. References 1. Persistence 18. JavaBeans 19. RMI 20. Security 21. Transactions 22. Memory allocation & garbage collection 23. Sources of sample data Introduction This is the user manual for databeans, which is a new, fully object oriented persistence framework for java. First we will try to situate databeans amongst the various existing persistence schemes. These can be arranged according to the following criteria: • orthogonal/API-based • object-relational/full object (depending on the nature of the backing store) • coarse grained (all at once) to fine grained (incremental) Different kinds of persistence Orthogonal means that there is no difference between not persistent and persistent. All objects are made persistent. In other words, a persistent object doesn't have to implement some specific class (there is no data access object). The advantage is that the developer has no side effects when using persistence [1], but it entails either an extension of the virtual machine, or some persistence support from the underlying OS [2].
    [Show full text]