Tuesday, July 6, 2010

Web Application Development with PHP 4.0




Target Audience
If you’re new to programming, this book is not for you.You’ll find a helpful resource, however, in the following cases:
- You have already developed applications with PHP, and want to take your skills to the next level.
- You have experience with other programming languages and want to develop Web applications with PHP.
- You’re an expert with PHP and want to extend PHP’s feature set on your own.
You don’t need to be a PHP wizard to read this book, but you should be familiar with PHP’s syntax, or have good knowledge of programming principles.

Prerequisites
This book assumes that you have a working PHP setup, preferably PHP 4.0 or later. Because of its popularity, we use MySQL as the database system where one is required. Because platform independence is one of PHP’s strongest features, however, our examples should run on UNIX as well as on Windows.

Organization of This Book

This book is divided into three parts.The first part,“Advanced PHP,” covers the advanced syntax of PHP; for example, object orientation, dynamic functions and variables, and self-modifying code. It also gives you an overview of project planning principles, coding styles, and application design.This part provides the necessary base for fast, productive development of industry-quality Web applications. Part II,“Web Applications,” focuses on building the software: It explains why sessions are important, what security guidelines you need to keep in mind, why usability matters, and how to use the PHPLib for session management and database access.You’ll also find three case studies of successful PHP projects here, to help you convince your IT managers.

The third part of the book,“Beyond PHP,” is for readers who want to go beyond
what’s currently available with PHP, and explains how to extend PHP with C.This is
the official documentation on extending PHP, as approved by Zend Technologies.
In detail, the following topics are covered.

Chapter 1—Development Concepts
Having to deal with advanced projects makes the usage of coding conventions, proper planning, and advanced syntax unavoidable requirements.This chapter covers general coding conventions that are a requirement for all industry-quality projects—naming and comment conventions, as well as how to break up the source into logical modules.

Chapter 2—Advanced Syntax
This chapter covers PHP’s advanced syntax, for example multidimensional arrays, classes, variable variables, self-modifying code, and the like.

Chapter 3—Application Design: A Real-Life Example
In this chapter, we walk you through the entire process of planning a complete Web application: phpChat, a Web-based chat client interface to IRC.This chapter shows planning fundamentals, gives guidelines on project organization, and shows how to realize modular, plug-in-enabled applications.

Chapter 4—Web Application Concepts
Session management, security considerations and authentication, and usability form the base of every Web application.Web applications aren’t possible without proper session management.You have to find a way to recognize users during multiple page requests if you want to associate variables like a shopping cart with one specific user. And this identification had better be secure if you don’t want to have one user seeing another’s credit card information. Indeed, special considerations are necessary for improving security in your applications. Even if PHP is less prone to crackers’ attacks than other CGI environments, it’s easy to write totally exposed applications when you don’t keep in mind certain important principles covered in this chapter.

This chapter also introduces basic usability concepts. As soon as we begin to talk about applications instead of stand-alone scripts, the user’s role becomes more important. After all, it’s users who finally determine the success or failure of a project—and this chapter shows some guidelines to achieve better user satisfaction.

Chapter 5—Basic Web Application Strategies
This chapter discusses more fundamentals of Web applications. All Web applications process form input, for example, or deal with separation of layout and code.Moving on from these topics, this chapter also introduces you to effective team development by giving an overview of version control with CVS. Finally, it discusses multi-tier applications, COM, and Java from a PHP point of view.

Chapter 6—Database Access with PHP
Without databases,Web applications are not possible. Chapter 6 presents the PHPLib as a tool for vendor-independent database access, and gives an overview about its other features, such as session management, user authentication, and permission management.

Chapter 7—Cutting-Edge Applications
By developing a complete knowledge repository using PHPLib, this chapter familiarizes you with PHPLib’s template class, self-references in SQL, and other advanced topics.Then the chapter presents an overview of XML and how applications can benefit from this exciting technology.The chapter also describes PHP’s interfaces for XML parsing and its WDDX functions.

Chapter 8—Case Studies
Success stories can help tremendously when introducing a new technology into a corporate environment. In Chapter 8, we present case studies featuring Six Open Systems, BizChek, and Marketplayer.com—three great examples among hundreds of companies using PHP successfully in high-demand scenarios.

Chapter 9—Extending PHP 4.0: Hacking the Core of PHP
Are more than 1,200 functions still not enough for you? No problem, because this chapter is the official documentation on extending PHP. If you know some C, Chapter 9 gives you some condensed insight into the internals of PHP 4.0, and shows you how to write your own modules to extend PHP’s functionality.

Download this book Click here
Another Programming Language books click here
Another Web Programming books click here
Continue Reading ...

A UML Pattern Language





A UML Pattern Language pairs the software design pattern concept with the Unified Modeling Language (UML) to offer a tool set for software professionals practicing both system modeling and software development. This book provides: a collection of patterns in the domain of system modeling, including those that are useful to management, operations, and deployment teams, as well as to software developers; a survey of the development of patterns and the UML; a discussion of the underlying theory of the patterns and instructions for using the language; a thorough exploration of the design process and model-driven development. A UML Pattern Language recognizes that design and modeling have become equal partners with programming and coding in the enterprise of software development. Providing both an understanding of the work of design and the way patterns and the UML combine to facilitate design.

About the Author_____________________________________________________________7
About the Technical Reviewers __________________________________________________7
Acknowledgments ____________________________________________________________8
Introduction ________________________________________________________________9
Patterns and the UML ________________________________________________________ 10
Levels and Shared Idioms______________________________________________________ 12
Using This Book ____________________________________________________________ 14
Resources, Sources, and References ______________________________________________ 15
Chapter 1. Pattern Essentials__________________________________________________17
1.1 Patterns and Paradigms_____________________________________________________ 17
1.2 Elements of Patterns_______________________________________________________ 20
1.3 Interpreting the Patterns in This Book_____________________________________ 23
Chapter 2. The Unified Modeling Language _____________________________________26
2.1 The UML, Briefly Put _____________________________________________________ 27
2.2 Roots__________________________________________________________________ 28
2.3 Understanding the UML____________________________________________________ 33
2.4 Unification: The Methods Wars Are Over _______________________________________ 34
Chapter 3. UML Essentials, Elements, and Artifacts______________________________38
3.1 Elements, Viewpoints, and Views_________________________________________ 39
3.2 Packages _______________________________________________________________ 43
3.3 Extensions ____________________________________________________________ 47
3.4 Symbols ______________________________________________________________ 49
3.5 Lines _________________________________________________________________ 55
3.6 Diagrams _____________________________________________________________ 60
3.7 Further Reading __________________________________________________________ 69

Chapter 4. Patterns of Style ___________________________________________________71
Context ___________________________________________________________________ 71
Common Forces ____________________________________________________________ 71
Discussion _______________________________________________________________ 72
Summary__________________________________________________________________ 90
Chapter 5. Patterns of Substance ______________________________________________92
Context ___________________________________________________________________ 92
Common Forces ____________________________________________________________ 93
Discussion _______________________________________________________________ 93
Summary_________________________________________________________________ 105
Chapter 6. Domain Patterns _________________________________________________107
Context __________________________________________________________________ 107
Common Forces ___________________________________________________________ 108
Discussion ______________________________________________________________ 108
Summary_________________________________________________________________ 115
Chapter 7. Product Patterns _________________________________________________117
Context __________________________________________________________________ 117
Forces ___________________________________________________________________ 118
Discussion ______________________________________________________________ 118
Chapter 8. Component Patterns ______________________________________________130
Context __________________________________________________________________ 130
Discussion ______________________________________________________________ 130
Summary_________________________________________________________________ 139
Chapter 9. Patterns in Context _______________________________________________141
9.1 A Little Starting Context___________________________________________________ 142
9.2 The Pattern Idea_________________________________________________________ 145
9.3 Patterns as Literature _____________________________________________________ 151
9.4 Types of Software Patterns_____________________________________________ 154
9.5 The Roots: Alexander on Patterns and Pattern Languages___________________________ 160
9.6 A Note on This Language __________________________________________________ 162
9.7 The Importance of Patterns_________________________________________________ 163
9.8 Where Is It All Going? ____________________________________________________ 166
Chapter 10. The UML in Context ___________________________________________168
10.1 Why Make System Models?_______________________________________________ 168
10.2 Every Picture Tells a Story: The UML as a Modeling Language _____________________ 170
10.3 The UML Specification and Metamodel ______________________________________ 172
10.4 What Do We Model? __________________________________________________ 174
10.5 Abstraction and Architecture Made Simple ______________________________ 180
10.6 Perspectives: A Generic Modeling Framework__________________________________ 185
Chapter 11. Putting It All Together: Reflecting on the Work of Design _____________187
11.1 The Work of Design_____________________________________________________ 187
11.2 Elements of Reflective Design _____________________________________________ 191
11.3 To Be Continued… _____________________________________________________ 198
References_________________________________________________________________199

Download this book click here

Another Software Engineering books click here
Continue Reading ...

Visual Basic Design Patterns: VB 6.0 and VB.NET





Design patterns provide programmers with a convenient way to reuse object-oriented code across projects and between programmers, offering easy, time-saving solutions to commonly recurring problems in software design. A practical guide to writing Visual Basic (VB6 and VB.NET) programs using some of the most common design patterns, Visual Basic Design Patterns is a tutorial for people who want to learn about design patterns and how to use them in their work. This book also provides a convenient way for VB6 programmers to migrate to VB.NET and use its more powerful object-oriented features.

Written from a Visual Basic perspective, this book intends to make you comfortable with using design patterns by laying out the concept of patterns in a practical fashion. Organized as a series of short chapters that each describe a design pattern, Visual Basic Design Patterns provides one or more complete working visual examples of programs using that pattern, along with UML diagrams illustrating how the classes interact. Each example is a visual program that you can run and study on the companion CD making the pattern as concrete as possible.

Programmers using this book will see significant improvement in their work by employing the following key concepts:

* Applying "tried-and-true" object-oriented design patterns in Visual Basic applications.
* Helping advance programming skills with the power of patterns.
* Understanding the interactions between classes through the use of UML diagrams.
* Getting comfortable using design patterns effectively and start using them in day-to-day Visual Basic programming.

The idea behind design patterns is simple: it's a catalogue of common interactions between objects that programmers have found useful, enabling them to quickly and easily employ them in their programs. Visual Basic Design Patterns provides practical advice on how to use these patterns in everyday programming.

Copyright
PREFACE
ACKNOWLEDGMENTS
Part 1: Object-Oriented Programming in VB
Chapter 1. What Are Design Patterns?
Defining Design Patterns
The Learning Process
Studying Design Patterns
Notes on Object-Oriented Approaches
VB Design Patterns
How This Book Is Organized
Chapter 2. UML Diagrams
Inheritance
Interfaces
Composition
Annotation
WithClass UML Diagrams
Visual Basic Project Files
Chapter 3. Using Classes and Objects in VB
A Simple Temperature Conversion Program
Building a Temperature Class
Putting the Decisions into the Temperature Class
Using Classes for Format and Value Conversion
A String Tokenizer Class
Classes as Objects
Class Initialization
Classes and Properties
Another Interface Example—The Voltmeter
A vbFile Class
Programming Style in Visual Basic
Summary
Chapter 4. Object-Oriented Programming
Building VB Objects
Creating Instances of Objects
A VB Measurement Program
Methods Inside Objects
Variables
Passing Arguments by Reference and by Value
Object-Oriented Jargon
Chapter 5. Building Your Own VB Control
A Highlighted Text Field
Testing Your HiText Controls
Adding Properties and Methods to User Controls
Compiling a User Control
Summary
Programs on the CD-ROM
Chapter 6. Inheritance and Interfaces
Interfaces
An Investment Simulator
Writing the Simulator
Indicators for Using an Interface
Reusing Common Methods
Hidden Interfaces
Summary
Programs on the CD-ROM
Chapter 7. Introduction to VB.NET
Syntax Differences in VB.NET
Variable Declarations and Scoping
Compiler Options
Properties in VB6 and VB.NET
Shorthand Equals Syntax
Managed Languages and Garbage Collection
Classes in VB.NET
Building a VB7 Application
The Simplest Window Program in VB.NET
Inheritance
Constructors
Drawing and Graphics in VB.NET
Tooltips and Cursors
Overloading
Inheritance
Namespaces
Public, Private, and Protected
Overriding Methods in Derived Classes
Overloading and Shadowing
Overriding Windows Controls
Interfaces
Summary
Programs on the CD-ROM
Chapter 8. Arrays, Files, and Exceptions in VB.Net
Arrays
Collection Objects
Exceptions
Multiple Exceptions
Throwing Exceptions
File Handling
Exceptions in File Handling
Testing for End of File
The FileInfo Class
A vbFile Class
Programs on the CD-ROM
Part 2: Creational Patterns
Chapter 9. The Simple Factory Pattern
How a Simple Factory Works
Sample Code
The Two Derived Classes
Building the Simple Factory
Writing the Factory Pattern in VB.NET
Factory Patterns in Math Computation
Programs on the CD-ROM
Chapter 10. The Factory Method
The Swimmer Class
The Events Classes
Straight Seeding
Our Seeding Program
Other Factories
The Seeding Program in VB7
When to Use a Factory Method
Programs on the CD-ROM
Chapter 11. The Abstract Factory Pattern
A GardenMaker Factory
How the User Interface Works
Creating an Abstract Factory Using VB7
Adding More Classes
Consequences of Abstract Factory
Programs on the CD-ROM
Chapter 12. The Singleton Pattern
Creating Singleton Using a Static Method
Catching the Error
Providing a Global Point of Access to a Singleton
The MSComm Control as a Singleton
Writing a Singleton in VB.NET
A VB.NET SpoolDemo Program
The Global Point of Access
Other Consequences of the Singleton Pattern
Programs on the CD-ROM
Chapter 13. The Builder Pattern
An Investment Tracker
Calling the Builders
The List Box Builder
The Check Box Builder
Writing a Builder in VB.NET
Using the Items Collection in the ListBox Control
Consequences of the Builder Pattern
Programs on the CD-ROM
Chapter 14. The Prototype Pattern
Cloning in Visual Basic 6
Using the Prototype
Using the Prototype Pattern
Prototype Managers
Writing a Prototype in VB7
Consequences of the Prototype Pattern
Programs on the CD-ROM
Summary of Creational Patterns
Part 3: Structural Patterns
Chapter 15. The Adapter Pattern
Moving Data between Lists
Using the MSFlexGrid
Using a TreeView
Using Adapters in VB7
TreeView Adapters for VB.NET
Adapting a DataGrid
The Class Adapter
Two-Way Adapters
Object versus Class Adapters in VB.NET
Pluggable Adapters
Adapters in VB
Programs on the CD-ROM
Chapter 16. The Bridge Pattern
The visList Classes
The Class Diagram
Extending the Bridge
ActiveX Controls as Bridges
The Bridge Pattern in VB.NET
Changing the Data Side of the Bridge
Consequences of the Bridge Pattern
Programs on the CD-ROM
Chapter 17. The Composite Pattern
An Implementation of a Composite
Computing Salaries
The Employee Classes
The Subords Class
The Boss Class
Building the Employee Tree
Self-Promotion
Doubly Linked Lists
Consequences of the Composite Pattern
A Simple Composite
Composites in VB
The Composite in VB.NET
Other Implementation Issues
Programs on the CD-ROM
Chapter 18. The Decorator Pattern
Decorating a CoolButton
Using a Decorator
Using ActiveX Controls as Decorators
A Decorator in VB.NET
Nonvisual Decorators
Decorators, Adapters, and Composites
Consequences of the Decorator Pattern
Programs on the CD-ROM
Chapter 19. The Façade Pattern
What Is a Database?
Getting Data Out of Databases
Kinds of Databases
ODBC
Microsoft Database Connection Strategies
Database Structure
Building the Façade Classes
Building the Stores and Foods Tables
Building the Price Table
Summary of the Façade Pattern
ADO Database Access in VB6
The ADO DBase Class
Database Access in VB.NET
Using ADO.NET
Adding Rows to Database Tables Using ADO.NET
Making the VB.NET ADO Façade
Creating Classes for Each Table
Storing the Prices
Loading the Database Tables
The Final Application
What Constitutes the Façade?
Consequences of the Façade
Programs on the CD-ROM
Chapter 20. The Flyweight Pattern
Discussion
Example Code
Writing a Flyweight Folder in VB.NET
Flyweight Uses in VB
Sharable Objects
Copy-on-Write Objects
Programs on the CD-ROM
Chapter 21. The Proxy Pattern
Sample Code
Writing a Proxy in VB.Net
Proxies in VB
Copy-on-Write
Comparison with Related Patterns
Programs on the CD-ROM
Summary of Structural Patterns
Part 4: Behavioral Patterns
Chapter 22. Chain of Responsibility
Applicability
Sample Code
The List Boxes
Programming a Help System
A Chain or a Tree?
Chain of Responsibility in VB.NET
Kinds of Requests
Examples in VB
Consequences of the Chain of Responsibility
Programs on the CD-ROM
Chapter 23. The Command Pattern
Motivation
Command Objects
Building Command Objects
Arrays of Commands
Consequences of the Command Pattern
Providing Undo
The Command Pattern in VB.NET
The CommandHolder Interface
Handling Undo Commands in VB.NET
The Command Pattern in the VB Language
Programs on the CD-ROM
Chapter 24. The Interpreter Pattern
Motivation
Applicability
A Simple Report Example
Interpreting the Language
Objects Used in Parsing
Reducing the Parsed Stack
Implementing the Interpreter Pattern
Building an Interpreter in VB6
The Parse Objects
Consequences of the Interpreter Pattern
Programs on the CD-ROM
Chapter 25. The Iterator Pattern
Motivation
Sample VB6 Code
Filtered Iterators
Iterators in VB.NET
Consequences of the Iterator Pattern
Programs on the CD-ROM
Chapter 26. The Mediator Pattern
An Example System
Interactions between Controls
Sample Code
Mediators and Command Objects
The Mediator in VB.Net
Consequences of the Mediator Pattern
Single Interface Mediators
Implementation Issues
Programs on the CD-ROM
Chapter 27. The Memento Pattern
Motivation
Implementation
Sample Code
Command Objects in the User Interface
Handling Mouse and Paint Events
Writing a Memento in VB.NET
Consequences of the Memento
Programs on the CD-ROM
Chapter 28. The Observer Pattern
Watching Colors Change
Writing an Observer in VB.NET
The Message to the Media
Consequences of the Observer Pattern
Programs on the CD-ROM
Chapter 29. The State Pattern
Sample Code
Switching between States
How the Mediator Interacts with the State Manager
Handling the Fill State
Handling the Undo List
A State Pattern in VB.NET
Mediators and the God Class
Consequences of the State Pattern
State Transitions
Programs on the CD-ROM
Chapter 30. The Strategy Pattern
Motivation
Sample Code
The Context
The Program Commands
The Line and Bar Graph Strategies
Drawing Plots in VB
A Strategy Pattern in VB.NET
Consequences of the Strategy Pattern
Programs on the CD-ROM
Chapter 31. The Template Method Pattern
Motivation
Kinds of Methods in a Template Class
Sample Code
The Triangle Drawing Program
Templates and Callbacks
Summary and Consequences
Programs on the CD-ROM
Chapter 32. The Visitor Pattern
Motivation
When to Use the Visitor Pattern
Sample Code
Visiting the Classes
Visiting Several Classes
Bosses Are Employees, Too
Catch-All Operations with Visitors
Double Dispatching
Why Are We Doing This?
Traversing a Series of Classes
Writing a Visitor in VB6
Consequences of the Visitor Pattern
Programs on the CD-ROM
BIBLIOGRAPHY

Download this book click here
Another Visual Basic books click here
Another Programming Language books click here
Continue Reading ...

The Guru's Guide to Transact-SQL






This is a coder's book. It's intended to help developers build applications that make use of Transact-SQL. It's
not about database administration or design. It's not about end-user or GUI application development. It's not
even about server or database performance tuning. It's about developing the best Transact-SQL code
possible, regardless of the application.
When I began writing this book, I had these design goals in mind:
• Be very generous with code samples—don't just tell readers how to do something, show them.
• Include complete code samples within the chapter texts so that the book can be read through without
requiring a computer or CD-ROM.
• Use modern coding techniques, with specific emphases on ANSI compliance and current version
features and enhancements.
• Construct chapters so that they're self-contained—so that they rely as little as possible on objects
created in other chapters.
• Provide real-world code samples that have intrinsic value apart from thebook.
• Avoid rehashing what's already covered extensively in the SQL Server Books Online.
• Highlight aspects of Transact-SQL that differentiate it from other SQL dialects; don't just write another
ANSI SQL book.
• Avoid excessive screenshots and other types of filler mechanisms often seen in computer books.
• Proceed from the simple to the complex within each chapter and throughout the book.
• Provide an easygoing, relaxed commentary with a de-emphasis on formality. Be the reader's
indulgent, amiable tutor. Attempt to communicate in writing the way that people speak.
You'll have to judge for yourself whether these goals have been met, but my hope is that, regardless of the
degree of success, the effort will at least be evident.

Contents
Foreword...........................................................................................................................................i
Preface........................................................................................................................................... iii
About the Sample Databases ................................................................................................. iii
Results Abridged ....................................................................................................................... iii
On Formality.............................................................................................................................. iii
Acknowledgments ......................................................................................................................iv
Contents.........................................................................................................................................v
Chapter 1. Introductory Transact-SQL.........................................................................................1
Choosing a SQL Editor...............................................................................................................1
Creating a Database...................................................................................................................2
Creating Tables ...........................................................................................................................3
Inserting Data..............................................................................................................................4
Updating Data.............................................................................................................................5
Deleting Data ...............................................................................................................................5
Querying Data.............................................................................................................................6
Filtering Data...............................................................................................................................9
Grouping Data ...........................................................................................................................14
Ordering Data ............................................................................................................................16
Column Aliases.........................................................................................................................16
Table Aliases.............................................................................................................................17
Managing Transactions............................................................................................................17
Summary ...................................................................................................................................18
Chapter 2. Transact-SQL Data Type Nuances ........................................................................19
Dates ..........................................................................................................................................19
Strings ........................................................................................................................................28
Numerics....................................................................................................................................46
BLOBs........................................................................................................................................50
Bits..............................................................................................................................................55
UNIQUEIDENTIFIER...............................................................................................................57
Cursor Variables.......................................................................................................................58
Timestamps...............................................................................................................................62
Summary ...................................................................................................................................64

Chapter 3. Missing Values...........................................................................................................65
NULL and Functions .................................................................................................................66
NULL and ANSI SQL................................................................................................................67
NULL and Stored Procedures .................................................................................................68
NULL if you Must.......................................................................................................................69
Chapter 4. DDL Insights...............................................................................................................71
CREATE TABLE........................................................................................................................71
Dropping Objects.......................................................................................................................74
CREATE INDEX........................................................................................................................75
TEMPORARY OBJECTS.........................................................................................................76
Object Naming and Dependencies.........................................................................................77
Summary ...................................................................................................................................78
Chapter 5. DML Insights ..............................................................................................................81
INSERT......................................................................................................................................81
UPDATE ....................................................................................................................................91
DELETE...................................................................................................................................100
Detecting DML Errors .............................................................................................................103
Summary .................................................................................................................................103
Chapter 6. The Mighty SELECT Statement............................................................................105
Simple SELECTs.....................................................................................................................105
Computational and Derived Fields .......................................................................................105
SELECT TOP...........................................................................................................................106
Derived Tables.........................................................................................................................108
Joins .........................................................................................................................................111
Predicates................................................................................................................................113
Subqueries ...............................................................................................................................123
Aggregate Functions...............................................................................................................129
GROUP BY and HAVING ......................................................................................................131
UNION......................................................................................................................................137
ORDER BY..............................................................................................................................139
Summary .................................................................................................................................141
Chapter 7. Views .........................................................................................................................143
Restrictions..............................................................................................................................143
ANSI SQL Schema VIEWs....................................................................................................144
Getting a VIEW's Source Code.............................................................................................145
Updatable VIEWs....................................................................................................................146
WITH CHECK OPTION..........................................................................................................146
Derived Tables.........................................................................................................................146
Dynamic VIEWs.......................................................................................................................147
Partitioning Data Using Views...............................................................................................148
Summary .................................................................................................................................150
Chapter 8. Statistical Functions ................................................................................................151
The Case for CASE ................................................................................................................151
Efficiency Concerns ................................................................................................................152
Variance and Standard Deviation.........................................................................................153
Medians ...................................................................................................................................153
Clipping ....................................................................................................................................160
Returning the Top n Rows.....................................................................................................161
Rankings..................................................................................................................................164
Modes.......................................................................................................................................166
Histograms ...............................................................................................................................167
Cumulative and Sliding Aggregates .....................................................................................168
Extremes..................................................................................................................................170
Summary .................................................................................................................................172
Chapter 9. Runs and Sequences .............................................................................................173
Sequences ...............................................................................................................................173
Runs .........................................................................................................................................178
Intervals ...................................................................................................................................180
Summary .................................................................................................................................182
Chapter 10. Arrays......................................................................................................................185
Arrays as Big Strings ..............................................................................................................185
Arrays as Tables......................................................................................................................190
Summary .................................................................................................................................198
Chapter 11. Sets .........................................................................................................................199
Unions ......................................................................................................................................199
Differences ...............................................................................................................................201
Intersections............................................................................................................................202
Subsets ....................................................................................................................................204
Summary .................................................................................................................................207
Chapter 12. Hierarchies .............................................................................................................209
Simple Hierarchies..................................................................................................................209
Multilevel Hierarchies..............................................................................................................210
Indented lists...........................................................................................................................215
Summary .................................................................................................................................216
Chapter 13. Cursors ...................................................................................................................217
On Cursors and ISAMs ..........................................................................................................217
Types of Cursors .....................................................................................................................218
Appropriate Cursor Use .........................................................................................................222
T-SQL Cursor Syntax .............................................................................................................226
Configuring Cursors................................................................................................................234
Updating Cursors ....................................................................................................................238
Cursor Variables......................................................................................................................239
Cursor Stored Procedures .....................................................................................................240
Optimizing Cursor Performance............................................................................................240
Summary .................................................................................................................................242
Chapter 14. Transactions...........................................................................................................243
Transactions Defined..............................................................................................................243
How SQL Server Transactions Work ...................................................................................244
Types of Transactions ............................................................................................................244
Avoiding Transactions Altogether.........................................................................................246
Automatic Transaction Management ...................................................................................246
Transaction Isolation Levels..................................................................................................248
Transaction Commands and Syntax....................................................................................251
Debugging Transactions ........................................................................................................256
Optimizing Transactional Code.............................................................................................257
Summary .................................................................................................................................258
Chapter 15. Stored Procedures and Triggers.........................................................................259
Stored Procedure Advantages..............................................................................................260
Internals ...................................................................................................................................260
Creating Stored Procedures..................................................................................................261
Executing Stored Procedures ...............................................................................................269
Environmental Concerns........................................................................................................270
Parameters..............................................................................................................................272
Important Automatic Variables..............................................................................................275
Flow Control Language ..........................................................................................................276
Errors........................................................................................................................................277
Nesting.....................................................................................................................................279
Recursion.................................................................................................................................280
Autostart Procedures..............................................................................................................281
Encryption................................................................................................................................281
Triggers....................................................................................................................................281
Debugging Procedures...........................................................................................................284
Summary .................................................................................................................................285
Chapter 16. Transact-SQL Performance Tuning ...................................................................287
General Performance Guidelines .........................................................................................287
Database Design Performance Tips ....................................................................................287
Index Performance Tips .........................................................................................................288
SELECT Performance Tips ...................................................................................................290
INSERT Performance Tips ....................................................................................................291
Bulk Copy Performance Tips.................................................................................................291
DELETE and UPDATE Performance Tips ..........................................................................292
Cursor Performance Tips.......................................................................................................292
Stored Procedure Performance Tips ...................................................................................293
SARGs .....................................................................................................................................296
Denormalization......................................................................................................................311
The Query Optimizer ..............................................................................................................325
The Index Tuning Wizard.......................................................................................................333
Profiler......................................................................................................................................334
Perfmon ...................................................................................................................................335
Summary .................................................................................................................................337
Chapter 17. Administrative Transact-SQL ..............................................................................339
GUI Administration.................................................................................................................339
System Stored Procedures....................................................................................................339
Administrative Transact-SQL Commands...........................................................................339
Administrative System Functions .........................................................................................339
Administrative Automatic Variables......................................................................................340
Where's the Beef?...................................................................................................................341
Summary .................................................................................................................................392
Chapter 18. Full-Text Search ....................................................................................................395
Full-Text Predicates................................................................................................................399
Rowset Functions....................................................................................................................402
Summary .................................................................................................................................405
Chapter 19. Ole Automation......................................................................................................407
sp-exporttable ..........................................................................................................................407
sp-importtable ..........................................................................................................................411
sp-getsQLregistry...................................................................................................................415
Summary .................................................................................................................................417
Chapter 20. Undocumented T-SQL .........................................................................................419
Defining Undocumented.........................................................................................................419
Undocumented DBCC Commands ......................................................................................419
Undocumented Functions and Variables ............................................................................430
Undocumented Trace Flags ..................................................................................................433
Undocumented Procedures...................................................................................................434
Summary .................................................................................................................................438
Chapter 21. Potpourri .................................................................................................................439
Obscure Functions..................................................................................................................439
Data Scrubbing.......................................................................................................................448
Iteration Tables........................................................................................................................451
Summary .................................................................................................................................452
Appendix A. Suggested Resources .........................................................................................453
Books .......................................................................................................................................453
Internet Resources..................................................................................................................453

Download this book click here

Another Database books click here
Continue Reading ...

Monday, July 5, 2010

Processing XML with Java








Written for Java programmers who want to integrate XML into their systems, this practical, comprehensive guide and reference shows how to process XML documents with the Java programming language. It leads experienced Java developers beyond the basics of XML, allowing them to design sophisticated XML applications and parse complicated documents.

Processing XML with Java(TM) provides a brief review of XML fundamentals, including XML syntax; DTDs, schemas, and validity; stylesheets; and the XML protocols XML-RPC, SOAP, and RSS. The core of the book comprises in-depth discussions on the key XML APIs Java programmers must use to create and manipulate XML files with Java. These include the Simple API for XML (SAX), the Document Object Model (DOM), and JDOM (a Java native API). In addition, the book covers many useful supplements to these core APIs, including XPath, XSLT, TrAX, and JAXP.

Practical in focus, Processing XML with Java(TM)is filled with over two hundred examples that demonstrate how to accomplish various important tasks related to file formats, data exchange, document transformation, and database integration. You will learn how to read and write XML documents with Java code, convert legacy flat files into XML documents, communicate with network servers that send and receive XML data, and much more. Readers will find detailed coverage of the following:
* How to choose the right API for the job
* Reading documents with SAX
* SAX filters
* Validation in several schema languages
* DOM implementations for Java
* The DOM Traversal Module
* Output from DOM
* Reading and writing XML documents with JDOM
* Searching XML documents with XPath
* Combining XSLT transforms with Java code
* TrAX, the Transformations API for XML
* JAXP, the Java API for XML Processing

With thorough coverage of the key XML APIs and a practical, task-oriented approach, Processing XML with Java(TM) is a valuable resource for all Java programmers who need to work with XML.

Download this book click here
Another Java books click here
Another Web Programming books click here
Continue Reading ...

Thinking in Postscript














Table of Contents
Preface......................................................................... xi
Chapter 1
PostScript as a Programming Language ..................1
DESIGN FEATURES............................................................................2
STRUCTURED PROGRAMMING TECHNIQUES ...............................3
PROGRAMMING TASKS.....................................................................4
WINDOW SYSTEMS, COMMUNICATIONS, AND DISPLAYS............4
DATA STRUCTURES AND ALGORITHMS.........................................6
CONCLUDING THOUGHTS ................................................................6
EXERCISES.............................................................................. 7
Chapter 2
PostScript is Not Like C..............................................9
COMPARISON OF LANGUAGE MECHANISMS...............................11
EXPRESSING AN ALGORITHM AS A PROGRAM...........................12
THE UNIX SHELL AND OPERATING SYSTEM................................13
INPUT, OUTPUT, AND THROUGHPUT............................................14CONCLUDING THOUGHTS ..............................................................15
EXERCISES.............................................................................16
Chapter 3
Foundations............................................................... 17
POSTSCRIPT LANGUAGE SYNTAX ................................................19
SIMPLE PROGRAM STRUCTURE....................................................20
SETTING UP TEMPLATES................................................................24
DECLARING AND USING VARIABLES.............................................26
ALLOCATING MEMORY....................................................................29
GETTING MEMORY BACK................................................................31
OPENING AND CLOSING FILES ......................................................31
COMPARISONS AND EQUALITY OF OBJECTS..............................32
CONCLUDING THOUGHTS ..............................................................34
EXERCISES.............................................................................34
Chapter 4
Some Typical Programs ........................................... 37
A TYPICAL PAGE DESCRIPTION PROGRAM.................................38
FONT PROGRAMS............................................................................40
PROGRAMS THAT READ DATA.......................................................42
QUERY PROGRAMS.........................................................................43
ENCAPSULATED POSTSCRIPT PROGRAMS.................................43
PERSISTENTLY RESIDENT PROGRAMS .......................................46
CONCLUDING THOUGHTS ..............................................................49
EXERCISES.............................................................................49
Chapter 5
Understanding the Stack.......................................... 51
A QUICK OVERVIEW OF DATA TYPES...........................................51
NAME LOOKUP .................................................................................53
HOW OPERATORS USE THE STACK..............................................53
GROUPING AND VISUAL CHUNKING .............................................56
THINKING BACKWARD AND SIDEWAYS........................................58
COMPOSITE OBJECTS ....................................................................61
THE OTHER STACKS .......................................................................62
CONCLUDING THOUGHTS ..............................................................63
EXERCISES............................................................................ 64
Chapter 6
Trusting the Stack .....................................................67
SAFETY OF DATA ON THE STACK .................................................68
WHERE ARE THE DATA GOING?....................................................69
REARRANGING THE STACK............................................................71
CONDITIONALS AND LOOPS...........................................................73
RECURSION AND LOCAL VARIABLES............................................76
CONCLUDING THOUGHTS ..............................................................77
EXERCISES............................................................................ 78
Chapter 7
Building Conditional Statements .............................79
SIMPLE CONDITIONALS ..................................................................80
SETTING UP THE CONDITION.........................................................81
CONDITIONALS ARE NOT MAGIC...................................................86
NESTED CONDITIONALS AND ELSE CLAUSES ............................87
COMPOUND CONDITIONALS ..........................................................88
CONCLUDING THOUGHTS ..............................................................90
EXERCISES............................................................................ 91
Chapter 8
Using Looping Constructs ....................................... 93
LOOP BASICS ...................................................................................94
USING THE LOOP INDEX.................................................................95
LOOPS ARE PROCEDURE BODIES ................................................99
LOOPS OF INSTRUCTIONS ...........................................................101
EXITING LOOPS PREMATURELY..................................................102
CONCLUDING THOUGHTS ............................................................103
EXERCISES...........................................................................103
Chapter 9
Procedures .............................................................. 105
WHAT EXACTLY IS A PROCEDURE?............................................106
PARAMETER PASSING ..................................................................108
CONSTRUCTING GOOD PROCEDURES ......................................111
SELF-MODIFYING PROCEDURES.................................................114
CONCLUDING THOUGHTS ............................................................116
EXERCISES...........................................................................117
Chapter 10
Using Dictionaries................................................... 119
DICTIONARIES FOR NAME SCOPING ..........................................120
LOCAL DICTIONARIES ...................................................................121
GLOBAL DICTIONARIES OF PROCEDURES ................................123
MAINTAINING THE DICTIONARY STACK......................................124
INTO AND OUT OF DICTIONARIES ...............................................126
LOOKING INTO DICTIONARIES.....................................................127
REDEFINING OPERATORS............................................................130
CONCLUDING THOUGHTS ............................................................132
EXERCISES...........................................................................133
Chapter 11
Creating and Manipulating Data.............................135
CONSTRUCTING AN ARRAY .........................................................135
CONSTRUCTING A STRING...........................................................137
MANIPULATING DATA WITH PUT AND GET.................................137
CONCATENATING ARRAYS AND STRINGS.................................139
INPUT AND OUTPUT OF STRING DATA .......................................140
ARRAYS VERSUS DICTIONARIES ................................................141
ADVANCED TECHNIQUES.............................................................142
CONCLUDING THOUGHTS ............................................................143
EXERCISES.......................................................................... 144
Chapter 12
Storing and Using Data...........................................145
CLASSICAL DATA STRUCTURES..................................................151
CONCLUDING THOUGHTS ............................................................156
EXERCISES.......................................................................... 156
Chapter 13
Program Data and Instructions ..............................157
TURNING DATA INTO INSTRUCTIONS.........................................159
TURNING INSTRUCTIONS INTO DATA.........................................161
DATA CONVERSIONS ....................................................................163
CONCLUDING THOUGHTS ............................................................165
EXERCISES.......................................................................... 165
Chapter 14
Using Files and Input/Output Techniques ............167
OPENING AND CLOSING FILES ....................................................170
READING AND WRITING FILES.....................................................172
WRITING FORMATTED DATA TO FILES.......................................175
FILE STATUS INFORMATION.........................................................178
RANDOM VERSUS SEQUENTIAL ACCESS ..................................179
CONCLUDING THOUGHTS ............................................................180
EXERCISES...........................................................................180
Appendix
Answers to Exercises ............................................. 185
Index of Example Programs ................................... 209
Subject Index ........................................................... 217

Download this book click here

Another Programming Language books click here
Continue Reading ...

Discrete Mathematics













Contents
1 Introduction 5
2 Let us count! 7
2.1 A party . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2 Sets and the like . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.3 The number of subsets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.4 Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.5 Permutations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3 Induction 21
3.1 The sum of odd numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.2 Subset counting revisited . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.3 Counting regions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4 Counting subsets 27
4.1 The number of ordered subsets . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.2 The number of subsets of a given size . . . . . . . . . . . . . . . . . . . . . 28
4.3 The Binomial Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.4 Distributing presents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.5 Anagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.6 Distributing money . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5 Pascal’s Triangle 35
5.1 Identities in the Pascal Triangle . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.2 A bird’s eye view at the Pascal Triangle . . . . . . . . . . . . . . . . . . . . 38
6 Fibonacci numbers 45
6.1 Fibonacci’s exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
6.2 Lots of identities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
6.3 A formula for the Fibonacci numbers . . . . . . . . . . . . . . . . . . . . . . 47
7 Combinatorial probability 51
7.1 Events and probabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
7.2 Independent repetition of an experiment . . . . . . . . . . . . . . . . . . . . 52
7.3 The Law of Large Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
8 Integers, divisors, and primes 55
8.1 Divisibility of integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
8.2 Primes and their history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
8.3 Factorization into primes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
8.4 On the set of primes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
8.5 Fermat’s “Little” Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
8.6 The Euclidean Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
8.7 Testing for primality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
9 Graphs 73
9.1 Even and odd degrees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
9.2 Paths, cycles, and connectivity . . . . . . . . . . . . . . . . . . . . . . . . . 77
10 Trees 81
10.1 How to grow a tree? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
10.2 Rooted trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
10.3 How many trees are there? . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
10.4 How to store a tree? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
11 Finding the optimum 93
11.1 Finding the best tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
11.2 Traveling Salesman . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
12 Matchings in graphs 98
12.1 A dancing problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
12.2 Another matching problem . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
12.3 The main theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
12.4 How to find a perfect matching? . . . . . . . . . . . . . . . . . . . . . . . . 104
12.5 Hamiltonian cycles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
13 Graph coloring 110
13.1 Coloring regions: an easy case . . . . . . . . . . . . . . . . . . . . . . . . . . 110
14 A Connecticut class in King Arthur’s court 114
15 A glimpse of cryptography 117
15.1 Classical cryptography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
16 One-time pads 117
16.1 How to save the last move in chess? . . . . . . . . . . . . . . . . . . . . . . 118
16.2 How to verify a password—without learning it? . . . . . . . . . . . . . . . . 120
16.3 How to find these primes? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
16.4 Public key cryptography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122

Download this book click here
Another The Core of Computer Science books click here
Continue Reading ...

Sunday, July 4, 2010

Java Programming with Oracle JDBC













Learn how to leverage JDBC, a key Java technology used to access relational data from Java programs, in an Oracle environment. Author Donald Bales begins by teaching you the mysteries of
establishing database connections, and how to issue SQL queries and get results back. You'll move on to advanced topics such as streaming large objects, calling PL/SQL procedures, and working with Oracle9i's object-oriented features, then finish with a look at transactions, concurrency management, and performance.

Java Programming with Oracle JDBC
Preface
Why I Wrote This Book
This Book's Intended Audience
Structure of This Book
Conventions Used in This Book
Software and Versions
Comments and Questions
Acknowledgments
I: Overview
Introduction to JDBC
1.1 The JDBC API
1.2 Clients
1.3 Using SQL
II: Connections
2. Application Database Connections
2.1 JDBC Drivers
2.2 Installation
2.3 Connecting to a Database
2.4 Handling Exceptions
3. Applet Database Connections
3.1 Oracle Drivers and JDK Versions
3.2 It's an Applet's Life
3.3 Packaging Your Applet
3.4 Getting Around the Sandbox

3.5 Establishing a Connection Through a Firewall
3.6 Guidelines for Choosing a Workaround
4. Servlet Database Connections
4.1 Oracle Driver Selection
4.2 Servlet Connection Strategies
4.3 Guidelines for Choosing a Connection Strategy
5. Internal Database Connections
5.1 Server-Side Driver Types
5.2 Using the Server-Side Internal Driver
5.3 Using the Server-Side Thin Driver
5.4 JServer Program Support
6. Oracle Advanced Security
6.1 Authentication
6.2 Data Encryption
6.3 Data Integrity
6.4 A Data Encryption and Integrity Example
6.5 Secure Sockets Layer
7. JNDI and Connection Pooling
7.1 DataSources
7.2 Oracle's Connection Cache
III: Relational SQL
8. A Relational SQL Example
8.1 Relational Database Analysis
8.2 Refining the Analysis
8.3 Relational Database Design
9. Statements
9.1 Creating a Statement Object
9.2 The execute( ) Method
9.3 The executeUpdate( ) Method
9.4 The executeQuery( ) Method
9.5 OracleStatement Implements Statement
10. Result Sets
10.1 Basic Cursor Positioning
10.2 Data Types
10.3 Accessor Methods
10.4 Scrollable, Updateable Result Sets
10.5 ResultSet Is an OracleResultSet
11. Prepared Statements
11.1 A Prepared Statement Versus a Statement
11.2 Formulating SQL Statements
11.3 Batching
11.4 PreparedStatement Is an OraclePreparedStatement
12. Streaming Data Types
12.1 BLOBs
12.2 CLOBs
12.3 BFILEs
12.4 LONG RAWs
12.5 LONGs
13. Callable Statements
13.1 Understanding Stored Procedures
13.2 Calling Stored Procedures
13.3 CallableStatement Is an OracleCallableStatement
IV: Object-Relational SQL
14. An Object-Relational SQL Example
14.1 From Relational Tables to Object Views
14.2 Object Tables
15. Weakly Typed Object SQL
15.1 Accessing Objects as Relational Tables
15.2 Structs
15.3 Arrays
15.4 Refs
15.5 Calling Object Methods
15.6 Putting It All Together
15.7 Oracle's Implementations
16. Strongly Typed Object SQL
16.1 JPublisher
16.2 The SQLData Interface
16.3 Oracle's CustomDatum Interface
V: Essentials
17. Transactions
17.1 Manual Transactions
17.2 Transaction Scope
17.3 Implicit Locking and Visibility
17.4 Isolation Levels
17.5 Distributed Transactions
18. Detection and Locking
18.1 Oracle's Locking Mechanisms
18.2 Detection
18.3 Data Integrity Solutions
19. Performance
19.1 A Testing Framework
19.2 Auto-Commit
19.3 SQL92 Token Parsing
19.4 Statement Versus PreparedStatement
19.5 Batching
19.6 Predefined SELECT Statements
19.7 CallableStatements
19.8 OCI Versus Thin Drivers
20. Troubleshooting
20.1 The "Gotchas"
20.2 Unsupported Features
20.3 Debugging
20.4 Net8 Tracing
20.5 Wait for the Cure


Download this book click here
Another Database books click here
Another Java books click here
Continue Reading ...

Java Security 2nd Edition














The second edition focuses on the platform features of Java that provide security--the class loader, bytecode verifier, and security manager--and recent additions to Java that enhance this security model: digital signatures, security providers, and the access controller. The book covers in depth the security model of Java 2, version 1.3, including the two new security APIs: JAAS and JSSE.

Table of Contents
Preface.................................................................................................................................................................1
Who Should Read This Book?.................................................................................................................1
Versions Used in This Book....................................................................................................................2
Conventions Used in This Book..............................................................................................................2
Organization of This Book.......................................................................................................................3
What's New in This Edition.....................................................................................................................5
How to Contact Us..................................................................................................................................5
Acknowledgments...................................................................................................................................6
Feedback for the Author.........................................................................................................................6
Chapter 1. Java Application Security...............................................................................................................7
1.1 What Is Security?..............................................................................................................................7
1.2 Software Used in This Book..............................................................................................................9
1.3 The Java Sandbox...........................................................................................................................14
1.4 Security Debugging........................................................................................................................17
1.5 Summary.........................................................................................................................................19
Chapter 2. The Default Sandbox.....................................................................................................................21
2.1 Elements of the Java Sandbox.........................................................................................................21
2.2 Permissions.....................................................................................................................................22
2.3 Keystores.........................................................................................................................................32
2.4 Code Sources..................................................................................................................................33
2.5 Policy Files.....................................................................................................................................33
2.6 The Default Sandbox.......................................................................................................................37
2.7 The java.security File.......................................................................................................................39
2.8 Comparison with Previous Releases................................................................................................40
2.9 Summary.........................................................................................................................................40
Chapter 3. Java Language Security................................................................................................................41
3.1 Java Language Security Constructs.................................................................................................41
3.2 Enforcement of the Java Language Rules........................................................................................46
3.3 Comparisons with Previous Releases..............................................................................................50
3.4 Summary.........................................................................................................................................51
Chapter 4. The Security Manager...................................................................................................................53
4.1 Overview of the Security Manager..................................................................................................53
4.2 Operating on the Security Manager.................................................................................................57
4.3 Methods of the Security Manager....................................................................................................58
4.4 Comparison with Previous Releases................................................................................................73
4.5 Summary.........................................................................................................................................74
Chapter 5. The Access Controller...................................................................................................................77
5.1 The CodeSource Class.....................................................................................................................77
5.2 Permissions.....................................................................................................................................78
5.3 The Policy Class.............................................................................................................................87
5.4 Protection Domains.........................................................................................................................90
5.5 The AccessController Class.............................................................................................................91
5.6 Guarded Objects..............................................................................................................................96
5.7 Comparison with Previous Releases................................................................................................97
5.8 Summary.........................................................................................................................................97
Chapter 6. Java Class Loaders........................................................................................................................99
6.1 The Class Loader and Namespaces..................................................................................................99
6.2 Class Loading Architecture............................................................................................................101
6.3 Implementing a Class Loader........................................................................................................102
6.4 Miscellaneous Class Loading Topics.............................................................................................110
6.5 Comparison with Previous Releases..............................................................................................112
6.6 Summary.......................................................................................................................................112
Chapter 7. Introduction to Cryptography....................................................................................................113
7.1 The Need for Authentication.........................................................................................................113
7.2 The Role of Authentication............................................................................................................117
7.3 Cryptographic Engines...................................................................................................................118
7.4 Summary.......................................................................................................................................122
Chapter 8. Security Providers......................................................................................................................123
8.1 The Architecture of Security Providers.........................................................................................123
8.2 The Provider Class.........................................................................................................................127
8.3 The Security Class.........................................................................................................................132
8.4 The Architecture of Engine Classes...............................................................................................137
8.5 Comparison with Previous Releases..............................................................................................137
8.6 Summary.......................................................................................................................................138
Chapter 9. Keys and Certificates...................................................................................................................139
9.1 Keys..............................................................................................................................................140
9.2 Generating Keys............................................................................................................................143
9.3 Key Factories................................................................................................................................151
9.4 Certificates....................................................................................................................................160
9.5 Keys, Certificates, and Object Serialization..................................................................................171
9.6 Comparison with Previous Releases..............................................................................................172
9.7 Summary.......................................................................................................................................172
Chapter 10. Key Management......................................................................................................................175
10.1 Key Management Terms..............................................................................................................175
10.2 The keytool.................................................................................................................................178
10.3 The Key Management API..........................................................................................................188
10.4 A Key Management Example......................................................................................................194
10.5 Secret Key Management..............................................................................................................199
10.6 Comparison with Previous Releases............................................................................................205
10.7 Summary.....................................................................................................................................206
Chapter 11. Message Digests.........................................................................................................................207
11.1 Using the Message Digest Class..................................................................................................207
11.2 Secure Message Digests...............................................................................................................210
11.3 Message Digest Streams..............................................................................................................212
11.4 Implementing a MessageDigest Class.........................................................................................216
11.5 Comparison with Previous Releases............................................................................................219
11.6 Summary.....................................................................................................................................219
ii
Chapter 12. Digital Signatures......................................................................................................................221
12.1 The Signature Class.....................................................................................................................221
12.2 Signed Classes............................................................................................................................230
12.3 Implementing a Signature Class..................................................................................................237
12.4 Comparison with Previous Releases............................................................................................241
12.5 Summary.....................................................................................................................................241
Chapter 13. Cipher−Based Encryption.........................................................................................................243
13.1 The Cipher Engine.......................................................................................................................243
13.2 Cipher Streams............................................................................................................................256
13.3 Sealed Objects.............................................................................................................................259
13.4 Comparison with Previous Releases............................................................................................260
13.5 Summary.....................................................................................................................................260
Chapter 14. SSL and HTTPS.........................................................................................................................261
14.1 An Overview of SSL and JSSE...................................................................................................261
14.2 SSL Client and Server Sockets....................................................................................................268
14.3 SSL Sessions...............................................................................................................................271
14.4 SSL Contexts and Key Managers................................................................................................273
14.5 Miscellaneous SSL Issues............................................................................................................281
14.6 The HTTPS Protocol Handler......................................................................................................286
14.7 Debugging JSSE..........................................................................................................................289
14.8 Summary.....................................................................................................................................290
Chapter 15. Authentication and Authorization...........................................................................................291
15.1 JAAS Overview..........................................................................................................................291
15.2 Simple JAAS programming.........................................................................................................293
15.3 Simple JAAS Administration......................................................................................................296
15.4 Advanced JAAS Topics...............................................................................................................303
15.5 Summary.....................................................................................................................................316
Appendix A. The java.security File...............................................................................................................317
Appendix B. Security Resources....................................................................................................................321
B.1 Security Bugs...............................................................................................................................321
B.2 Third−Party Security Providers.....................................................................................................325
B.3 Security References......................................................................................................................327
Appendix C. Identity−Based Key Management...........................................................................................329
C.1 Javakey.........................................................................................................................................329
C.2 Identities.......................................................................................................................................333
C.3 Identity Scopes.............................................................................................................................338
C.4 Key Management in an Identity Scope.........................................................................................344
C.5 Summary......................................................................................................................................351
Appendix D. The Secure Java Container.....................................................................................................353
D.1 The 1.1−Based Class Loader........................................................................................................353
D.2 The 1.1−Based Security Manager.................................................................................................358
D.3 Running Secure Applications........................................................................................................375
D.4 Summary......................................................................................................................................377
Appendix E. Implementing a JCE Security Provider.................................................................................379
Appendix F. Quick Reference.......................................................................................................................385
F.1 Package java.security.....................................................................................................................385
F.2 Package java.security.cert..............................................................................................................411
F.3 Package java.security.interfaces....................................................................................................416
F.4 Package java.security.spec.............................................................................................................420
F.5 Package javax.crypto.....................................................................................................................425
F.6 Package javax.crypto.interfaces.....................................................................................................435
F.7 Package javax.crypto.spec.............................................................................................................436
F.8 Package javax.net..........................................................................................................................442
F.9 Package javax.net.ssl.....................................................................................................................443
F.10 Package javax.security.auth.........................................................................................................448
F.11 Package javax.security.auth.callback..........................................................................................452
F.12 Package javax.security.auth.login................................................................................................456
F.13 Package javax.security.auth.spi...................................................................................................458
F.14 Package javax.security.cert..........................................................................................................458
F.15 Package com.sun.net.ssl..............................................................................................................460
F.16 Package com.sun.security.auth....................................................................................................466
F.17 Package com.sun.security.auth.login...........................................................................................472
F.18 Package com.sun.security.auth.module.......................................................................................472
F.19 Miscellaneous Packages..............................................................................................................474

Download this book click here
Another Computer Security books click here
Another Java books click here
Continue Reading ...

Related Posts with Thumbnails

Put Your Ads Here!

Recent Posts