Syed Ihtisham Ul Hassan Shah 20PLR04625
Syed Ihtisham Ul Hassan Shah 20PLR04625
LEVEL : LIS
Semester: Autumn 2023
Assignment No. 02
SYED IHTISHAM UL HASSAN SHAH
20PLR04625
Name.
Course.Bs library and information science
User id.
Semester.Autumn 2023
Code book.9213.
Assignment No. 2
Question no.1.
Discuss in the various steps involved in programing the
application/database.
Answer.A properly designed database provides you with access to up-
to-date, accurate information. Because a correct design is essential to
achieving your goals in working with a database, investing the time
required to learn the principles of good design makes sense. In the end,
you are much more likely to end up with a database that meets your
needs and can easily accommodate change.
This article provides guidelines for planning a desktop database. You will
learn how to decide what information you need, how to divide that
information into the appropriate tables and columns, and how those
tables relate to each other. You should read this article before you
create your first desktop database.
Programming an application with a database involves several key
steps:
Design:
Create a system architecture outlining components and their
interactions.
Design the database schema, specifying tables, relationships, and
constraints.
Plan the user interface and overall application flow.
Choose Technology Stack:
Select the programming language (e.g., Python, Java, C#).
Choose a database management system (e.g., MySQL, PostgreSQL,
MongoDB).
Consider frameworks and libraries for development.
Testing:
Conduct unit testing to validate individual components.
Perform integration testing to ensure different modules work
together.
Test database operations, including CRUD (Create, Read, Update,
Delete) functionality.
Debugging:
Identify and fix errors in the code.
Use debugging tools to trace and resolve issues.
Conduct thorough testing after each debugging iteration.
Determine the purpose of your database
This helps prepare you for the remaining steps.
Find and organize the information required
Gather all of the types of information you might want to record in the
database, such as product name and order number.
Divide the information into tables
Divide your information items into major entities or subjects, such as
Products or Orders. Each subject then becomes a table.
Turn information items into columns
Decide what information you want to store in each table. Each item
becomes a field, and is displayed as a column in the table. For example,
an Employees table might include fields such as Last Name and Hire
Date.
Specify primary keys
Choose each table’s primary key. The primary key is a column that is
used to uniquely identify each row. An example might be Product ID or
Order ID.
Set up the table relationships
Look at each table and decide how the data in one table is related to
the data in other tables. Add fields to tables or create new tables to
clarify the relationships, as necessary.
Refine your design
Analyze your design for errors. Create the tables and add a few records
of sample data. See if you can get the results you want from your
tables. Make adjustments to the design, as needed.
Apply the normalization rules
Apply the data normalization rules to see if your tables are structured
correctly. Make adjustments to the tables, as needed.
Optimization:
Optimize database queries for better performance.
Fine-tune code for efficiency.
Address any bottlenecks or resource-intensive processes.
Documentation:
Create comprehensive documentation for code, APIs, and
database structure.
Include setup instructions, usage guidelines, and troubleshooting
information.
Deployment:
Prepare the application for deployment to a production
environment.
Set up the database on a production server.
Ensure proper configuration and scalability.
User Training and Support:
Provide training materials for end-users.
Establish a support system for addressing user issues.
Gather feedback for future improvements.
These steps ensure a systematic and effective approach to programming
an application with a database, covering everything from initial
planning to ongoing maintenance.
Question no.2.
Explain in full details the internal and external security related
techniques of database/application.
Answer.
Security is a critical aspect of both database and application
development.
Here are details on internal and external security techniques:
Internal Security Techniques:
Authorization:
Employ role-based access control (RBAC) to restrict access based
on user roles.
Limit privileges to the minimum necessary for each user or role.
Regularly audit and update access permissions.
Audit Trails:
Maintain detailed audit logs for all database activities.
Log login attempts, data modifications, and access changes.
Regularly review and analyze audit trails for suspicious activities.
4. Integrity Check
Over time, your database will go through numerous changes. Data will
be added and removed, tables will be added, modified, and removed.
The database’s overall schema will change. Indexes will be added,
rebuild, deleted, and re-created. Data columns will be added, modified,
and removed. The database will go through thousands upon thousands
of changes just as a natural course of its lifespan. But each change, no
matter how small, has the potential to introduce corruption into the
database. Indexes can have corrupt pages, table can have bad records,
the schema can contain inaccurate references. These different types of
corruption can cause anything from simple performance issues to
complete schema failure and catastrophic data loss. But this is where
the Integrity Check comes into play. The Database Integrity Check
examines and analyzes the database in its entirety, and can detect and
repair most any corruption it comes across. The database integrity
check should be run on a regular, reoccurring, weekly schedule. The
Integrity Check is your best weapon to prevent catastrophic data loss.
WorkSpace has a built in Integrity Check that any OTP user with Admin
rights can run on demand. If any corruption was detected or repaired,
WorkSpace will immediately inform the user of the details, severity, and
actions taken. In nearly all cases, that is where the corruption will end,
and there will be no need for further action. But if you run an integrity
check and WorkSpace reports that an issue was detected but was not
resolved, please contact the Office Tools Technical Support team
immediately. Our data specialists have decades of experience working
with SQL Server databases and have been able to recover data that
others though was completely irrecoverable.
Question no 4
Define public interface. Also discuss the different components of
public interface with examples
Answer.
A public interface, in the context of software development, refers to the
set of methods, functions, and protocols that are made available to the
users or other parts of the software. It serves as the boundary between
different software components, providing a clear and well-defined
means of interaction. The public interface hides the internal workings of
a module or class, allowing for encapsulation and abstraction.
Properties/Attributes:
Definition: Publicly accessible variables or attributes that provide
information about the state of an object.
Example: In a class representing a car, properties like color, speed, and
fuelLevel could be part of the public interface.
Events/Callbacks:
Definition: Mechanisms for notifying external entities about specific
occurrences or changes.
Example: In a graphical user interface (GUI) library, events like onClick
or onHover could be part of the public interface to handle user
interactions.
Data Structures:
Definition: Publicly exposed structures or collections for organizing and
storing data.
Example: In a data processing library, a public interface might include
classes like LinkedList or Dictionary along with their associated
methods.
Example: Providing inline comments, README files, or official
documentation that guides users on how to interact with the public
interface.
Error Handling:
Definition: Publicly exposed mechanisms for handling and reporting
errors or exceptions.
Example: Including error codes, exception classes, or error-handling
functions/methods in the public interface to help users gracefully
handle unexpected situations.
Access Modifiers:
Definition: Specifying the visibility and accessibility of elements in the
public interface (e.g., public, private, protected).
Example: Marking certain methods as private to encapsulate internal
functionality while exposing only essential methods and properties as
public.
A well-designed public interface is crucial for creating modular,
maintainable, and scalable software systems. It allows for effective
communication between different parts of a program, promotes
encapsulation, and simplifies the complexity for users or developers
interacting with the software.
Q5. Write short notes on the following:
a. Authority table maintenance
Authority table maintenance typically refers to the process of managing
and updating an authority table within a database or system. An
authority table is a reference table that stores information about user
roles, permissions, or access levels. Here’s a breakdown of the key
components:
Authority Table:
An authority table is a database table that holds information
related to user permissions and roles.
It typically includes fields such as user ID, role ID, and permissions.
User Roles:
Roles define a set of permissions or actions that a user with that
role can perform.
Examples of roles might include “Admin,” “Manager,” or “User.”
Permissions:
Permissions specify the actions or operations a user with a
particular role can undertake.
These can include read, write, update, delete, or specific access to
certain functionalities.
Maintenance Process:
Regularly update the authority table to reflect changes in user
roles or permissions.
Add new roles or modify existing ones as organizational needs
evolve.
Ensure that users are assigned appropriate roles to align with their
responsibilities.
User Access Management:
Grant or revoke permissions based on changes in user roles or job
requirements.
Monitor and adjust access levels to maintain security and
compliance.
Security Considerations:
Implement robust security measures to protect the authority table
from unauthorized access.
Regularly audit and review access controls to identify and mitigate
potential security risks.
Integration with Applications:
Ensure that the authority table integrates seamlessly with the
applications or systems that rely on it for access control.
Applications should query the authority table to determine user
permissions dynamically.
Logging and Auditing:
Implement logging mechanisms to track changes made to the
authority table.
Regularly audit these logs to detect and respond to any suspicious
or unauthorized activities.
Documentation:
Maintain comprehensive documentation for the authority table
schema, roles, and permissions.
Documentation should include guidelines for administrators on
how to manage and update the authority table.
Testing:
Conduct thorough testing when making changes to the authority
table to ensure that access controls function as intended.
Test scenarios where users assume different roles to validate
proper permissions.
In summary, authority table maintenance involves managing a
structured table that defines user roles, permissions, and access levels
within a system. Regular updates, security considerations, integration
with applications, and proper documentation are crucial aspects of
maintaining an effective authority table.
b. Maintaining and upgrading application
Maintaining and upgrading applications involves ongoing efforts to
ensure software remains functional, secure, and up-to-date.
Maintenance includes fixing bugs, addressing security vulnerabilities,
and making performance improvements. Upgrades typically involve
introducing new features, compatibility enhancements, or adapting the
application to newer technologies. This process is crucial for a
software’s longevity and effectiveness in meeting evolving user needs.
c. Creating the configuration file
To create a configuration file, you typically need to define settings and
parameters for a specific application or system. Here’s a general guide:
Choose a Format:
Decide on the format of your configuration file. Common formats
include JSON, YAML, XML, or INI. Each has its own syntax and structure.
Define Sections and Keys:
If using a format like INI or some flavors of YAML, you might organize
the file into sections. In JSON or XML, you can structure the data
hierarchically. Define keys for each setting you want to configure.
Specify Values:
Assign values to the keys based on the configuration you need. This
could include things like database connection details, API keys, or
general application settings.
Example (INI Format):
Ini
[Database]
Host = localhost
Port = 3306
Username = myuser
Password = mypassword
[App]
Debug = true
Log_level = INFO
Save the File:
Save the configuration file with a meaningful name and the appropriate
extension (.json, .yaml, .ini, etc.). Place it in a location accessible by your
application.
Read and Parse:
In your application code, implement logic to read and parse the
configuration file. Libraries or built-in functions are often available for
this purpose, depending on the programming language you’re using.
Handle Errors:
Include error-handling mechanisms in your code to manage situations
where the configuration file is missing or contains errors. Provide
meaningful error messages to assist with troubleshooting.
Update Dynamically (Optional):
Depending on your application’s requirements, you might want to allow
users to update the configuration dynamically without restarting the
application. Implement a mechanism for safely updating the
configuration at runtime.Remember, the specifics may vary based on
the programming language and framework you’re using, but these
general steps should give you a good starting point. If you have a
specific language or framework in mind, let me know for more tailored
guidance.
d. Authority Entries
Authority entries, in various contexts, refer to comprehensive records or
profiles of authoritative figures, institutions, or entities. These entries
often include detailed information such as:
Personal Information: Names, titles, positions, and affiliations of
individuals.
Professional Background: Educational qualifications, career history, and
relevant experience.
Achievements and Contributions: Notable accomplishments or
contributions to a particular field or industry.
Roles and Responsibilities: Details about the roles and responsibilities
held by the authority figure.
Publications and Works: Any written works, publications, or significant
projects associated with the authority.
Recognition and Awards: Honors, awards, or recognitions received for
outstanding performance or contributions.
Contact Information: Relevant contact details for communication or
collaboration.
These entries are often found in reference materials, directories, or
databases and serve as a comprehensive source for understanding the
background and impact of authoritative figures in a given domain. The
specific content may vary depending on the purpose and scope of the
authority entries, whether they pertain to academic, professional, or
other contexts.