Assignment 1 Frontsheet JAVA
Assignment 1 Frontsheet JAVA
1>
Learner declaration:
I certify that the work submitted for this assignment is my own and research sources are fully acknowledged.
Grading grid
1
Assignment title Simulation in .NET for Mobilize You
In this assignment, you will have opportunities to provide evidence against the following criteria.
Indicate the page numbers where the evidence can be found.
2
1.3 critically evaluate the
components that support
the .NET framework
3
The report should contain written
analysis to justify the design you have
produced in task 2. You need to state
2.2 explain the components what features have been
and data and file structures included/excluded and why certain
required to implement a features have been used over others
given design (where applicable) Example code can be
used to help clarify features. You should
include diagrams from your design
4
Summative feedback
6
1.1 discuss the principles, characteristics and features of programming using a .NET framework
The Microsoft .NET Framework is a software framework that can be installed on computers
running Microsoft Windows operating systems. It includes a large library of coded solutions to common
programming problems and a virtual machine that manages the execution of programs written
specifically for the framework. The .NET Framework is a Microsoft offering and is intended to be used by
most new applications created for the Windows platform.
The framework's Base Class Library provides a large range of features including user interface,
data and data access, database connectivity, cryptography, web application development, numeric
algorithms, and network communications. The class library is used by programmers, who combine it with
their own code to produce applications.
Programs written for the .NET Framework execute in a software environment that manages the
program's runtime requirements. Also part of the .NET Framework, this runtime environment is known
as the Common Language Runtime (CLR). The CLR provides the appearance of an application virtual
machine so that programmers need not consider the capabilities of the specific CPU that will execute the
program. The CLR also provides other important services such as security, memory management, and
exception handling. The class library and the CLR together constitute the .NET Framework.
o Type safety:
.NET framework performs operations on the values or objects for which .NET framework requires each
value or object has a type and which reference to the value or object type
.NET framework manages the state of the object while executing the .NET applications
.NET framework automatically allocates memory and provides garbage collection mechanism to de
allocate memory
7
o Side by side execution
.NET framework allows different version of the same application to run on the same machine by using
asemblies of different versions. Assemblies consist of IL code and metadata. Where metadata
determines the application dependencies. By this .NET framework runtime executes multiple version of
assembly and solves the major problem of legacy development environment
Principles
Abstraction
The word abstract means a concept or an idea not associated with any specific instance. In programming
we apply the same meaning of abstraction by making classes not associated with any specific instance.
The abstraction is done when we need to only inherit from a certain class, but not need to instantiate
objects of that class. In such case the base class can be regarded as "Incomplete". Such classes are
known as an "Abstract Base Class".
1. An Abstract Base class can not be instantiated; it means the object of that class can not be
created.
2. Class having abstract keyword and having, abstract keyword with some of its methods (not all) is
known as an Abstract Base Class.
3. Class having Abstract keyword and having abstract keyword with all of its methods is known as
pure Abstract Base Class.
4. The method of abstract class that has no implementation is known as "operation". It can be
defined as abstract void method ();
5. An abstract class holds the methods but the actual implementation of those methods is made in
derived class.
8
Lets have a look of this code!
This is the Abstract Base Class, if I make both of its methods abstract then this class would become a
pure Abstract Base Class.
Here you can see we have 2 methods in the Abstract Base Class, the method eat() has no
implementation; that is why it is being declared as 'abstract' while the method sound() has its own body
so it is not declared as 'abstract'. In the derived class we have the same name method but this method
has it's body. We are doing abstraction here so that we can access the method of derived class without
any trouble.
9
Inheritance
One of the most important concepts in object-oriented programming is inheritance. Inheritance allows
us to define a class in terms of another class, which makes it easier to create and maintain an
application. This also provides an opportunity to reuse the code functionality and speeds up
implementation time.
When creating a class, instead of writing completely new data members and member functions, the
programmer can designate that the new class should inherit the members of an existing class. This
existing class is called the base class, and the new class is referred to as the derived class.
Polymorphism
The word polymorphism means having many forms. In object-oriented programming paradigm,
polymorphism is often expressed as 'one interface, multiple functions'.
10
Polymorphism can be static or dynamic. In static polymorphism, the response to a function is
determined at the compile time. In dynamic polymorphism, it is decided at run-time.
You can have multiple definitions for the same function name in the same scope. The definition of the
function must differ from each other by the types and/or the number of arguments in the argument list.
You cannot overload function declarations that differ only by return type.
Encapsulation
Encapsulation is defined 'as the process of enclosing one or more items within a physical or logical
package'. Encapsulation, in object oriented programming methodology, prevents access to
implementation details.
11
Abstraction and encapsulation are related features in object oriented programming. Abstraction allows
making relevant information visible and encapsulation enables a programmer to implement the desired
level of abstraction.
Encapsulation is implemented by using access specifiers. An access specifier defines the scope and
visibility of a class member. C# supports the following access specifiers:
Public
Private
Protected
Internal
Protected internal
Private access specifier allows a class to hide its member variables and member functions from other
functions and objects. Only functions of the same class can access its private members. Even an instance
of a class cannot access its private members.
Let us see an example of Department class. To manipulate the data in that class (String departname) we
define an accessor (get method) and mutator (set method).
12
Like the above way we can protect the private data from the outside world. Here we use two separate
methods to assign and get the required data.
In the above example we can't access the private data departname from an object instance. We
manipulate the data only using those two methods.
o Interoperability
Because interaction between new and older applications is commonly required, the .NET Framework
provides means to access functionality that is implemented in programs that execute outside the
.NET environment. Access to COM components is provided in the System.Runtime.InteropServices
and System.EnterpriseServices namespaces of the framework
o Common Runtime Engine
The Common Language Runtime (CLR) is the virtual machine component of the .NET Framework. All
.NET programs execute under the supervision of the CLR, guaranteeing certain properties and
behaviors in the areas of memory management, security, and exception handling.
o Language Independence
The .NET Framework introduces a Common Type System, or CTS. The CTS specification defines all
possible datatypes and programming constructs supported by the CLR and how they may or may not
interact with each other conforming to the Common Language Infrastructure (CLI) specification.
Because of this feature, the .NET Framework supports the exchange of types and object instances
between libraries and applications written using any conforming .NET language.
o Simplified Deployment
13
The .NET Framework includes design features and tools that help manage the installation of
computer software to ensure that it does not interfere with previously installed software, and that it
conforms to security requirements.
o Security
The design is meant to address some of the vulnerabilities, such as buffer overflows, that have been
exploited by malicious software. Additionally, .NET provides a common security model for all
applications.
o Portability
The design of the .NET Framework allows it to theoretically be platform agnostic, and thus cross-
platform compatible. That is, a program written to use the framework should run without change on
any type of system for which the framework is implemented.
o Assemblies
Defines the concept of assemblies, which are collections of types and resources that form logical
units of functionality. Assemblies are the fundamental units of deployment, version control, reuse,
activation scoping, and security permissions.
o Application Domains
Explains how to use application domains to provide isolation between applications.
o Runtime Hosts
Describes the runtime hosts supported by the .NET Framework, including ASP.NET, Internet Explorer,
and shell executables.
14
o Common Type System
Identifies the types supported by the common language runtime.
o Cross-Language Interoperability
Explains how managed objects created in different programming languages can interact with one
another.
15
1.2 critically compare different types of .NET framework architectures
.NET is tiered, modular, and hierarchal. Each tier of the .NET Framework is a layer of abstraction. .NET
languages are the top tier and the most abstracted level. The common language runtime is the bottom
tier, the least abstracted, and closest to the native environment. This is important since the common
language runtime works closely with the operating environment to manage .NET applications. The .NET
Framework is partitioned into modules, each with its own distinct responsibility. Finally, since higher
tiers request services only from the lower tiers, .NET is hierarchal. The architectural layout of the .NET
Framework is illustrated below.
16
.NET Framework is a managed environment. The common language runtime monitors the execution of
.NET applications and provides essential services. It manages memory, handles exceptions, ensures that
applications are well-behaved, and much more.
Language interoperability is one goal of .NET. .NET languages share a common runtime (the common
language runtime, a common class library), the Framework Class Library (FCL), a common component
model, and common types. In .NET, the programming language is a lifestyle choice. Except for subtle
differences, C#, VB.NET, or JScript.NET offer a similar experience.
.NET abstracts lower-level services, while retaining most of their flexibility. This is important to C-based
programmers, who shudder at the limitations presented in Visual Basic 6 and earlier.
17
1.3 critically evaluate the components that support the .NET framework
.NET Components
In-Process Components
In .NET, components built as DLLs run within the process space of the host application and share
memory and processor time with their host applications. At run time, the component (which is part of
the host application's assembly and is referenced by its manifest) is loaded from disk and added to the
host application's process space. Because no remote procedure calls are generated to mediate
communication between the component and its host, setting and reading property values, invoking
methods, and responding to events raised by the component occurs very quickly.
Out-of-Process Components
An alternate architecture involves server applications that run as independent processes outside of
the client application process space. These server applications usually (but not always) have an EXE file
name extension. When Windows loads an out-of-process component, a separate process space is
created for the component, and Windows manages the out-of-process component's resource
requirements independently of the client application. Windows mediates the dialog between the server
application (that is, the component) and the client (the consumer) by passing messages between them.
.NET Framework Languages
CLI Languages are computer programming languages that are used to produce libraries and programs
that conform to the Common Language Infrastructure (CLI) specifications. With some notable
exceptions, most CLI languages compile entirely to the Common Intermediate Language (CIL), an
intermediate language that can be executed using an implementation of CLI such as the Common
Language Runtime (CLR, a part of the Microsoft .NET Framework), Mono, or Portable.NET. Some of these
languages also require the Dynamic Language Runtime (DLR).
Microsoft started development on the .NET Framework in the late 1990s originally under the name of
Next Generation Windows Services (NGWS). By late 2001 the first beta versions of .NET 1.0 were
18
released.[1] The first version of .NET Framework was released on 13 February 2002, bringing managed
code to Windows NT 4.0, 98, 2000, ME and XP.
Since the first version, Microsoft has released nine more upgrades for .NET Framework, seven of which
have been released along with a new version of Visual Studio. Two of these upgrades, .NET Framework
2.0 and 4.0, have upgraded Common Language Runtime (CLR). New versions of .NET Framework replace
older versions when the CLR version is the same.
The .NET Framework family also includes two versions for mobile or Embedded device use. A reduced
version of the framework, the .NET Compact Framework, is available on Windows CE platforms,
including Windows Mobile devices such as smartphones. Additionally, the .NET Micro Framework is
targeted at severely resource-constrained devices.
19
1) Introduced CLR 4.0
4.0 Visual Studio 2010
2) Managed Extensibility Framework (MEF)
3) Dynamic Language Runtime (DLR)
4) Task Parallel Library
1) Built-In AJAX Support
3.5 Visual Studio 2008
2) LINQ
3) Dynamic Data
4) Multi-targeting Framework Support
1) Windows Presentation Foundation (WPF)
3.0 Visual Studio 2005
2) Windows Communications Foundation (WCF)
3) Windows Workflow Foundation (WF), and CardSpace
1) Introduced CLR 2.0
2.0 Visual Studio 2005
2) Generics and generic collections
3) Partial classes
4) Nullable types
5) Anonymous methods
6) Introduced many new controls and features to
ASP.NET
1) Features Enhancement to ASP.NET and ADO.NET
1.1 Visual Studio .NET 2003
2) Built-in support for mobile ASP.NET controls
3) Security Enhancement
4) Built-in support for ODBC and databases
5) Internet Protocol version 6 (IPv6) support
1) Introduced CLR 1.0
1.0 Visual Studio .NET
2) Support for Object-oriented Web application
development
3) Use of DLL class libraries
20
2.1 design a .NET programming solution to a given problem
A system has been designed for vehicle rental system, there is only manager can use the system
Sale staff: this user can add update delete view customer, vehicle, rent
Admin: this user can view report of the rent management system
21
Data Flow Diagram
ERD
22
Draft UI Design
23
Class Diagram
CustomerDAO RentDAO
RentDetailDAO VehicleDAO
+ add(Customer) : int + add(Rent) : int
+ delete(String) : int + delete(string) : int + add(RentDetail) : int + add(Vehicle) : int
+ getAll() : DataTable + getAll() : DataTable + delete(string) : int + delete(string) : int
+ update(Customer) : int + getAll(string) : DataTable + getAll() : DataTable
+ update(Rent) : int
+ update(Vehicle) : int
User
interface UserDAO
IUser - id: string
+ getAll(string, string) : DataTable + getAll(string, string) : DataTable - password: string
24
25
26
27
28
2.2 explain the components and data and file structures required to implement a given design
Components Details
29
CrystalReport1: this is crystal report, it is used to
report for the application
frmMain: this is main frame of the application
frmLogin: this is login frame to the system
frmCustomer: this is customer frame, it performs
customers features such as add update delete
- view
frmVehicle: this is vehicle frame, it performs
vehicles features such as add update delete -
view
frmRent: this is customer frame, it performs rents
features such as add update delete view
frmReport: this frame is used to report for the
application
30
Number Variable name Class Value type Initial value
1 id Vehicle String null
2 name Vehicle String null
3 make Vehicle String null
4 addon Vehicle String null
5 registyear Vehicle String null
6 rentperday Vehicle float null
7 vehicletype Vehicle String null
8 id Rent String null
9 customerid Rent String null
10 productid Rent String null
11 rentdate Rent String null
12 returndate Rent String null
13 total Rent float null
14 phone Customer String null
15 address Customer String null
16 ssn Customer String null
17 name customer String null
31
2.3 evaluate potential delivery environments and interaction
Advantages of .NET
32