tags:

views:

448

answers:

8

How to improve our productivity when starting new project using Delphi?

For me, I create a template project including splash screen, primary data module with default component and all data-aware subroutines (open, close, query, default when failed to open DB, etc), and save the template in my repository. (I use all my own frames and unit in the project, so everything always be created automatically when I choose : New Project and choosing my template.)

Questions:

  1. Is there any other way to improve reusability using Delphi?
  2. What free open source framework (like Jedi) / IDE PLugins (like GExpert) you think is best to use using Delphi?

Pardon me if this question has been asked before.

+7  A: 

For larger applications, the key to productivity is to work at a higher abstraction level than data module and database.

The database has a small set of types. In your domain you are likely to have default mappings from domain types to database types. You'll also have validators and formatters for them. You'll have default reports, filters and search (windows, panels, sql queries) for your domain entities. You'll have role-based access control to them.

Take a look at domain-driven development.

Stephan Eggermont
+1  A: 

Defining the exact range of applications you want to make is a good first step. Improving productivity is nearly always related to specialization. General tools is just an extremely small percentile of productivity. I'd rather search (or make) specialized frameworks in my line of work if I really wanted to boost productivity.

I don't use GExperts, or another plugin. I don't benefit greatly (being able to grep just fine on the cmdline) in productivity, and any crash that can be avoided due to problems in the plugin is then a pre.

Marco van de Voort
+1  A: 

I used ModelMaker with Delphi. It is really nice tool that lets you draw objects and then can generate code based on templates you write.

It can speed up things when there is number of similar classes in project.

zendar
+6  A: 

For Q1: Use mature libraries which do for you the grunt work: DevExpress -or- TMS for UI (JEDI's JVCL also is very good), FastReport for reporting. Choose also a good connectivity framework (it depends on your db back-end) in order to have many day-to-day tasks solved OOTB. Also, if you're familiar with OPF have a look at InstantObjects. I heard that's very nice.

For Q2: See the IDE enchancements from cnpack.org

Also it will help to slowly build your own specialized framework/set of tools. Not something very big but as a quick way to get some things done in your way. Always try to design for reuse, even if it takes a little bit longer in the beginning.

+1  A: 

For Q2: GExperts is useful. The grep search comes in particularly handy, although the search / replace can cause odd side affects (inserting characters it shouldn't!).

I know you mentioned free / open source, but Castalia is very good. The refactoring methods work well and I like the structural highlighting, which makes it much easier to work with code (I did originally use CodeRush for this but it went Visual Studio only). The Bookmark stack is also handy for quick going back and forth through code.

Pauk
A: 

Also, if you are a team, look for ways to improve your development process. Besides using Delphi as your implementation language, what are your project management methods? What source code management system do you use? What is your build system? Do you use automated testing methods? etc.

When I introduced Scrum at a previous employer, we got an almost immediate 50% improvement in team productivity. So check out the various Agile methodologies.

A: 

For true reusability, try to think in interfaces and try to black box as much as possible. Patterns are everywhere, research them and put them into practice.

When dealing with objects, as much as possible use the abstract, or an interface rather than a concrete implementation. Just be careful of taking this too far. Too many abastractions can add complexity and make debugging harder.

Units containing your business rules should be used by your gui. Units containing business rules should never themselves directly use gui units.

skamradt
+2  A: 

One of my big gains in reusability in recent years has been moving to an ORM layer (I use tiopf) to separate out my business objects from the database.

As an example, I have db persisted, background threaded email objects. To add them to another application, I add in the required units and add a few lines of configuration (table/field mapping). Similarly I have user objects, generic lookup lists and the like all of which can be added to different projects for the price of initial configuration. This works on different databases without any changes other than configuration.

tiopf is my ORM of choice (read my overview here) but there are numerous others.

SeanX