Comparison of Patterns with Packages
One of the tasks we had to do in groups was to establish the differences between other reusable tools and Patterns .The groups were allocated a reusable tool to research on and we had to research on Packages .
I have previously discussed what a pattern is in the previous posting hence will start with discussing Packages .
Definitions :
A packages is self –contained unit of user-defined variable and subroutines ,which can be reused over and over again .
A package is a collection of related types providing access protection and name space management .Note that types refers to classes , interfaces, enumerators and annotations .
A package is a unique named collection of classes .The purpose of grouping the classes is a package with a unique name is to make it easy to add any or all of the classes in a package into your program .
Packages are grouped according to their functionality and usability and all packages should be thought of as independent of one another (They need to be imported into a program to be used).
Uses of Packages
- Importing date and time formats to the program.
- Managing and implementation of networks .
- Producing a variation of graphic user interfaces and images .
- Provides classes and interfaces relating to fonts [1].
- Provides for system input and output through data streams, serialization and the file system[1] .
- Provides the classes and interfaces for the security framework [1].
For detailed explanation on the uses of packages visit the following website it describes different java package extensions and what they are used for. [1]
Advantages of packages
- Easy to maintain as they are a collection of related files put into one directory.
- Easy organises files in a package as a unique naming system is used to name and organise files with same names .
- Help prevent naming conflicts when the same class name for other classes .
- Reliability easy to locate and use class files
- Packages promote collaboration among developers as they are standardised
- Packages are reusable and save time as they reduce the potential number of bugs that might need elimination when programming is redone.
Disadvantages
Once written they can’t be modified where patterns are extensible. [2]
Patterns Vs Packages
A pattern is a concept
package : It`s a piece of software and code
patterns: The concept can be used in any object oriented programming language
Packages are normally written to suit a specific programming language e.g. Java Packages
Patterns are used in the design phase of the Software development life cycle .
To use packages in a particular language one has to be knowledgeable in that language.
Patterns enable programmers to communicate novices to learn and relate as the walkthrough
programs.
Packages can only be imported into the programs but can not be modified by the developers.
Patterns are flexible thus they can be modified with ease.
Patterns are templates or guides as they outline the best possible solution .
Packages are used in the coding phase of the Software development life cycle .
Reference:
[1]
http://java.sun.com/j2se/1.3/docs/api/overview-summary.html
[2]
http://etude.uwaterloo.ca/~swsiu/thesis/node44.html#SECTION007310000000
[3]
Design Patterns Elements of Reusable Object –Oriented Software
NB: Note the next posting is a continuation of the comparison of reusable tools and patterns
0 Comments:
Post a Comment
<< Home