Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
project report helper
Active In SP

Posts: 2,270
Joined: Sep 2010
06-10-2010, 05:13 PM

.pdf   9279.pdf (Size: 773.52 KB / Downloads: 54)


Before developing a system, it is important for the system developer to understand the system thoroughly. This is done to ensure that the developed system will behaved as expected. Software developers normally will create the model of the system prior to developing the system. The model will highlight important aspects of the system such as data flow, interaction between the modules, etc so that the implementation can be done without any bugs or defects. Object-oriented system which is developed using object-oriented programming normally will be designed using object modeling techniques. UML is the common “tool” used to perform analysis and design in developing object-oriented systems.
Active In SP

Posts: 1,124
Joined: Jun 2010
15-10-2010, 03:59 PM

This article is presented by:
Andrew Kennedy
Claudio V. Russo
Generalized Algebraic Data Types
and ObjectOriented

Generalized algebraic data types (GADTs) have received much attention recently in the functional programming com- munity. They generalize the (type) parameterized algebraic datatypes (PADTs) of ML and Haskell by permitting value constructors to return speci_c, rather than parametric, type- instantiations of their own datatype. GADTs have a number of applications, including strongly-typed evaluators, generic pretty-printing, generic traversals and queries, and typed LR parsing. We show that existing object-oriented program- ming languages such as Java and C] can express GADT de_- nitions, and a large class of GADT-manipulating programs, through the use of generics, subclassing, and virtual dis- patch. However, some programs can be written only through the use of redundant runtime casts. Moreover, instantiation- speci_c, yet safe, operations on ordinary PADTs only admit indirect cast-free implementations, via higher-order encod- ings. We propose a generalization of the type constraint mechanisms of C] and Java to both avoid the need for casts in GADT programs and higher-order contortions in PADT programs; we present a Visitor pattern for GADTs, and de- scribe a re_ned switch construct as an alternative to virtual dispatch on datatypes. We formalize both extensions and prove type soundness.

Consider implementing a little language using an object- oriented programming language such as Java or C]. Ab- stract syntax trees in the language would typically be repre- sented using an abstract class of expressions, with a concrete subclass for each node type. An interpreter for the language can be implemented by an abstract `evaluator' method in the expression class, overridden for each node type. This is an instance of the Interpreter design pattern [6]. For example, take a language of integer, boolean and bi- nary tuple expressions: exp ::= con j exp + exp j exp - exp j exp == exp j exp && exp j exp || exp j exp ? exp : exp j (exp; exp) j fst(exp) j snd(exp) C] code to implement this abstract syntax and its interpreter is shown in Figure 1. Note in particular two points. First, the result of the eval method has the universal type object, as expressions can evaluate to integers, booleans or pairs. Second, evaluation can fail due to type errors: adding an integer to a boolean throws InvalidCastException. Now suppose that we decide to add static type-checking to the language, for example checking that arithmetic op- erations are applied only to integer expressions and that conditional expressions take a boolean expression as condi- tion and two expressions of the same type for the branches. We could easily add a method that checks the type of an expression. This would then assure us that evaluation can- not fail with a type error; however, the runtime casts in the evaluator code (e.g. (int) in Plus.Eval) are still necessary to convince C] of the safety of the evaluator. Now consider building types into the AST representation itself, using the generics feature recently added to C] and Java to parameterize the Exp class by the type of expressions that it represents. Then we can: _ de_ne Exp<T> and its subclasses to represent expres- sions of type T that are type correct by construction; _ give Eval the result type T and guarantee absence of type errors during evaluation. Figure 2 lists C] code that does just this. Observe how the type parameter of Exp is re_ned in subclasses; moreover, this re_nement is reected in the signature and code of the overridden Eval methods. For example, Plus.Eval has re- sult type int and requires no runtime casts in its calls to e1.Eval() and e2.Eval(). Not only is this a clever use of static typing, it is also more e_cient than the dynamically typed version, particularly in an implementation that per- forms code specialization to avoid the cost of boxing integers and booleans
For more information about this article,please follow the link



Important Note..!

If you are not satisfied with above reply ,..Please


So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page

Quick Reply
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  microwind software free download jaseelati 0 260 23-02-2015, 12:47 PM
Last Post: jaseelati
  computer oriented numerical methods ppt jaseelati 0 231 13-02-2015, 01:15 PM
Last Post: jaseelati
  software reuse seminar ppt jaseelati 0 286 30-12-2014, 04:59 PM
Last Post: jaseelati
  Object Oriented Programming with Java seminar paper 2 1,067 18-09-2014, 03:24 PM
Last Post: Radhika.m
  Intrusion Detection: An Energy Efficient Approach in Heterogeneous WSN pdf study tips 1 932 09-02-2014, 05:40 PM
Last Post: Guest
Last Post: seminar project topic
  Network Reconfiguration Using a Genetic Approach for Loss and Reliability Optimizati project report helper 1 1,590 16-10-2013, 05:35 AM
Last Post: dreambanned
  Development of Indian Sign Language Recognition System PPT study tips 2 1,020 20-09-2013, 10:00 AM
Last Post: seminar projects maker
  Software Agents pdf seminar projects maker 0 379 13-09-2013, 04:55 PM
Last Post: seminar projects maker
  3D Object Representations ppt seminar projects maker 0 246 13-09-2013, 11:54 AM
Last Post: seminar projects maker