This paper aims to develop a computational framework to design reconfigurable unmanned aerial vehicles (UAVs) that are inspired by modular platform planning. These reconfigurable UAVs are unique in their ability to be assembled on-field into configurations that can perform diverse missions. While reconfigurable UAV platforms are rare in the literature, specialized frameworks to design modular/ reconfigurable UAVs are even rarer. A new design framework founded on object-oriented computing is presented here. Such an approach to modular design allows flexible addition and evolution of modules, and integration of different algorithms that interact with the module objects in estimating the quantities of interest (e.g. aerodynamic forces). A corollary benefit is the provision for automated batch execution of 3D CAD updates during design optimization. A case study is performed to design a set of modules that can be assembled either into a quadrotor UAV or into a fixed-wing UAV, where their endurances are simultaneously maximized, subject to various constraints associated with mission requirements (e.g., payload), geometry, and module interactions. Results show that the best trade-off reconfigurable UAV designs, while expectedly compromising on endurance, provide a remarkable 40% mass savings compared to a set of optimized dedicated quadrotor and fixed-wing UAVs.