Theoretical description of the electronic structure of ultrathin films and nanoclusters