Abstract
Nowadays the software project is becoming larger and larger, and it need thousands lines of coding to accomplish. It directly result that programmer’s work is heavier, besides there are a lot of duplicated works taken by programmer, For example, make model class, make add, update, select and delete methods base on the fields in database tables. The duplicated works result in mistakes easily. So we can reduce programmer’s work, and pull down the rate of mistakes in coding through the improvement of regulation in coding if we get an automatic tool to generate these duplicated codes.
This graduate design will implement an application that is able to turn data model into Java program code directly, the data model may come from the design result that is produced by the general design tools such as database model, xml data model. Meantime, the application implements a digit O-R relationship with BLL layer and DAL layer. All the tables in database, columns, field, primary key, foreign key, Null, Default, and unique index in the tables, is displayed in the class, and it allows you to set parameters during the process of producing code.
The design relies on the classic design of Pet shop which is a kind of factory design model and reflect model. It has the ability that produce Model class and basic DA Code according to tables from databases or xml data files, including producing properties, producing add, update, delete, select code.
The design is implemented with VS2005, using C# language and windows form. It supports Sqlserver database and xml data file as data source, and the software produce Java code through the background class according to data source.
The design finally results as CodeFactory1.0, the software can produce Java code from Model layer to BLL, and the relationships among all layers are conducted in factory design model, it can reduce the work intensity of programmer effectively.
Key Words :Factory Model, Factory Class, reflect model, Model Class, BLL Class
目 录